SA-MP Forums Archive
Simple Anti hack system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Simple Anti hack system (/showthread.php?tid=332979)



Simple Anti hack system - HazardGaming - 09.04.2012

Hello,,

I know there was one about this earlier
But they don't work..

I want know if anyone just has the normal Anticheat System:
- Weapon Hack
- Money Hack
- Health Hack.
I don't want ones where you have to config the gun's, because they can't be used by admins..
Anyone? Thanks.


Re: Simple Anti hack system - ColdRain - 09.04.2012

Weapon Anti

pawn Код:
// put this in top of script
forward weaponanti();


// use this under OnGameModeInit
SetTimer("weaponanti",1500,1);


// put this anywhere :D
public weaponanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && IsSpawned[i] == 1 && GetPlayerState(i) == PLAYER_STATE_ONFOOT)
       {
       if (GetPlayerWeapon(i) == 38 || GetPlayerWeapon(i) == 17 || GetPlayerWeapon(i) == 18 || GetPlayerWeapon(i) == 19 || GetPlayerWeapon(i) == 35 || GetPlayerWeapon(i) == 36 || GetPlayerWeapon(i) == 37 || GetPlayerWeapon(i) == 39)
       {
       if(PlayerAdminLevel[i] < 1) {
          new pname[30];
          new string[256];
          new inter;
          inter = GetPlayerInterior(i);
          new wep = GetPlayerWeapon(i);
          GetPlayerName(i, pname, 30);
          format(string, sizeof(string), "**(AUTO BAN)** {3399FF}%s(%d) {FFFFCC} Our Anti-Cheat has detected a hax0r",pname,i);
          SendClientMessageToAll(COLOR_RED, string);
          format(string, sizeof(string), "{3399FF}%s(%d) {FFFFCC} Has Been Auto Banned Our Anti-Cheat has detected a Weapon hax0r Wep:[%d]",pname,i,wep);
          SendAdminMessage(0xFF7F50AA, string);
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
          SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit [url][/url] to appeal this ban");
          format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r Wep:[%d] Int:[%d]",pname,i,wep,inter);
          printf("%s", string);
          if(udb_Exists(PlayerName(i)) && PLAYERLIST_authed[i]) {
          dUserSetINT(PlayerName(i)).("nameban",1);
          }
          SetCameraBehindPlayer(i);
          Ban(i);

       }
    }
  }
}
}



Health Anti
pawn Код:
// put thsi top of script
forward healthanti();


// use this under OnGameModeInit
SetTimer("healthanti",1500,1);

// put this anywhere
public healthanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && IsSpawned[i] == 1)
       {
               
       if(PlayerAdminLevel[i] < 1) {
          new pname[30];
          new string[256];
          new inter;
          inter = GetPlayerInterior(i);
       
          new Float:ph;
GetPlayerHealth(i,ph);
         if(ph >= 101){
          GetPlayerName(i, pname, 30);
          format(string, sizeof(string), "**(AUTO BAN)** {3399FF}%s(%d) {FFFFCC} Our Anti-Cheat has detected a hax0r",pname,i);
          SendClientMessageToAll(COLOR_RED, string);
          format(string, sizeof(string), "{3399FF}%s(%d) {FFFFCC} Has Been Auto Banned Our Anti-Cheat has detected a Weapon hax0r Health",pname,i,wep);
          SendAdminMessage(0xFF7F50AA, string);
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
          SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit [url][/url] to appeal this ban");
          format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r Health",pname,i);
          printf("%s", string);
          if(udb_Exists(PlayerName(i)) && PLAYERLIST_authed[i]) {
          dUserSetINT(PlayerName(i)).("nameban",1);
          }
          SetCameraBehindPlayer(i);
          Ban(i);

       }
    }
  }
}
}
}

Money Anti

pawn Код:
// put this top of script
forward cashanti();

// use this under OnGameModeInit
SetTimer("cashanti",1500,1);

