SA-MP Forums Archive
Help For Anti pub - 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: Help For Anti pub (/showthread.php?tid=483680)



Help For Anti pub - AlexBlack - 27.12.2013

Hello , I search a Script Fix a player publicity for another server like

player say : 11.11.11.11:1111 << Server Ip

player will be kick for the server << Punition

i searched in search but i dont find


Plz Help.
Thanks.
and sorry for my bad english


Re: Help For Anti pub - xVIP3Rx - 27.12.2013

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(stringContainsIP(text) Kick(playerid);
    return 1;
}

stock stringContainsIP(string[]) //Thanks to RyDer for this function
{
    new dotCount;
    if(string[0])
    {
        if(!strfind(string,"www.",false) || !strfind(string,"http://",false)
        || !strfind(string,".com",false) || !strfind(string,".net",false)
        || !strfind(string,".de",false)  || !strfind(string,".org",false))
        return true;
    }
    for(new i; string[i] != EOS; ++i)
    {
        if(('0' <= string[i] <= '9') || string[i] == '.' || string[i] == ':')
        {
            if((string[i] == '.') && (string[i + 1] != '.') && ('0' <= string[i - 1] <= '9'))
            {
                ++dotCount;
            }
            continue;
        }
    }
    return (dotCount > 2);
}



Re: Help For Anti pub - AlexBlack - 27.12.2013

Thx , But i have a error
this :
error 001: expected token: ")", but found "-identifier-"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: Help For Anti pub - Hansrutger - 27.12.2013

Lol, you just copied what he wrote instead of looking at it, look at the if-statement in OnPlayerText. If you looked instead of just copy then you would probably have noticed it as it was the first thing I noticed when I read it. -.-'


Re: Help For Anti pub - AlexBlack - 27.12.2013

okay thanks