BAN function.
#4

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
Reply


Messages In This Thread
BAN function. - by audriuxxx - 19.06.2013, 20:27
Re: BAN function. - by feartonyb - 19.06.2013, 21:08
Re: BAN function. - by RedFusion - 19.06.2013, 21:13
Re: BAN function. - by CROSS_Hunter - 19.06.2013, 21:18
Re: BAN function. - by RedFusion - 19.06.2013, 21:27

Forum Jump:


Users browsing this thread: 1 Guest(s)