Server Anti Advertisement Help
#1

Can someone send me a Server Anti Advertisement I really need one because some noobs keep entering our server and advertiseing.
Please can someone help me i will be very happy
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
    new str[256];
    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(str[r],text,is1,is2,255);
                    if(strval(str[r])<255) r++;
                    is1 = is2;
                    p = 1;
                }
            }
        }
        is1++;
    }
    if(r>=4)
    {
        for(new z=0;z<r;z++)
        {
            new pr2;
            while((pr2=strfind(text,str[z],true))!=-1) for(new i=pr2,j=pr2+strlen(str[z]);i<j;i++) text[i]='*';
        }
    }
    return 1;
}
Reply
#3

//=========================[Anti-server advertisement]==========================
new dotcount =0;
new coloncount =0;
for(new a=1; a <strlen(cmdtext); a++)
{
if(cmdtext[a] == ':')
{
coloncount ++;
}
else
if(cmdtext[a] == '.')
{
dotcount ++;
}
}
if(dotcount == 3 && coloncount == 1 && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to advertise other servers here.");
return 1;
}
if(gPlayerLogged[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("[cmd] [%s] %s", sendername, cmdtext);


------------------------------------------------------------------------------------------------------------------
in OnPlayerCommandText()
new ip[15];
if(ipmatch(result, ip))
{
format(string, sizeof(string), "AdmCmd: %s was banned by ANTICHEAT, reason: Server Advertising.", RemoveUnderScore(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
BanEx(playerid, "Banned By: Autoban Reason: Server Advertising");
return 0;
Reply
#4

Great script TheMaddox!
Reply
#5

Quote:
Originally Posted by TheMaddox
Посмотреть сообщение
//=========================[Anti-server advertisement]==========================
new dotcount =0;
new coloncount =0;
for(new a=1; a <strlen(cmdtext); a++)
{
if(cmdtext[a] == ':')
{
coloncount ++;
}
else
if(cmdtext[a] == '.')
{
dotcount ++;
}
}
if(dotcount == 3 && coloncount == 1 && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to advertise other servers here.");
return 1;
}
if(gPlayerLogged[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("[cmd] [%s] %s", sendername, cmdtext);


------------------------------------------------------------------------------------------------------------------
in OnPlayerCommandText()
new ip[15];
if(ipmatch(result, ip))
{
format(string, sizeof(string), "AdmCmd: %s was banned by ANTICHEAT, reason: Server Advertising.", RemoveUnderScore(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
BanEx(playerid, "Banned By: Autoban Reason: Server Advertising");
return 0;
Next time think Before post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)