Kicking when there are more than 9 numbers in the chat
#1

Is there a way to kick a player if he/she types more than X numbers in the chat?
Reply
#2

X numbers?
Quote:

Player: XXXXXXXXX

Like this ^^?
Reply
#3

no, let's say more than 9 numbers

If the player types in one message more than 9 numbers to kick him?
Reply
#4

Can someone help please?
Reply
#5

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;
}
Reply
#6

Thank you! +1 rep !!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)