15.06.2012, 10:27
ok, I tried to made anti IP adversting, how I check my code its fine but not working what's wrong?
note: its not all codes from OnPlayerText
pawn Код:
stock bool:CheckIPAdversting(string[])
{
new numbers, lenght, dot, dot2;
lenght = strlen(string);
for(new i = 0; i < lenght; i++)
{
if(IsNumeric(string[i]))
{
numbers++;
}
if(strcmp(string[i],".",true) == 0)
{
dot++;
}
if(strcmp(string[i],":",true) == 0)
{
dot2++;
}
}
if(numbers >= 5 && dot > 0 && dot2 >= 0) return true;
else return false;
}
public OnPlayerText(playerid, text[])
{
if(CheckIPAdversting(text))
{
format(string,sizeof(string),"( ! ) %s has been kicked by the server for: IP Advertising !",PlayerName(playerid));
SendClientMessageToAll(COLOR_RED,string);
Kick(playerid);
return 0;
}
return 0;
}