// put this anymore
public cashanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && IsSpawned[i] == 1)
       {
       if (GetPlayerMoney(i) > 8001000)
       {
       if(PlayerAdminLevel[i] < 1) {
          new pname[30];
          new string[256];
          new inter;
          inter = GetPlayerInterior(i);
          new pcash = GetPlayerMoney(i);
          GetPlayerName(i, pname, 24);
          format(string, sizeof(string), "**(AUTO BAN)** {3399FF}%s(%d) {FFFFCC} Our Anti-Cheat has detected a hax0r",pname,i,pcash);
          SendClientMessageToAll(COLOR_RED, string);
          format(string, sizeof(string), "{3399FF}%s(%d) {FFFFCC} Has Been Auto Banned Our Anti-Cheat has detected a Cash hax0r Cash:[%d]",pname,i,pcash);
          SendAdminMessage(0xFF7F50AA, string);
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
          SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit  to appeal this ban");
          format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r Cash:[$%d] Int:[%d]",pname,i,pcash,inter);
          printf("%s", string);
          SetCameraBehindPlayer(i);
          ResetPlayerMoney(i);
          Ban(i)

       }
    }
  }
}
}



Re: Simple Anti hack system - Toreno - 09.04.2012

I don't know if they are still working, the way they should, but give a try;
https://sampforum.blast.hk/showthread.php?tid=203513
https://sampforum.blast.hk/showthread.php?tid=189607


Re: Simple Anti hack system - HazardGaming - 09.04.2012

Quote:
Originally Posted by ColdRain
Посмотреть сообщение
Weapon Anti

pawn Код:
// put this in top of script
forward weaponanti();


// use this under OnGameModeInit
SetTimer("weaponanti",1500,1);


// put this anywhere :D
public weaponanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && IsSpawned[i] == 1 && GetPlayerState(i) == PLAYER_STATE_ONFOOT)
       {
       if (GetPlayerWeapon(i) == 38 || GetPlayerWeapon(i) == 17 || GetPlayerWeapon(i) == 18 || GetPlayerWeapon(i) == 19 || GetPlayerWeapon(i) == 35 || GetPlayerWeapon(i) == 36 || GetPlayerWeapon(i) == 37 || GetPlayerWeapon(i) == 39)
       {
       if(PlayerAdminLevel[i] < 1) {
          new pname[30];
          new string[256];
          new inter;
          inter = GetPlayerInterior(i);
          new wep = GetPlayerWeapon(i);
          GetPlayerName(i, pname, 30);
          format(string, sizeof(string), "**(AUTO BAN)** {3399FF}%s(%d) {FFFFCC} Our Anti-Cheat has detected a hax0r",pname,i);
          SendClientMessageToAll(COLOR_RED, string);
          format(string, sizeof(string), "{3399FF}%s(%d) {FFFFCC} Has Been Auto Banned Our Anti-Cheat has detected a Weapon hax0r Wep:[%d]",pname,i,wep);
          SendAdminMessage(0xFF7F50AA, string);
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
          SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit [url][/url] to appeal this ban");
          format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r Wep:[%d] Int:[%d]",pname,i,wep,inter);
          printf("%s", string);
          if(udb_Exists(PlayerName(i)) && PLAYERLIST_authed[i]) {
          dUserSetINT(PlayerName(i)).("nameban",1);
          }
          SetCameraBehindPlayer(i);
          Ban(i);

       }
    }
  }
}
}



Health Anti
pawn Код:
// put thsi top of script
forward healthanti();


// use this under OnGameModeInit
SetTimer("healthanti",1500,1);

// put this anywhere
public healthanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && IsSpawned[i] == 1)
       {
               
       if(PlayerAdminLevel[i] < 1) {
          new pname[30];
          new string[256];
          new inter;
          inter = GetPlayerInterior(i);
       
          new Float:ph;
GetPlayerHealth(i,ph);
         if(ph >= 101){
          GetPlayerName(i, pname, 30);
          format(string, sizeof(string), "**(AUTO BAN)** {3399FF}%s(%d) {FFFFCC} Our Anti-Cheat has detected a hax0r",pname,i);
          SendClientMessageToAll(COLOR_RED, string);
          format(string, sizeof(string), "{3399FF}%s(%d) {FFFFCC} Has Been Auto Banned Our Anti-Cheat has detected a Weapon hax0r Health",pname,i,wep);
          SendAdminMessage(0xFF7F50AA, string);
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
          SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit [url][/url] to appeal this ban");
          format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r Health",pname,i);
          printf("%s", string);
          if(udb_Exists(PlayerName(i)) && PLAYERLIST_authed[i]) {
          dUserSetINT(PlayerName(i)).("nameban",1);
          }
          SetCameraBehindPlayer(i);
          Ban(i);

       }
    }
  }
}
}
}

