29.10.2010, 23:39
pawn Код:
stock ReturnUser(string[])
{
new IsNumerical=1;
new tmpstring[MAX_PLAYER_NAME];
for(new cell; cell < strlen(string); cell++) if((string[cell]<='0') || (string[cell]>='9'))IsNumerical=0;
if(IsNumerical)return strval(string);
else {
for(new players; players < MAX_PLAYERS; players++) {
GetPlayerName(players,tmpstring,sizeof(tmpstring));
if(strfind(tmpstring,string,true)>-1)return players;
}
}
return INVALID_PLAYER_ID;
}

