SA-MP Forums Archive
Anti-Advertising - 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: Anti-Advertising (/showthread.php?tid=535475)



Anti-Advertising - Biggy54 - 04.09.2014

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.


Re: Anti-Advertising - Kyance - 04.09.2014

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;
}



Re: Anti-Advertising - Biggy54 - 04.09.2014

Thanks alot
Locked


Re: Anti-Advertising - rymax99 - 04.09.2014

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