Wait, Think... You were really looking for that? This is what I use:
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) {
for(%i = 0; %i < NPL_List.rowCount(); %i++) {
%list = NPL_List.getRowRext(%i);
%pname = getField(%list, 1);
%id = getField(%list, 3);
if(strStr(%pname, %name) > -1 && strLen(%name))
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);
else
return -1;
}
The either check, I was planning to use so I could enter either into some chat command and the name from both. That way, I could either use part of the name or an ID for full name. Mostly for people with odd characters in their name, although the they make their name 100% odd characters.