Quote:
Originally Posted by JustinAn
Alright here's the code:
Add this anywhere you like.
pawn Код:
stock IsValidName(playerid) { if (IsPlayerConnected(playerid)) { new player[24]; GetPlayerName(playerid,player,24); for(new n = 0; n < strlen(player); n++) { if (player[n] == '_' && player[n+1] >= 'A' && player[n+1] <= 'Z') return 1; if (player[n] == ']' || player[n] == '[') return 0; } } return 0; }
Then add this in the public function "OnPlayerConnect"
pawn Код:
if(!IsValidName(playerid)) { SendClientMessage(playerid,COLOR_RED,"You have been kicked, reason: Invalid RolePlay Name."); SendClientMessage(playerid,COLOR_WHITE,"HINT: Acceptable Roleplay Name (E.G: Ethan_Crowley)"); Kick(playerid); }
You may change the words, and the colors as you like.
|
That shouldn't work, since it checks if the name is EQUAL to the a>z things,
You have to compare it, not make it equal to.