06.06.2012, 22:05
Alright here's the code:
Add this anywhere you like.
Then add this in the public function "OnPlayerConnect"
You may change the words, and the colors as you like.
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;
}
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);
}

