First, I normally do use else ifs. I dont know what i was doing with this one, but i must have forgot.
Second, my temp.foundPlayers.destroy() was me being dumb. I looked up on the wiki what i actually needed to put and fixed it. Idk why it is still there in this one...
third, i believe i put something like this:
PHP Code:
temp.f = function (temp.pl,search) {
return (temp.pl.account.starts(search)|| temp.pl.communityname.starts(search)|| temp.pl.nick.starts(search) && temp.pl.level != NULL;
};
temp.foundPlayers = filter(temp.f, allplayers);
search in this case was the string for the substring player.chat. In otherwords, the player i was searching for.