You should use allplayers tho..
Crow added something like this on Esteria, he did the getAccountName() one..
PHP Code:
public function getAccountName(community) {
temp.getaccount = 0;
for (temp.i: allplayers) {
if (i.communityname == cname) {
getaccount = i.account;
}
}
return getaccount;
}
// hehe, ty Napo
public function getCommunityName(acct) {
return findplayer(acct).communityname;
}
but personally with your scrit I would do:
PHP Code:
public function findName(n) {
temp.out = 0;
for(temp.i : allplayers) {
if(i.account.pos(n) > -1) {
out = {i.account, i.communityname};
break;
}else if (i.communityname.pos(n) > -1) {
out = {i.account, i.communityname};
break;
}
}
return out;
}
would return an array of "<acct>, <communityname>"