SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 01/06/2015, 03:51 PM   #51
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:
Y!M: thegamersa@yahoo.com
GameR16 is offline   Reply With Quote
Old 15/07/2015, 10:55 PM   #52
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 16/07/2015, 09:45 AM   #53
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,961
Reputation: 1549
Default Re: Southclaw's & Pottus's Anti-cheat patches

Check out this and this.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 05/10/2015, 10:37 AM   #54
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 869
Reputation: 296
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 08/10/2015, 12:43 AM   #55
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, 05:28 AM   #56
thaKing
Huge Clucker
 
thaKing's Avatar
 
Join Date: Feb 2014
Location: Mushroom fields
Posts: 298
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, 09:27 PM   #57
T-N-Z
Huge Clucker
 
T-N-Z's Avatar
 
Join Date: May 2007
Posts: 241
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 11:28 PM.
T-N-Z is offline   Reply With Quote
Old 22/11/2015, 12:10 PM   #58
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,961
Reputation: 1549
Default Re: Southclaw's & Pottus's Anti-cheat patches

If the hacker doesn't actually move you could probably use elimination to figure it out. If players fly off then their velocity must go through the server and thus could be picked up by GetPlayerVelocity. You could also limit velocity on OnPlayerUpdate so players never receive velocity updates over a certain value. It sounds like a tough one to detect and I've only seen a couple of videos of it.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 22/11/2015, 12:38 PM   #59
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 869
Reputation: 296
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
Old 22/08/2016, 11:16 PM   #60
Mister0
Huge Clucker
 
Mister0's Avatar
 
Join Date: Aug 2015
Posts: 215
Reputation: 19
Default Re: Southclaw's & Pottus's Anti-cheat patches

What does it do this protection for what is made? Or it was for 0.3x and now is unuselles?
This can be used or is old?
OnAntiCheatLagTroll
Mister0 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] [Anti-Cheat]HP,Money Cheat and Armour Cheat Meow22 Filterscripts 23 03/03/2014 03:38 PM
[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 04:41 AM


All times are GMT. The time now is 06:13 PM.


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