SA-MP Forums Archive
Hey auto kick - 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: Hey auto kick (/showthread.php?tid=280613)



Hey auto kick - GTA-Roleplay - 02.09.2011

Hi, I'm so tired of people coming in to my server and spamming ip, there is something anti-cheat against the


Re: Hey auto kick - Improvement™ - 02.09.2011

Just to make sure, are you searching for something such as Filterscript or do you want us to give examples and perhaps explain you how to make your own?


Re: Hey auto kick - FireCat - 02.09.2011

pawn Код:
FindIP(StrToChk[])
{
    new IpLevel = 0;
    for(new a = 0; a < strlen(StrToChk); a++)
    {
        switch(IpLevel)
        {
            case 0:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
            }
            case 1, 2:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else if(StrToChk[a] == '.') IpLevel = 4;
                else IpLevel = 0;
            }
            case 3:
            {
                if(StrToChk[a] == '.') IpLevel++;
                else IpLevel = 0;
            }
            case 4:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else IpLevel = 0;
            }
            case 5, 6:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else if(StrToChk[a] == '.') IpLevel = 8;
                else IpLevel = 0;
            }
            case 7:
            {
                if(StrToChk[a] == '.') IpLevel++;
                else IpLevel = 0;
            }
            case 8:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else IpLevel = 0;
            }
            case 9, 10:{
                if(isNumeric(StrToChk[a])) IpLevel++;
                else if(StrToChk[a] == '.') IpLevel = 12;
                else IpLevel = 0;
            }
            case 11:
            {
                if(StrToChk[a] == '.') IpLevel++;
                else IpLevel = 0;
            }
            case 12:
            {
                if(isNumeric(StrToChk[a])) return 1;
                else IpLevel = 0;
            }
        }
    }
    return 0;
}
You will need isNumeric function found in ZCMD or dini.
then under OnPlayerText
EDIT:
Ty lorenc, add this
pawn Код:
//OnPlayerText!
if(FindIP(text))
{
    //DO YOUR CODE!
}



Re: Hey auto kick - Lorenc_ - 02.09.2011

Quote:
Originally Posted by FireCat
Посмотреть сообщение
pawn Код:
FindIP(StrToChk[])
{
    new IpLevel = 0;
    for(new a = 0; a < strlen(StrToChk); a++)
    {
        switch(IpLevel)
        {
            case 0:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
            }
            case 1, 2:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else if(StrToChk[a] == '.') IpLevel = 4;
                else IpLevel = 0;
            }
            case 3:
            {
                if(StrToChk[a] == '.') IpLevel++;
                else IpLevel = 0;
            }
            case 4:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else IpLevel = 0;
            }
            case 5, 6:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else if(StrToChk[a] == '.') IpLevel = 8;
                else IpLevel = 0;
            }
            case 7:
            {
                if(StrToChk[a] == '.') IpLevel++;
                else IpLevel = 0;
            }
            case 8:
            {
                if(isNumeric(StrToChk[a])) IpLevel++;
                else IpLevel = 0;
            }
            case 9, 10:{
                if(isNumeric(StrToChk[a])) IpLevel++;
                else if(StrToChk[a] == '.') IpLevel = 12;
                else IpLevel = 0;
            }
            case 11:
            {
                if(StrToChk[a] == '.') IpLevel++;
                else IpLevel = 0;
            }
            case 12:
            {
                if(isNumeric(StrToChk[a])) return 1;
                else IpLevel = 0;
            }
        }
    }
    return 0;
}
You will need isNumeric function found in ZCMD or dini.
then under OnPlayerText
add FindIP(text);
Never seen that function though it's procedure should be like this:
pawn Код:
//OnPlayerText!
if(FindIP(text))
{
    //DO YOUR CODE!
}
The search button can be awesome, and I adore it.


Re: Hey auto kick - FireCat - 02.09.2011

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
Never seen that function though it's procedure should be like this:
pawn Код:
//OnPlayerText!
if(FindIP(text))
{
    //DO YOUR CODE!
}
The search button can be awesome, and I adore it.
Shit, ye sorry.
You need to use the if statement.
Sorry