24.06.2010, 15:39
Thank you for writing it.I have tried it, it works with full name, but it doesnt with part of name.
I have found a solution, which works, its form extreme admin:
stock ReturnPlayerID(PlayerName[]) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { new name[24]; GetPlayerName(i,name,24); if(strfind(name,PlayerName,true)!=-1) return i; }
return INVALID_PLAYER_ID;
}
How can i make that, if there are multiple users with the same "part of the name" (for example clan symbols), it returns an error message ?
I have found a solution, which works, its form extreme admin:
stock ReturnPlayerID(PlayerName[]) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { new name[24]; GetPlayerName(i,name,24); if(strfind(name,PlayerName,true)!=-1) return i; }
return INVALID_PLAYER_ID;
}
How can i make that, if there are multiple users with the same "part of the name" (for example clan symbols), it returns an error message ?