Anti-Advertise Help+Rep
#3

Код:
Under OnPlayerText

    if(stringContainsIP(text))
	{
    new
        string[128]
    ;
    GetPlayerName(playerid, string, 20);
    format(string, sizeof(string), "[!] \"%s\" named player has been banned from the server! [Reason: IP advertisements]", string);
    SendClientMessageToAll(0xFFFFFFFF, string);

    

    return Ban(playerid), false;
	}





//anywhere
stock stringContainsIP(string[])
{
    new
        dotCount
    ;
    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);
}

this func by Ryder` :D
try this
Reply


Messages In This Thread
Anti-Advertise Help+Rep - by Dan_Barocu - 19.02.2012, 21:01
Re: Anti-Advertise Help+Rep - by Madd Kat - 19.02.2012, 21:03
Re: Anti-Advertise Help+Rep - by Sufyan - 19.02.2012, 21:08
Re: Anti-Advertise Help+Rep - by Dan_Barocu - 19.02.2012, 21:09
Re: Anti-Advertise Help+Rep - by Madd Kat - 19.02.2012, 21:12
Re: Anti-Advertise Help+Rep - by iPLEOMAX - 19.02.2012, 21:15
Re: Anti-Advertise Help+Rep - by Dan_Barocu - 19.02.2012, 21:17
Re: Anti-Advertise Help+Rep - by Madd Kat - 19.02.2012, 21:22
Re: Anti-Advertise Help+Rep - by Dan_Barocu - 19.02.2012, 21:24
Re: Anti-Advertise Help+Rep - by RyDeR` - 19.02.2012, 21:26

Forum Jump:


Users browsing this thread: 6 Guest(s)