Kicking when there are more than 9 numbers in the chat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kicking when there are more than 9 numbers in the chat (
/showthread.php?tid=473988)
Kicking when there are more than 9 numbers in the chat -
martoivanov - 05.11.2013
Is there a way to kick a player if he/she types more than X numbers in the chat?
Re: Kicking when there are more than X numbers in the chat -
Beckett - 05.11.2013
X numbers?
Like this ^^?
Re: Kicking when there are more than X numbers in the chat -
martoivanov - 05.11.2013
no, let's say more than 9 numbers
If the player types in one message more than 9 numbers to kick him?
Re: Kicking when there are more than 9 numbers in the chat -
martoivanov - 09.11.2013
Can someone help please?
Re: Kicking when there are more than 9 numbers in the chat -
Loot - 09.11.2013
Well first you need to detect if whatever he types in 9 numbers:
pawn Код:
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
}
Then place that on:
pawn Код:
public OnPlayerText(playerid, text[])
{
if(FindNumbers(text))
{
Kick(playerid); //etc
}
return 1;
}
Re: Kicking when there are more than 9 numbers in the chat -
martoivanov - 13.11.2013
Thank you! +1 rep !!!!