Anti-Advertising
#1

I guess the thread's name says all, but anyways I'll explain more.
I want to make people un-able to advertise in my server, something like.
when someone posts an IP it'll display like **.**.**:***
Thanks
hope someone will be able to help me anytime soon.
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, ":", true) != -1)
    {
        new i_numcount, i_period, i_pos;
        while(text[i_pos])
        {
            if('0' <= text[i_pos] <= '9') i_numcount ++;
            else if(text[i_pos] == '.') i_period ++;
            i_pos++;
        }
        if(i_numcount >= 8 && i_period >= 3)
        {
            Kick(playerid);
            //use anything here, like a ban or something
            //you can also create warnings, but i doubt that would be good :p
            return 0;
        }
    }
    return 1;
}
Reply
#3

Thanks alot
Locked
Reply
#4

To add onto what's already here: you probably should add exceptions such as you servers IP and private IP ranges.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)