30.08.2012, 00:07
use this code... put there in the exactly way it is here.
most problem this code is not working well, cause you got a "return" before it, that's why i'm telling you to let this whole code alone on onplayerconnect.
most problem this code is not working well, cause you got a "return" before it, that's why i'm telling you to let this whole code alone on onplayerconnect.
pawn Код:
public OnPlayerConnect(playerid)
{
static name[MAX_PLAYER_NAME],i = 0,u,bool:fail[MAX_PLAYERS];
GetPlayerName(playerid, name, sizeof name);
u = strlen(name);
for(; i < u; ++i)
{
if(name[i] == '_')
{
i--;
if('a' >= name[i] <= 'z' || 'A' >= name[i] <= 'Z')
{
i+= 2;
if('a' >= name[i] <= 'z' || 'A' >= name[i] <= 'Z')
{
fail[playerid] = false;
break;
}
}
}
fail[playerid] = true;
}
if(fail[playerid] == true)
{
SendClientMessage(playerid,-1, "Your name isґnt a RP format.");
Kick(playerid);
}
return 1;
}