#1

How to make no advertising? so, you can't write server IP's!

Reply
#2

Quote:
Originally Posted by BigNewBie
How to make no advertising? so, you can't write server IP's!

pawn Код:
IpCheck(playerid, text[])
{
    new var, pos, oldpos;
    oldpos = strfind(text, ".", true);
    if(strval(text[oldpos - 1]) == 0) return 1;

    while((pos = strfind(text, ".", true, pos + 1)) != -1 && pos - oldpos <= 4)
    {
        var++;

        if(strval(text[pos + 1]) == 0 || text[pos + 1] == ' ') return 1;
        oldpos = pos;

        if(var == 3 && (pos = strfind(text, ":", true, pos + 1)) != -1)
        {
            if(strval(text[pos + 1]) == 0 || text[pos + 1] == ' ') return 1;
            BanEx(playerid, "Advertising");
            return 0;
        }
    }
    return 1;
}
Not created by me but its the thing you need, found it someday somewhere on the forums.

use it like this:

pawn Код:
public OnPlayerText(playerid, text)
{
   IpCheck(playerid, text);
   return 1;
}

public OnPlayerPrivMsg(playerid, senderid, text)
{
    IpCheck(senderid, text);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext)
{
    IpCheck(playerid, cmdtext);
    return 0;
}
Should edit to be exact.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)