07.05.2012, 00:50
Kickando o player fica mais fбcil..
pawn Код:
public OnPlayerConnect(playerid) {
new n[24];
GetPlayerName(playerid, n, 24);
if(!IsARolePlayName(n)) {
SendClientMessage(playerid, -1, "Nick invбlido...");
Kick(playerid);
}
return true;
}
stock IsARolePlayName(name[]) //by Lenny
{
new
szLastCell,
bool: bUnderScore;
for(new i; i < strlen(name); i++)
{
if(name[i] == '_')
{
if(bUnderScore == true)
{
return 0;
}
bUnderScore = true;
}
else if(!szLastCell || szLastCell == '_')
{
if(name[i] < 'A' || name[i] > 'Z')
{
return 0;
}
}
else
{
if(name[i] < 'a' || name[i] > 'z')
return 0;
}
szLastCell = name[i];
}
if(bUnderScore == false)
return 0;
return 1;
}