28.08.2014, 19:49
hey i need an IP detector if some one try to spam and server IP on chat then change the ip like this **.***.**.****
please tell me the script
please tell me the script
public OnPlayerText(playerid, text[])
{
if(stringContainsIP(text))
{
Kick(playerid);
}
return 0;
}
stock stringContainsIP(string[])
{
new
dotCount
;
for(new i; string[i] != EOS; ++i)
{
if(('0' <= string[i] <= '9') || string[i] == '.' || string[i] == ':')
{
if((string[i] == '.') && (string[i + 1] != '.') && ('0' <= string[i - 1] <= '9'))
{
++dotCount;
}
continue;
}
}
return (dotCount > 2);
}