SA-MP Forums Archive
Trying to detect aimbot in 0.3z - 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: Trying to detect aimbot in 0.3z (/showthread.php?tid=500013)



Trying to detect aimbot in 0.3z - angelxeneize - 10.03.2014

I'm trying to make a aimbot detector.
this is my current code. The problem of the code is that the position of the camera will never match the positions of the targeted player. Any idea?

Quote:

#define MAX_POS 20
new CheckAim;
new PosActual[MAX_PLAYERS] ;
new Float:xpos[MAX_POS][MAX_PLAYERS],Float:ypos[MAX_POS][MAX_PLAYERS],Float:zpos[MAX_POS][MAX_PLAYERS];

public OnFilterScriptInit() {
CheckAim = SetTimer("ChecarAim",100,1);
return 1;

stock Float:Distance2D(Float:x1, Float:y1, Float:x2, Float:y2, bool:sqrt = true)
{
x1 -= x2;
x1 *= x1;

y1 -= y2;
y1 *= y1;

x1 += y1;

return sqrt ? floatsqroot(x1) : x1;
}
forward ChecarAim();
public ChecarAim()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerInAnyVehicle(i))
{

if(GetPlayerCameraMode(i) == 53)
{
new aimid;
aimid = GetPlayerTargetPlayer(i);
if(aimid != INVALID_PLAYER_ID)
{
new Float:xvec,Float:yvec,Float:zvec;
GetPlayerCameraFrontVector(i,xvec,yvec,zvec);
new Float: fDistance = GetPlayerDistanceFromPoint(aimid, xpos[PosActual[aimid]][aimid], ypos[PosActual[aimid]][aimid], zpos[PosActual[aimid]][aimid]);
PosActual[aimid]++;
if(PosActual[aimid] == MAX_POS)PosActual[aimid] = 0;
if(fDistance > 0.1 )
{
Apuntando[i]++;
if(Apuntando[i] == 20)
{
Apuntando[i] = 0;
new str[120];
for (new b = 0; b < MAX_POS; b++)
{
new Float:distance = Distance2D(xpos[b][aimid], ypos[b][aimid], xvec, yvec);
if(distance <= 1)
{
format(str,sizeof str,"%s sospechado de Aimbot %.2f %.2f %.2f %.2f",PlayerName2(i),xvec,yvec,xpos[b][aimid], ypos[b][aimid]);
for (new y = 0; y < MAX_PLAYERS; y++)
{
if(IsPlayerConnected(y) && IsPlayerAdmin(y))
{
SendClientMessage(y,-1,str);
}
}
}
}
}
}
else
{
Apuntando[i] = 0;
}
GetPlayerPos(aimid,xpos[PosActual[aimid]][aimid], ypos[PosActual[aimid]][aimid], zpos[PosActual[aimid]][aimid]);
}
else
{
Apuntando[i] = 0;
}
}
}
}
return 1;
}




Re: Trying to detect aimbot in 0.3z - Dipto - 11.03.2014

no idea


Re: Trying to detect aimbot in 0.3z - ZeroTheScyther - 11.03.2014

~Delete~


Respuesta: Re: Trying to detect aimbot in 0.3z - angelxeneize - 11.03.2014

Quote:
Originally Posted by ZeroTheScyther
Посмотреть сообщение
~Delete~
If I delete, send many false reports. I need a way to check the center of the skin (OffsetX 0.0 , OffsetY 0.0) when the player shoots or aims.


Re: Trying to detect aimbot in 0.3z - azzerking - 11.03.2014

Do some research and use HitRatio as its one way to detect it, its still very difficult on sa-mp to detect aimbot, as some aimbots are very well programmed. However by using Hit Ratio you will at least detect the majority of aimbotters.


Re: Respuesta: Re: Trying to detect aimbot in 0.3z - ZeroTheScyther - 11.03.2014

Quote:
Originally Posted by angelxeneize
Посмотреть сообщение
If I delete, send many false reports. I need a way to check the center of the skin (OffsetX 0.0 , OffsetY 0.0) when the player shoots or aims.
Sorry, I said ~Delete~ cuz I posted something stupid before and wanted someone to delete my post.


Respuesta: Re: Respuesta: Re: Trying to detect aimbot in 0.3z - angelxeneize - 24.03.2014

Quote:
Originally Posted by ZeroTheScyther
Посмотреть сообщение
Sorry, I said ~Delete~ cuz I posted something stupid before and wanted someone to delete my post.
Oh, im sorry xd


Re: Trying to detect aimbot in 0.3z - Pottus - 25.03.2014

What you are trying to do will not work and can not work, the best you can do is profile accuracy but only when a player is actually targeted.