function findNameByPLID(%id) {
for(%i = 0; %i < NPL_List.rowCount(); %i++) {
%list = NPL_List.getRowText(%i);
%name = getField(%list,1);
%pid = getField(%list,3);
if(%id == %pid)
return %name;
}
return false;
}
function findIDByPLName(%name) {
if(strLen(%name)) {
for(%i = 0; %i < NPL_List.rowCount(); %i++) {
%list = NPL_List.getRowText(%i);
%pname = getField(%list, 1);
%id = getField(%list, 3);
if(strStr(%pname, %name) > -1)
return %id SPC %pname;
}
}
return -1;
}
function findNameByEither(%either) {
%PLID = findNameByPLID(%either);
%PLName = findIDByPLName(%either);
if(%PLName == 0 && %PLID != -1)
return %PLID;
else if(%PLID == -1 && firstWord(%PLName) != 0)
return restWords(%PLName);
return -1;
}
That's what I use for searching playerlist.