Quote:
Originally Posted by RedFusion
I made this one for you, enjoy! I did not try to compile this btw.
pawn Код:
stock GetPlayerIDFromName(input[]) { /* -1 = NO INPUT -2 = NO PLAYER FOUND -3 = MULTIPLE PLAYERS FOUND */
if(strlen(input) == 0) return -1;
new name[MAX_PLAYER_NAME+1], savedplayerid, matches; for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { if(!IsPlayerConnected(playerid)) continue;
GetPlayerName(playerid,name,sizeof(name)); if(strfind(name,input,true) != -1) { matches++; savedplayerid = playerid; } } if(matches == 0) return -2; else if(matches > 1) return -3; return savedplayerid; }
|
That wont change anything... He already has the function but he mis used it ... Like if i want to ban you (your name is Blah_Blah) and i have another one with a name blah_hey so writing /ban blah > according to the script it will either choose a random name... from yours or his or tell him its invalid ... so using blah_bl would identify it more clearly << >> Using the player's ID in such functions is recommended