Max 8 numbers in one chat.
#1

Hey all. So I have a function which detects if the player is trying to advertise a server, but I want to make it to max 8 numbers only and remove the dots and colons, like only 7 numbers allowed in chat. Here is the function:
pawn Код:
stock IsAnIP(const str[])
{
    new i;
    new colon;
    new dots;
    new numbers;
    new len = strlen(str);
    while (i < len)
    {
        if (str[i] == ':') colon++;
        else if (str[i] == '.') dots++;
        else if (str[i] >= '0' || str[i] <= '9') numbers++;
        i++;
    }
    if (colon > 0 && dots > 2 && numbers > 4) return 1;
    return 0;
}
Thanks for helping.
Reply


Messages In This Thread
Max 8 numbers in one chat. - by Necip - 14.03.2014, 13:31
Re : Max 8 numbers in one chat. - by Golimad - 14.03.2014, 13:57
Re: Max 8 numbers in one chat. - by Necip - 14.03.2014, 14:12
Re : Max 8 numbers in one chat. - by Golimad - 14.03.2014, 14:18
Re: Max 8 numbers in one chat. - by Necip - 15.03.2014, 13:10
Re : Max 8 numbers in one chat. - by Golimad - 15.03.2014, 13:13
AW: Max 8 numbers in one chat. - by CutX - 15.03.2014, 13:17
Re: Max 8 numbers in one chat. - by Emmet_ - 15.03.2014, 13:20
Re: Max 8 numbers in one chat. - by Djole1337 - 15.03.2014, 13:20
Re: Max 8 numbers in one chat. - by RajatPawar - 15.03.2014, 13:27

Forum Jump:


Users browsing this thread: 3 Guest(s)