Money Anti

pawn Код:
// put this top of script
forward cashanti();

// use this under OnGameModeInit
SetTimer("cashanti",1500,1);

// put this anymore
public cashanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && IsSpawned[i] == 1) // THIS RIGHT HERE IS 668 ;)
       {
       if (GetPlayerMoney(i) > 8001000)
       {
       if(PlayerAdminLevel[i] < 1) {
          new pname[30];
          new string[256];
          new inter;
          inter = GetPlayerInterior(i);
          new pcash = GetPlayerMoney(i);
          GetPlayerName(i, pname, 24);
          format(string, sizeof(string), "**(AUTO BAN)** {3399FF}%s(%d) {FFFFCC} Our Anti-Cheat has detected a hax0r",pname,i,pcash);
          SendClientMessageToAll(COLOR_RED, string);
          format(string, sizeof(string), "{3399FF}%s(%d) {FFFFCC} Has Been Auto Banned Our Anti-Cheat has detected a Cash hax0r Cash:[%d]",pname,i,pcash);
          SendAdminMessage(0xFF7F50AA, string);
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
          SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit  to appeal this ban");
          format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r Cash:[$%d] Int:[%d]",pname,i,pcash,inter);
          printf("%s", string);
          SetCameraBehindPlayer(i);
          ResetPlayerMoney(i);
          Ban(i)

       }
    }
  }
}
}
Thanks dude, But I get an error on line 668
Код:
public healthanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i) && IsSpawned[i] == 1) // THIS HERE IS 668 ;)
       {

       if(PlayerAdminLevel[i] < 1) {
          new pname[30];
          new string[256];
          new inter;
          inter = GetPlayerInterior(i);

          new Float:ph;
GetPlayerHealth(i,ph);
         if(ph >= 101){
          GetPlayerName(i, pname, 30);
          format(string, sizeof(string), "**(AUTO BAN)** {3399FF}%s(%d) {FFFFCC} Our Anti-Cheat has detected a hax0r",pname,i);
          SendClientMessageToAll(COLOR_RED, string);
          format(string, sizeof(string), "{3399FF}%s(%d) {FFFFCC} Has Been Auto Banned Our Anti-Cheat has detected a Weapon hax0r Health",pname,i,wep);
          SendAdminMessage(0xFF7F50AA, string);
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
          SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
          SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit  to appeal this ban");
          format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r Health",pname,i);
          printf("%s", string);
          if(udb_Exists(PlayerName(i)) && PLAYERLIST_authed[i]) {
          dUserSetINT(PlayerName(i)).("nameban",1);
          }
          SetCameraBehindPlayer(i);
          Ban(i);

       }
    }
  }
}
}
}
Код:
C:\Users\Jordan\Desktop\0.3e Server\gamemodes\Freeroam.pwn(668) : error 017: undefined symbol "IsSpawned"
C:\Users\Jordan\Desktop\0.3e Server\gamemodes\Freeroam.pwn(668) : warning 215: expression has no effect
C:\Users\Jordan\Desktop\0.3e Server\gamemodes\Freeroam.pwn(668) : error 001: expected token: ";", but found "]"
C:\Users\Jordan\Desktop\0.3e Server\gamemodes\Freeroam.pwn(668) : error 029: invalid expression, assumed zero
C:\Users\Jordan\Desktop\0.3e Server\gamemodes\Freeroam.pwn(668) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Simple Anti hack system - WarriorEd22 - 09.04.2012

Can you show us the error?


Re: Simple Anti hack system - HazardGaming - 09.04.2012

edited above.


Re: Simple Anti hack system - WarriorEd22 - 10.04.2012

Okay well are the undefined symbols defined at the top of the script where all the other defines are?


Re: Simple Anti hack system - HazardGaming - 10.04.2012

Its where he said to put them.


Re: Simple Anti hack system - SuperViper - 10.04.2012

Variables can be named anything you want them to be. Each script has different variable names. You need to adjust code to fit your variables. You can't just copy and paste everything.