SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 10/06/2018, 07:40 PM   #1
Mutemadiyen
Little Clucker
 
Mutemadiyen's Avatar
 
Join Date: Jun 2018
Posts: 3
Reputation: 0
Lightbulb Is it really impossible? (Anti-AimBot)

Hello,

SA-MP has a common problem, especially with all servers like FreeRoam, DM and CnR. So what's the problem? Aimbot and its varieties. The only cheat that can not be prevented from the UIF server to all other servers. The only solution for now is to do an additional 'Client-side'. This means killing a FreeRoam or CnR server in terms of the player.(Client-side) Do you think Aimbot and its varieties can be prevented? If you have a good idea, please share it here. Let us produce a powerful anti-aimbot using ideas.

Note: We have tested all anti-aimbot shares on this Forum. (Including ProAim in nex-ac.) Do not send a link in vain. None of it works. If you have a good idea, please share it here. Let us produce a powerful anti-aimbot using ideas.

Thank you
Mutemadiyen is offline   Reply With Quote
Old 10/06/2018, 07:51 PM   #2
Ada32
Huge Clucker
 
Ada32's Avatar
 
Join Date: Apr 2013
Posts: 300
Reputation: 62
Default Re: Is it really impossible? (Anti-AimBot)

it is. you can fake data sent to the server so..
Ada32 is offline   Reply With Quote
Old 10/06/2018, 10:05 PM   #3
Sasino97
High-roller
 
Sasino97's Avatar
 
Join Date: Dec 2010
Location: Italia
Posts: 1,393
Reputation: 88
Default Re: Is it really impossible? (Anti-AimBot)

Well, the common approach is to check the direction of the player and test whether the bullet is going in the same direction, but as the user above said, it is possible to fake that data.

The only solution that I can think of would be the SA-MP Team preventing it client-side in the next version of SA-MP.
__________________
Sasino97 is offline   Reply With Quote
Old 10/06/2018, 10:37 PM   #4
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,420
Reputation: 1224
Default Re: Is it really impossible? (Anti-AimBot)

Best you can do is really profiling algorithms. Focus on monitoring a players shot accuracy the higher the accuracy the more likely aimbot is being used.

This was taken from 420DayZ I wrote several years ago and we had really good success at profiling players with it. Although you can't use it to automatically ban players it really gives a lot of insight when a player is suspected of using autoaim.

Code:
#include <YSI\y_hooks>

#define         NUM_SHOT_CHECK          10
#define         EXCESS_AMOUNT           7

forward OnPlayerExcessAccuracy(playerid, total);

static PlayerTargetShots[MAX_PLAYERS];
static PlayerTargetHits[MAX_PLAYERS];
static LastShots[MAX_PLAYERS][NUM_SHOT_CHECK];
static Currshot[MAX_PLAYERS];
static TotalChecks[MAX_PLAYERS];

hook OnGameModeInit()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
        for(new j = 0; j < NUM_SHOT_CHECK; j++) { LastShots[i][j] = -1; }
	}
}

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
	if(!IsPlayerFPImmune(playerid))
	{
		// player was targeted
		if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID)
		{
			// Was a player hit?
			if(hittype == BULLET_HIT_TYPE_PLAYER)
			{
				// No NPCs
				if(!IsPlayerNPC(hitid))
				{
					// Check if player shot is standing still
					new Float:vx, Float:vy, Float:vz;
					GetPlayerVelocity(hitid, vx, vy, vz);
					if(vx != 0.0 || vy != 0.0 || vz != 0.0)
					{
						PlayerTargetShots[playerid]++;
						PlayerTargetHits[playerid]++;
						LastShots[playerid][Currshot[playerid]] = 1;

						new total = CheckLastShots(playerid);

						if(total > 0)
						{
							TotalChecks[playerid]++;
							CallLocalFunction("OnPlayerExcessAccuracy", "ii", playerid, total);
						}

						Currshot[playerid]++;
						if(Currshot[playerid] == NUM_SHOT_CHECK)
						{
							Currshot[playerid] = 0;
							for(new i = 0; i < NUM_SHOT_CHECK; i++) { LastShots[playerid][i] = -1; }
						}
					}
				}
			}
			else
			{
				PlayerTargetShots[playerid]++;
				LastShots[playerid][Currshot[playerid]] = 0;

				new total = CheckLastShots(playerid);

				if(total > 0)
				{
					TotalChecks[playerid]++;
					CallLocalFunction("OnPlayerExcessAccuracy", "ii", playerid, total);
				}
				
				Currshot[playerid]++;
				if(Currshot[playerid] == NUM_SHOT_CHECK)
				{
					Currshot[playerid] = 0;
					for(new i = 0; i < NUM_SHOT_CHECK; i++) { LastShots[playerid][i] = -1; }
				}
			}
		}
	}

	if (funcidx("AntiEA_OnPlayerWeaponShot") != -1)
  	{
    	return CallLocalFunction("AntiEA_OnPlayerWeaponShot", "iiiifff", playerid, weaponid, hittype, hitid, fX, fY, fZ);
  	}
  	return 1;
 }

