[pawn]public OnPlayerConnect(playerid)
{
NickPlayerChar(playerid);
return 1;
}[/pawn]
[pawn]stock IsNumeric(string[]) { for (new i = 0, j = strlen(string); i < j; i++) if (string > '9' || string < '0') return 0; return 1; }
//==============================================================================
public NickPlayerChar(playerid)
{
if(IsInvalidChar(PlayerName(playerid))) {
new MSN[256];
format(MSN,256,">> Server Auto-Kick: %s, Reason:[ Invalid Nick ].", PlayerName(playerid));
SendClientMessageToAll(BLUE,MSN);
Kick(playerid);
}
}
//==============================================================================
public IsInvalidChar(c[])
{
if (strfind(c, "%", true) != -1 || strfind(c, "*", true) != -1 ||
strfind(c, "#", true) != -1 || strfind(c, "-", true) != -1 ||
strfind(c, "@", true) != -1 || strfind(c, "+", true) != -1 ||
strfind(c, "!", true) != -1 || strfind(c, ":", true) != -1 ||
strfind(c, "^", true) != -1 || strfind(c, "\", true) != -1 ||
strfind(c, "&", true) != -1 || strfind(c, "|", true) != -1)
return 1;
if (IsNumeric(c)) return 1;
else return 0;
return 1;
}
//==============================================================================
public PlayerName(playerid)
{
new name[24];
GetPlayerName(playerid,name,24);
return name;
}
//==============================================================================
[/pawn]
i don't remember so well if i forget something tell me and i add it okay im in my cellphone and i'ts to hard to copy all that ._. from my old script