SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 01/03/2015, 03:53 AM   #41
HydraHumza
Gangsta
 
HydraHumza's Avatar
 
Join Date: Oct 2014
Posts: 627
Reputation: 130
Default Re: Southclaw's & Pottus's Anti-cheat patches

Really Appreciate
+REP for this patching and helping us to save our server from cheaters
HydraHumza is offline   Reply With Quote
Old 02/05/2015, 03:02 PM   #42
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 882
Reputation: 317
Default Re: Southclaw's & Pottus's Anti-cheat patches

Code:
public HealthCheck ()
{
    new Float:fhealth,health,ac_health;
    for(new i = 0;i < maxplayers;i++)
	{
	    if(PlayerAC[i][Alive]) //Will not be set for NPCs to skip AC Checks
	    {
	       	if(PlayerData[i][Disconnecting]) continue;
		    GetPlayerHealth(i,fhealth);
		    health = floatround(fhealth);
		    ac_health = floatround(PlayerAC[i][ACHealth]);
		   	if(PlayerAC[i][ACHealthSync])
		    {
		        //SYNC
		        if(health > 100)
		        {
		            if(!PlayerAC[i][GodMode])
		            {
                  		XA_Ban(i,"Health Hacks","Banned for using Health Hacks/Cheats",SERVER);
		            }
		        }
		        else if(health != ac_health)
			 	{
		      		if(!PlayerAC[i][HHNoticeGiven])
		         	{
		          		PlayerAC[i][HHNoticeGiven] = true;
	              		SendAdminNoticeMessage("%s(%d) is suspected to be using health hacks.",PlayerData[i][Name],i);
					}
		            SetPlayerHealth(i,ac_health);
		            PlayerAC[i][ACHealthSync] = false;
					if(++PlayerAC[i][HealthHackCount] > MAX_HEALTH_HACK_COUNT)
					{
         				XA_Ban(i,"Health Hacks","Banned for using Health Hacks/Cheats",SERVER);
					}
		        }
	    	}
		    else
		    {
		        //CHECK DESYNC
		        if(health!=ac_health)
				{
				   	//DESYNCED
				    new sec  = (++PlayerAC[i][ACHealthDesyncTime] / (1000/AC_HEALTH_CHECK_TIME));
				    if(sec > TIME_FOR_DESYNC_KICK)
					{
					   TimePlayer(i);
					   continue;
					}
					if(sec == (TIME_FOR_DESYNC_KICK>>2))
					{
					    SetPlayerHealth(i,ac_health);
					    PlayerAC[i][ACHealthSync] = false;
					    SendAdminNoticeMessage("PlayerDesync:%s(%d) - Health is desynced - %d seconds since desync",PlayerData[i][Name],i,(TIME_FOR_DESYNC_KICK/4));
						continue;
					}
					if(sec == (TIME_FOR_DESYNC_KICK>>1))
					{
	    				SetPlayerHealth(i,ac_health);
	    				PlayerAC[i][ACHealthSync] = false;
					    SendAdminNoticeMessage("PlayerDesync:%s(%d) - Health is desynced - %d seconds since desync",PlayerData[i][Name],i,(TIME_FOR_DESYNC_KICK/2));
						continue;
					}
				}
				else
				{
				    PlayerAC[i][ACHealthDesyncTime]  = PlayerAC[i][HealthHackCount] = 0;
				    PlayerAC[i][ACHealthSync] = true;
				}
	   		}
		}
	}
}
Concept/Idea for getting players in sync before banning them

All the health changes are server sided.

This code is from my server from 2013 so it may be outdated.
Yashas is offline   Reply With Quote
Old 02/05/2015, 03:05 PM   #43
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,851
Reputation: 1292
Default Re: Southclaw's & Pottus's Anti-cheat patches

Health cheating is completely obsolete dude!
http://forum.sa-mp.com/showthread.php?t=563387