#if defined _ALS_OnPlayerWeaponShot
	#undef OnPlayerWeaponShot
#else
	#define _ALS_OnPlayerWeaponShot
#endif
#define OnPlayerWeaponShot AntiEA_OnPlayerWeaponShot

forward AntiEA_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);

hook OnPlayerDisconnect(playerid, reason)
{
	PlayerTargetShots[playerid] = 0;
	PlayerTargetHits[playerid] = 0;
	Currshot[playerid] = 0;
	TotalChecks[playerid] = 0;
	for(new i = 0; i < NUM_SHOT_CHECK; i++) { LastShots[playerid][i] = -1; }

	return 1;
}

stock GetPlayerShotStats(playerid, &shots, &hits, &Float:accuracy)
{
	if(IsPlayerConnected(playerid))
	{
		shots = PlayerTargetShots[playerid];
	    hits = PlayerTargetHits[playerid];
	    accuracy = floatdiv(float(PlayerTargetHits[playerid]), float(PlayerTargetShots[playerid]));
		return 1;
	}
	return 0;
}

stock CheckLastShots(playerid)
{
	new count;
	for(new i = 0; i < NUM_SHOT_CHECK; i++)
	{
	    if(LastShots[playerid][i] == -1) return 0;
	    if(LastShots[playerid][i]) count++;
	}

	if(count >= EXCESS_AMOUNT) return count;
	return 0;
}

public OnPlayerExcessAccuracy(playerid, total)
{
	new shots, hits, Float:accuracy;
    GetPlayerShotStats(playerid, shots, hits, accuracy);

	new line[128];
	format(line, sizeof(line), "Aimbot Check: %s(%i) Total Shots: %i Total Hits: %i Accuracy: %.2f (%i/10) Total Checks: %i", ReturnName(playerid), playerid, shots, hits, accuracy, total, TotalChecks[playerid]);

	foreach(new i : Player)
	{
	    if(p_DATA[i][p_Level] > 2) SendClientMessage(i, STEALTH_YELLOW, line);
	}
	return 1;
}
Pottus is offline   Reply With Quote
Old 11/06/2018, 10:29 AM   #5
Mutemadiyen
Little Clucker
 
Mutemadiyen's Avatar
 
Join Date: Jun 2018
Posts: 3
Reputation: 0
Default Re: Is it really impossible? (Anti-AimBot)

Thank you for all the ideas.



Quote:
Originally Posted by Pottus View Post
Best you can do is really profiling algorithms. Focus on monitoring a players shot accuracy the higher the accuracy the more likely aimbot is being used.

This was taken from 420DayZ I wrote several years ago and we had really good success at profiling players with it. Although you can't use it to automatically ban players it really gives a lot of insight when a player is suspected of using autoaim.

Code:
#include <YSI\y_hooks>

#define         NUM_SHOT_CHECK          10
#define         EXCESS_AMOUNT           7

forward OnPlayerExcessAccuracy(playerid, total);

static PlayerTargetShots[MAX_PLAYERS];
static PlayerTargetHits[MAX_PLAYERS];
static LastShots[MAX_PLAYERS][NUM_SHOT_CHECK];
static Currshot[MAX_PLAYERS];
static TotalChecks[MAX_PLAYERS];

