Quote:
Originally Posted by Chompy
PHP Code:
function checkPlayer(plyr) { temp.a = findplayer(plyr); if (a == 0) a = findplayerbycommunityname(plyr); if (a == 0) return 0; return 1; }
|
Jesus chompy what are you doing to me man, you scared the crap out of me.
Before you edited your post I had this in the quick reply box:
PHP Code:
function _getPlayer(pl) {
temp.p = findplayerbycommunityname(pl);
if (temp.p == 0) {
temp.p = findplayer(pl);
if (temp.p == 0) {
return 0;
} else {
return temp.p;
}
} else {
return temp.p;
}
}
[EDIT]
Actually that can probably be optimised:
PHP Code:
function _getPlayer(pl) {
temp.p = findplayerbycommunityname(pl);
return p == 0 ? findplayer(pl) : p;
}
[/EDIT]