Advertising
#1

Where can I find something which will ban a player if they are advertising another server ingame?
Reply
#2

You mean a system to detect if somebody types an IP in your server?
Reply
#3

yes exactly
Reply
#4

Not sure how it can be scripted, ask in the Scripting Section, but I wouldn't advise banning them automatically, as sometimes it detects RP radio codes such as: "10-4", also, someone could just be typing a Teamspeak IP or something, I would recommend that if an IP is detected, that it just warns all online admins.
Reply
#5

I know it exsist here on the forum but I don't find it atm
Reply
#6

pawn Код:
stock IpCheck(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);

public OnPlayerText(playerid)
{
     if(IpCheck(text))
     {
          //punish code here
     }
      return 1;
}
Reply
#7

someone
Reply
#8

lol check above i just gave you.
Reply
#9

pawn Код:
#include <a_samp>

new strR[255];

#define FILTERSCRIPT
#define VERSION "1.0"

public OnPlayerText(playerid, text[])
{
    new is1=0;
    new r=0;
    while(strlen(text[is1]))
    {
    if('0'<=text[is1]<='9')
    {
    new is2=is1+1;
    new p=0;
    while(p==0)
    {
    if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
    else
    {
    strmid(strR[r],text,is1,is2,255);
    if(strval(strR[r])<255) r++;
    is1=is2;
    p=1;
    }
    }
    }
    is1++;
    }
    if(r>=4)
    {
    new strMy[255];
    new STRname[255];
    GetPlayerName(playerid,STRname,255);
    format(strMy, sizeof(strMy), " Suspicion advertising %s(%d): %s",STRname,playerid,text);
    for(new j1=0; j1 < MAX_PLAYERS;j1++)
    if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, strMy);
    for(new z=0;z<r;z++)
    {
    new pr2;
    while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text[i]='*';
    Kick(playerid);
    }
    }
    return 1;
}
Note: This won't ban, just kick.
Next time, use search before you make a thread.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)