hook OnGameModeInit()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
        for(new j = 0; j < NUM_SHOT_CHECK; j++) { LastShots[i][j] = -1; }
	}
}

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
	if(!IsPlayerFPImmune(playerid))
	{
		// player was targeted
		if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID)
		{
			// Was a player hit?
			if(hittype == BULLET_HIT_TYPE_PLAYER)
			{
				// No NPCs
				if(!IsPlayerNPC(hitid))
				{
					// Check if player shot is standing still
					new Float:vx, Float:vy, Float:vz;
					GetPlayerVelocity(hitid, vx, vy, vz);
					if(vx != 0.0 || vy != 0.0 || vz != 0.0)
					{
						PlayerTargetShots[playerid]++;
						PlayerTargetHits[playerid]++;
						LastShots[playerid][Currshot[playerid]] = 1;

						new total = CheckLastShots(playerid);

						if(total > 0)
						{
							TotalChecks[playerid]++;
							CallLocalFunction("OnPlayerExcessAccuracy", "ii", playerid, total);
						}

						Currshot[playerid]++;
						if(Currshot[playerid] == NUM_SHOT_CHECK)
						{
							Currshot[playerid] = 0;
							for(new i = 0; i < NUM_SHOT_CHECK; i++) { LastShots[playerid][i] = -1; }
						}
					}
				}
			}
			else
			{
				PlayerTargetShots[playerid]++;
				LastShots[playerid][Currshot[playerid]] = 0;

				new total = CheckLastShots(playerid);

				if(total > 0)
				{
					TotalChecks[playerid]++;
					CallLocalFunction("OnPlayerExcessAccuracy", "ii", playerid, total);
				}
				
				Currshot[playerid]++;
				if(Currshot[playerid] == NUM_SHOT_CHECK)
				{
					Currshot[playerid] = 0;
					for(new i = 0; i < NUM_SHOT_CHECK; i++) { LastShots[playerid][i] = -1; }
				}
			}
		}
	}

	if (funcidx("AntiEA_OnPlayerWeaponShot") != -1)
  	{
    	return CallLocalFunction("AntiEA_OnPlayerWeaponShot", "iiiifff", playerid, weaponid, hittype, hitid, fX, fY, fZ);
  	}
  	return 1;
 }

#if defined _ALS_OnPlayerWeaponShot
	#undef OnPlayerWeaponShot
#else
	#define _ALS_OnPlayerWeaponShot
#endif
#define OnPlayerWeaponShot AntiEA_OnPlayerWeaponShot

forward AntiEA_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);

hook OnPlayerDisconnect(playerid, reason)
{
	PlayerTargetShots[playerid] = 0;
	PlayerTargetHits[playerid] = 0;
	Currshot[playerid] = 0;
	TotalChecks[playerid] = 0;
	for(new i = 0; i < NUM_SHOT_CHECK; i++) { LastShots[playerid][i] = -1; }

	return 1;
}

stock GetPlayerShotStats(playerid, &shots, &hits, &Float:accuracy)
{
	if(IsPlayerConnected(playerid))
	{
		shots = PlayerTargetShots[playerid];
	    hits = PlayerTargetHits[playerid];
	    accuracy = floatdiv(float(PlayerTargetHits[playerid]), float(PlayerTargetShots[playerid]));
		return 1;
	}
	return 0;
}

stock CheckLastShots(playerid)
{
	new count;
	for(new i = 0; i < NUM_SHOT_CHECK; i++)
	{
	    if(LastShots[playerid][i] == -1) return 0;
	    if(LastShots[playerid][i]) count++;
	}

	if(count >= EXCESS_AMOUNT) return count;
	return 0;
}

public OnPlayerExcessAccuracy(playerid, total)
{
	new shots, hits, Float:accuracy;
    GetPlayerShotStats(playerid, shots, hits, accuracy);

	new line[128];
	format(line, sizeof(line), "Aimbot Check: %s(%i) Total Shots: %i Total Hits: %i Accuracy: %.2f (%i/10) Total Checks: %i", ReturnName(playerid), playerid, shots, hits, accuracy, total, TotalChecks[playerid]);

	foreach(new i : Player)
	{
	    if(p_DATA[i][p_Level] > 2) SendClientMessage(i, STEALTH_YELLOW, line);
	}
	return 1;
}
Thank you, we will try it.



Please continue to share what you have in mind.
Mutemadiyen is offline   Reply With Quote
Old 13/06/2018, 10:23 PM   #6
Chaser98
Big Clucker
 
Join Date: Nov 2010
Posts: 49
Reputation: 21
Default Re: Is it really impossible? (Anti-AimBot)

IMO It would be best to use some sort of machine learning.

Jingles had a good concept here: http://forum.sa-mp.com/showthread.php?t=632394
Chaser98 is offline   Reply With Quote
Old 16/06/2018, 11:05 PM   #7
Mutemadiyen
Little Clucker
 
Mutemadiyen's Avatar
 
Join Date: Jun 2018
Posts: 3
Reputation: 0
Default Re: Is it really impossible? (Anti-AimBot)

Quote:
Originally Posted by Chaser98 View Post
IMO It would be best to use some sort of machine learning.

Jingles had a good concept here: http://forum.sa-mp.com/showthread.php?t=632394
I have seen this before, thank you.


We are open to new ideas.
Mutemadiyen 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 AimBot 1.1 RedMF Lanšamentos/Releases 5 26/08/2016 08:56 PM
[FilterScript] Anti-Aimbot 1.0 RedMF Filterscripts 6 22/08/2016 12:22 PM
[0.3z] Anti Aimbot cmd Skorando Scripting Help 6 01/06/2014 08:18 PM


All times are GMT. The time now is 04:27 AM.


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