Lagcomp is annoyingly inaccurate (some shots don't do damage) any server using Lagcomp should use the weapon include or have a skinhit system with server sided health.

Pottus is offline   Reply With Quote
Old 01/06/2015, 02:51 PM   #44
GameR16
Little Clucker
 
GameR16's Avatar
 
Join Date: Dec 2013
Location: Rosiori de Vede
Posts: 8
Reputation: 0
Default Re: Southclaw's & Pottus's Anti-cheat patches

Good job! Thanks!
__________________
Y!M
Code:
Skype: mariandavid10
GameR16 is offline   Reply With Quote
Old 15/07/2015, 09:55 PM   #45
anime107
Little Clucker
 
anime107's Avatar
 
Join Date: Jul 2013
Posts: 18
Reputation: 0
Default Re: Southclaw's & Pottus's Anti-cheat patches

Boa noite
Procuro um sistema de anti-Ips do tipo:

Quando o player entra no servidor, grava o nick e o ip dele
Quando o mesmo sai e entra com um novo nick, grava o ip dele e manda uma mensagem falando de possivel ban evade.

Alguem poderia me ajuda?

Code:
english
I am looking for a good night of anti-Ips type system: When the player enters the server saves the nick and his ip When it leaves and enters with a new nickname, records the ip of it and sends a message talking about possible ban evade . Could someone help me?
anime107 is offline   Reply With Quote
Old 05/10/2015, 09:37 AM   #46
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 882
Reputation: 317
Default Re: Southclaw's & Pottus's Anti-cheat patches

Efficient Simple Timer based Anti Weapon & Anti Ammo Hack
There are chances that the cheat may not be detected immediately since the code given below uses 1s timer. However, the player will eventually be identified if he is using a weapon or ammo cheat(This should happen within a few seconds). The smaller the interval, the higher is chance that every player using a weapon/ammo cheat is detected.

This code doesn't detect players who illegally get weapons unless they switch to it. In this way , this include is more efficient than the traditional weapon check methods where every slot is checked every time.

//The code can be optimized further to use char arrays
//Anti Ammo Hack works with high-fire-rate weapons

Last Updated:2013

Code:
#include <a_samp>
#include <izcmd>

#define INVALID_WEAPON 0
#define MAX_WEAPON_SLOTS 13
#define MAX_WEAPONS 47
/////////////////////////////////////////////////////////////////////////////////
static pWeaponData[MAX_PLAYERS][MAX_WEAPON_SLOTS];
static pAmmoData[MAX_PLAYERS][MAX_WEAPON_SLOTS];
static pAmmoWarns[MAX_PLAYERS];

static const WeaponSlot[MAX_WEAPONS] =
{
	0,0,1,1,1,1,1,1,1,1,10,10,10,10,10,10,8,8,8,-1,-1,-1,2,2,2,3,3,3,4,4,5,5,4,6,6,7,7,7,7,8,12,9,9,9,11,11,11
};
/////////////////////////////////////////////////////////////////////////////////
stock ac_SetPlayerAmmo(playerid,weaponslot,ammo)
{
	pAmmoData[playerid][weaponslot] = ammo;
	return SetPlayerAmmo(playerid,weaponslot,ammo);
}

#if defined _ALS_SetPlayerAmmo
    #undef SetPlayerAmmo
#else
    #define _ALS_SetPlayerAmmo
#endif
#define SetPlayerAmmo ac_SetPlayerAmmo

stock ac_GivePlayerWeapon(playerid,weaponid,ammo)
{
	pWeaponData[playerid][WeaponSlot[weaponid]] = weaponid;
	pAmmoData[playerid][WeaponSlot[weaponid]] = GetPlayerAmmo(playerid) + ammo;
	return GivePlayerWeapon(playerid,weaponid,ammo);
}

#if defined _ALS_GivePlayerWeapon
    #undef GivePlayerWeapon
#else
    #define _ALS_GivePlayerWeapon
#endif

#define GivePlayerWeapon ac_GivePlayerWeapon

stock ac_ResetPlayerWeapons(playerid)
{
	for(new i = 0; i < MAX_WEAPON_SLOTS;i++)
	{
		pWeaponData[playerid][i] = INVALID_WEAPON;
        pAmmoData[playerid][i] = 0;
	}
	return ResetPlayerWeapons(playerid);
}

#if defined _ALS_ResetPlayerWeapons
    #undef ResetPlayerWeapons
#else
    #define _ALS_ResetPlayerWeapons
#endif

#define ResetPlayerWeapons ac_ResetPlayerWeapons
/////////////////////////////////////////////////////////////////////////////////
forward WeaponCheck();
public WeaponCheck()
{
    static wid;
	for(new playerid = 0; playerid <= GetMaxPlayers(); playerid++)
	{
	    wid = GetPlayerWeapon(playerid);
	    if(wid == -1) continue; //INVALID WEAPON

		switch(GetPlayerState(playerid))
		{
		    case PLAYER_STATE_NONE,PLAYER_STATE_WASTED,PLAYER_STATE_SPAWNED: continue;
		}

     	if(pWeaponData[playerid][WeaponSlot[wid]] != wid)
		{
			new str[144],name[24],wname[24];
			GetPlayerName(playerid,name,sizeof(name));
		    GetWeaponName(wid,wname,sizeof(wname));
  			format(str,256,"%s(%d) suspected to be using Weapon Hacks (Weapon Name:%s)",name,playerid,wname);
		    SendClientMessageToAll(-1,str);
		}
		if(pAmmoData[playerid][WeaponSlot[wid]] < GetPlayerAmmo(playerid))
		{
		    if(++pAmmoWarns[playerid] == 3)
		    {
                pAmmoWarns[playerid] = 0;
			    new str[144],name[24],wname[24];
				GetPlayerName(playerid,name,sizeof(name));
			    GetWeaponName(wid,wname,sizeof(wname));
	  			format(str,256,"%s(%d) suspected to be using Ammo Hacks (Weapon Name:%s)",name,playerid,wname);
			    SendClientMessageToAll(-1,str);
			}
		}
		else pAmmoWarns[playerid] = 0;
		pAmmoData[playerid][WeaponSlot[wid]] = GetPlayerAmmo(playerid);
		continue;
	}
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    pAmmoData[playerid][WeaponSlot[weaponid]]--;
    return 1;
}
/////////////////////////////////////////////////////////////////////////////////
main()
{

}
public OnGameModeInit()
{
	SetGameModeText("asdasdasd");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	SetTimer("WeaponCheck",1000,true);
	return 1;
}
public OnPlayerConnect(playerid)
{
    pAmmoWarns[playerid] = 0;
	ResetPlayerWeapons(playerid);
	return 1;
}
Yashas is offline   Reply With Quote
Old 07/10/2015, 11:43 PM   #47
qilia
Little Clucker
 
Join Date: Sep 2015
Posts: 4
Reputation: 0
Default Re: Southclaw's & Pottus's Anti-cheat patches

frien i want this code - just idk where paste this code -
qilia is offline   Reply With Quote
Old 08/10/2015, 04:28 AM   #48
thaKing
Huge Clucker
 
thaKing's Avatar
 
Join Date: Feb 2014
Location: Mushroom fields
Posts: 294
Reputation: 37
Default Re: Southclaw's & Pottus's Anti-cheat patches

Love this. Thanks guys, hope you will keep updating.
thaKing is offline   Reply With Quote
Old 21/11/2015, 08:27 PM   #49
T-N-Z
Huge Clucker
 
T-N-Z's Avatar
 
Join Date: May 2007
Posts: 213
Reputation: 23
Default Re: Southclaw's & Pottus's Anti-cheat patches

Hi there, is anyone aware of new troll hack, which can throw players around?
Today I have enountered a cheater who used these hacks. We were having an event, when all of sudden all vehicles with players inside them started getting throwed around in insane speeds. There was a new version released which can also throw players without a vehicle.
OnPlayerStateChange dosen't detect anything, Speed Detection also comes up with nothing. It's like that hacker somehow changes velocity of other players in certain radius.
Any solution to prevent this would be helpful, because I have no idea.

Last edited by T-N-Z; 21/11/2015 at 10:28 PM.
T-N-Z is offline   Reply With Quote
Old 22/11/2015, 11:38 AM   #50
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 882
Reputation: 317
Default Re: Southclaw's & Pottus's Anti-cheat patches

You can try finding out how fast the player is able to switch between enter/exit at OnPlayerUpdate.

I have a working algorithm which detects the troll which need the player to be in the vehicle. But with few modifications you can make it detect if a player enter/exits very fast.

The code is in C++.

Code:
if (PlayerList[playerid]->IsAntiCheatEnabled(CheatType::VEHICLE_TROLL_CHEAT))
	{
		switch (PlayerList[playerid]->AntiCheatStatus[CheatType::VEHICLE_TROLL_CHEAT])
		{
			case AntiCheatCommands::CHECK:
			{
				int vehicleid = GetPlayerVehicleID(playerid);
				if (vehicleid != 0)
				{
					if (PlayerList[playerid]->vehicleid != vehicleid)
					{
						int tick = GetTickCount();
						if (tick - PlayerList[playerid]->LastVehicleChangeTick < MIN_VEHICLE_SWITCH_TIME)
						{
							if (++(PlayerList[playerid]->WarningCount[CheatType::VEHICLE_TROLL_CHEAT]) >= MaxDetectionProbes[CheatType::VEHICLE_TROLL_CHEAT])
							{
								for (list <Interface *>::iterator p = InterfaceList.begin(); p != InterfaceList.end(); p++)
									(*p)->CheatCallback(playerid, CheatType::VEHICLE_TROLL_CHEAT, 0, 0, 0, 0.0);

								PlayerList[playerid]->WarningCount[CheatType::VEHICLE_TROLL_CHEAT] = 0;
							}
						}
						PlayerList[playerid]->LastVehicleChangeTick = tick;
						PlayerList[playerid]->vehicleid = vehicleid;
					}
				}
				break;
			}
			case AntiCheatCommands::SKIP:	break;
			default: PlayerList[playerid]->AntiCheatStatus[CheatType::VEHICLE_TROLL_CHEAT]--;
		}
	}
I have that in OnPlayerUpdate. The code looks huge of course but you can cut it by half (my code has alot of unnecessary stuff).

You will have to now do the tick difference checks when the vehicleid changes. My code give above does the tick difference calculations if and only if the player is in a vehicle.
Yashas is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [K.A.S] Knight's Anti Cheat (Anti: Armas, Spam, DB, MaxPing, Palavrões, Money Hack) The Knight Lançamentos/Releases 5 05/05/2011 03:41 AM


All times are GMT. The time now is 07:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.