SA-MP Forums Archive
Restric name ???? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Restric name ???? (/showthread.php?tid=84460)



Restric name ???? - 6tynine - 30.06.2009

what code to i need to insert to restric a name to stop players using a anti cheat bot name? And basicly kicking them from the game.


Re: Restric name ???? - Jefff - 30.06.2009

connect
Код:
new nick[24];
GetPlayerName(playerid,nick,24);
if(!strcmp("AH_Name",nick,true)) {
Kick(playerid);
}



Re: Restric name ???? - Grim_ - 30.06.2009

Or something like this:
pawn Код:
//Top
#define MAX_BAD_NAMES  2 // Number of "bad names" you will have in the array
new BanNames[MAX_BAD_NAMES][MAX_PLAYER_NAME] =
{
  "OneRestrictedName",
};

//OnPlayerConnect
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
for(new b = 0; b < sizeof(BadNames); ++)
{
  if(!strcmp(name, b, true))
  {
   Kick(playerid);
  }
}
Sorry if any mistakes, I"m very tired even though its only 20:00.