30.06.2009, 22:48
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.
new nick[24]; GetPlayerName(playerid,nick,24); if(!strcmp("AH_Name",nick,true)) { Kick(playerid); }
//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);
}
}