Servers advertisment
#1

How can i make it so

if a player types a number between 1-255 . 1-255 . 1-255 . 1-255 it will ban him
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
 return 1;
}
Reply
#3

lol.. thanks for letting me know there is a public like that..
but seriously what do i do?
Reply
#4

try this, i didnt check

pawn Код:
stock bool: IsIPInText(txt[])
{
    new
        pos = 0,
        _1,
        _2,
        _3,
        _4,
        str[9],
        delims[] =
        {
            ';',    '|',
            ',',  ' ',
            '.',    '-',
            '~',    '*',
            '/'
        };
    while(txt[pos])
    {
        for(new n = 0; n < sizeof(delims); n++)
        {
            format(str, sizeof(str), "p<%c>dddd", delims[n]);
            if(!sscanf(txt[pos], str, _1, _2, _3, _4))
            {
                if(0 <= _1 <= 255 &&
                  0 <= _2 <= 255 &&
                  0 <= _3 <= 255 &&
                  0 <= _4 <= 255)
                {
                    return true;
                }
            }
        }
        pos++;
    }
    return false;
}
use sscanf
Reply
#5

Thanks but i dont have scanf
only got defult
Reply
#6

Put numbers in antiswear, so it will become a '*' in the chat.
There is no way to make the thing u want, because it will ban the player when he types every number.
Reply
#7

This is just wrong and fucked up
Reply
#8

Thanks man! you're great!
But it does nothing when i type 1.1.2.5
where do i add the ban or kick feature?
Reply
#9

he say ONLY when he type FULL IP something like this

188.72.225.174:3500 then will work
Reply
#10

Код:
if(IsIP(text[]))
{
Ban(playerid);
return1;
}
i think this is what you would put that under onplayertext
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)