05.11.2013, 17:32
Is there a way to kick a player if he/she types more than X numbers in the chat?
Player: XXXXXXXXX |
stock FindNumbers(text[])
{
new count;
for(new i, j = strlen(text); i < j; ++i)
{
if('0' <= text[i] <= '9'))
{
++ count;
}
}
return (count > 9); // change 9 to whatever numbers you want to check
}
public OnPlayerText(playerid, text[])
{
if(FindNumbers(text))
{
Kick(playerid); //etc
}
return 1;
}