Anti-Advertise Help+Rep
#6

Edited:

pawn Код:
public OnPlayerText(playerid, text[])
{

    if(stringContainsIP(text))
    {
        new sendername[MAX_PLAYER_NAME], string[128];
        // ^ Remove this line if sendername & string is already defined.
       
        GetPlayerName(playerid, sendername, 24);
        format(string, sizeof string, "AdmCmd: %s was kicked, reason: Server Advertise", sendername);
        SendClientMessageToAll(COLOR_LIGHTRED, string);
        KickLog(string);
        Kick(playerid);
        return 0;
    }
   
    //Other stuff..
   
    return 1;
}

stock stringContainsIP(const szStr[])
{
    new
        iDots,
        i
    ;
    while(szStr[i] != EOS)
    {
        if('0' <= szStr[i] <= '9')
        {
            do
            {
                if(szStr[i] == '.')
                    iDots++;
               
                i++;
            }
            while(('0' <= szStr[i] <= '9') || szStr[i] == '.' || szStr[i] == ':');
        }
        if(iDots > 2)
            return 1;
        else
            iDots = 0;
       
        i++;
    }
    return 0;
}
Easy to read?
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: 5 Guest(s)