Jump to content

Recommended Posts

Posted

Salut, am vazut ca multi se confrunta cu un fenomen numit Reclama, asa ca m-am gandit sa fac un tutorial pentru cei care nu stiu sa instaleze un sistem anti-reclama.

_____________________________________________________________________________________________________

Cauta:

public OnPlayerText

1. Aici adaugi asta:

//////////////////

//  * Anti *  //

// * Reclama * //

/////////////////

    if(GoIP(text))

    {

    new reclama[MAX_PLAYER_NAME];

GetPlayerName(playerid, reclama, sizeof(reclama));

format(string, sizeof(string), "[server]: %s was banned, reason: Reclama",reclama);

SendClientMessageToAll(0xFF6347AA,string);

        SendClientMessage(playerid, 0xFF0000FF, "[ENG]:You have banned , because you write an IP Adrees.");

        SendClientMessage(playerid, 0xFF0000FF, "[RO]:Tu ai fost bannad pentru ca ai scris o adresa IP.");

PlayerInfo[giveplayerid][pLevel] = -999;

Ban(giveplayerid);

BanLog(string);

        return 1;

    }

2. La sfarsitul GM-ului adaugati:

GoIP(StrToChk[])

{

new IpLevel = 0;

for(new a = 0; a < strlen(StrToChk); a++)

{

switch(IpLevel)

{

case 0:

{

    if(IsNum(StrToChk[a])) IpLevel++;

}

case 1, 2:

{

                if(IsNum(StrToChk[a])) IpLevel++;

                else if(StrToChk[a] == '.') IpLevel = 4;

                else IpLevel = 0;

}

case 3:

{

    if(StrToChk[a] == '.') IpLevel++;

    else IpLevel = 0;

}

case 4:

{

    if(IsNum(StrToChk[a])) IpLevel++;

    else IpLevel = 0;

}

case 5, 6:

{

                if(IsNum(StrToChk[a])) IpLevel++;

                else if(StrToChk[a] == '.') IpLevel = 8;

                else IpLevel = 0;

}

case 7:

{

    if(StrToChk[a] == '.') IpLevel++;

    else IpLevel = 0;

}

case 8:

{

    if(IsNum(StrToChk[a])) IpLevel++;

    else IpLevel = 0;

}

case 9, 10:{

                if(IsNum(StrToChk[a])) IpLevel++;

                else if(StrToChk[a] == '.') IpLevel = 12;

                else IpLevel = 0;

}

case 11:

{

    if(StrToChk[a] == '.') IpLevel++;

    else IpLevel = 0;

}

case 12:

{

    if(IsNum(StrToChk[a])) return 1;

                else IpLevel = 0;

  }

  }

}

return 0;

}

IsNum(textchar)

{

if(textchar == '0') return 1;

if(textchar == '1') return 1;

if(textchar == '2') return 1;

if(textchar == '3') return 1;

if(textchar == '4') return 1;

if(textchar == '5') return 1;

if(textchar == '6') return 1;

if(textchar == '7') return 1;

if(textchar == '8') return 1;

if(textchar == '9') return 1;

return 0;

}

3. Iar acum pentru ca anti-reclama sa mearga si la celelalte chaturi [ /o /a /n /f /news ...etc]

    Adaugati la fiecare chat asta:

 

  if(GoIP(result))

    {

    new reclama[MAX_PLAYER_NAME];

GetPlayerName(playerid, reclama, sizeof(reclama));

format(string, sizeof(string), "[server]: %s was banned, reason: Reclama",reclama);

SendClientMessageToAll(0xFF6347AA,string);

        SendClientMessage(playerid, 0xFF0000FF, "[ENG]:You have banned , because you write an IP Adrees.");

        SendClientMessage(playerid, 0xFF0000FF, "[RO]:Tu ai fost bannad pentru ca ai scris o adresa IP.");

PlayerInfo[giveplayerid][pLevel] = -999;

Ban(giveplayerid);

BanLog(string);

        return 1;

    }

Asta a fost tot, sper sa reusiti.  :azn:

PS: Sistemul nu este facut de mine, nu stiu cine l-a facut.

stats.php?page=2&ip=samp.zonek.ro&port=7777
Posted

Da e bun pentru incepatori, dar am facut tutorialul pentru ca am vazut multe servere fara astfel de sistem si se facea reclama la greu..

stats.php?page=2&ip=samp.zonek.ro&port=7777
  • 2 weeks later...
Posted

Exista o problema.Daca scri 1.000.000.000 iei ban.Orice numar scri cu 3 puncte intre numere iei ban

Daca ti-am fost de ajutor +1 Respect!Multumesc

  • 2 weeks later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.