01.09.2018, 00:32
Код:
ReturnUser(PlayerName[]) { if(IsNumeric(PlayerName)) return strval(PlayerName); else { new found=0, id; foreach(new i : Player) { new foundname[MAX_PLAYER_NAME]; GetPlayerName(i, foundname, MAX_PLAYER_NAME); new namelen = strlen(foundname); new bool:searched=false; for(new pos=0; pos <= namelen; pos++) { if(searched != true) { if(strfind(foundname,PlayerName,true) == pos) { found++; id = i; } } } } if(found == 1) return id; else return INVALID_PLAYER_ID; } }