SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Filterscripts (https://forum.sa-mp.com/forumdisplay.php?f=17)
-   -   [FilterScript] "Silent" Aimbot Detector (FINAL RELEASE) (https://forum.sa-mp.com/showthread.php?t=534341)

Kyance 29/08/2014 12:29 PM

"Silent" Aimbot Detector (FINAL RELEASE)
 
* This is the complete version of my "project" - http://forum.sa-mp.com/showthread.php?t=521690
I've fixed various bugs, and also improved some stuff.
The code will now work as the aimbot works, It will ignore people surfing(since the aimbot then isn't accurate), and people in cars = Less false alerts.
* IMPORTANT: Please load the filterscript as the server starts( Don't use /rcon loadfs .... ), as It might cause lag issues when loaded while server is already up/on!

I've tested this with 7 players, and didn't have any false warnings. I suppose the code could support up to 20 - 50 players.. Should be Okay for A/D and other small servers.
Things we did while testing;
Used weapon switching, C-bugged / Rapid-fired,Slide-bugged,Used "runnies" weapons, to be sure the code won't fail in such ways.

Video(Older version);
[ame]http://www.youtube.com/watch?v=ZPiOC0cJAjc[/ame]

Download link;
http://pastebin.com/t7nBJYqM
https://www.mediafire.com/?jpouzb2apa2jo7c

V Much lighter but untested version, most unneeded stuff removed V
http://pastebin.com/UEXj6Wbp
https://www.mediafire.com/?ua9ba1w4sjn8mig
^ Most (useless) variables are removed here & some debugging stuff ^



DEBUG MODE;
pawn Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(hittype == BULLET_HIT_TYPE_PLAYER && !IsPlayerNPC(hitid))
    {
        if(!IsAFK{ hitid } && !CoolDown{ playerid })
        {
            new surf = GetPlayerSurfingVehicleID(playerid), tsurf = GetPlayerSurfingVehicleID(hitid);
            if(surf == INVALID_VEHICLE_ID && tsurf == INVALID_VEHICLE_ID && !IsPlayerInAnyVehicle(hitid))
            {
                new
                    Float:targetpkl = NetStats_PacketLossPercent(hitid),
                    Float:playerpkl = NetStats_PacketLossPercent(playerid)
                ;
                if(targetpkl < 0.8 && playerpkl < 0.8)
                {
                    new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
                    GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
                    CheckForAimbot(playerid, fHitPosX, fHitPosY, fHitPosZ, hitid);
                }
                else printf("[abd] skipping '%s' and(or) '%s' due to packetloss being above 0.8", GetName(playerid), GetName(hitid));
            }
            else printf("[abd] skipping '%s' and(or) '%s' due to valid surf-vehicle/in-vehicle", GetName(playerid), GetName(hitid));
        }
        else printf("[abd] skipping '%s' and(or) '%s' due to target being afk/player having cooldown", GetName(playerid), GetName(hitid));
    }
    return 1;
}
//------------------------------ STOCKs and TIMERs ----------------------------------
stock CheckForAimbot(playerid, Float:fX, Float:fY, Float:fZ, attacked = INVALID_PLAYER_ID)
{
    if(attacked != INVALID_PLAYER_ID)
    {
        if(!IsPlayerInRangeOfPoint(attacked, 3.0, fX, fY, fZ))
        {
            TimesDetected[playerid]++;
            printf("ABD: %s(IP: %s) has received %d/10 aimbot warnings.", GetName(playerid), PlayerIP(playerid), TimesDetected[playerid]);
            new string[110];
            if(TimesDetected[playerid] >= 3 && TimesDetected[playerid] <= 5)
            {
                format(string, sizeof(string), "WARNING: %s(%d) is POSSIBLY using aimbot (%d warnings)", GetName(playerid), playerid, playerid, playerid, TimesDetected[playerid]);
                SendClientMessageToAll(COLOR_NOTES2, string), string = "\0";
                DetectedForAimbot{ playerid } = true;
            }
            else if(TimesDetected[playerid] >= 10)
            {
                format(string, sizeof(string), "KICK: %s(%d) has been auto-kicked for receiving 10 aimbot warnings.", GetName(playerid), playerid);
                SendClientMessageToAll(COLOR_NOTES2, string), string = "\0", Kick(playerid);
                printf("ABD: %s(IP: %s) has been kicked for receiving 10 aimbot warnings.", GetName(playerid), PlayerIP(playerid));
            }
            string = "\0";
        }
    }
    else printf("[abd] error! 'attacked'(%d) was an invalid id!", attacked);
}


Credits:
Me, Threshold and Pottus for the main script/helping me.
Zeex for zCMD
****** for foreach and sscanf
Emmet_ for his 'new SA-MP callbacks'
iDrv, "fisy", Andan, Ziewuza, YouSri, Mico, Kewizzle and Jaakkima - For testing, helping me discover and fix bugs.

Rudy_ 29/08/2014 12:44 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
wow :O Awsome

This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds.

Sledgehammer 29/08/2014 02:25 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
Good job!

DovFlaminggo 29/08/2014 02:28 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
Good Work !

Kyance 29/08/2014 04:17 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
Quote:

Originally Posted by Rudy_ (Post 3178899)
wow :O Awsome
This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds.

Why do I have a feeling that you just posted that to get more Post Counts or w.e :l
But thanks though.

Quote:

Originally Posted by Ralfie (Post 3179046)
Interesting!

Quote:

Originally Posted by Death1300 (Post 3179050)
Good job!

Quote:

Originally Posted by DovFlaminggo (Post 3179053)
Good Work !

Thank you.

Pottus 29/08/2014 04:21 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
You should include output for packetloss it can actually cause this detection to go off.

Kyance 29/08/2014 06:05 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
Quote:

Originally Posted by Pottus (Post 3179189)
You should include output for packetloss it can actually cause this detection to go off.

Thanks for the help Pottus, added your tips :)

Abagail 29/08/2014 06:11 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
Why did you remove the pastebin link?

Rudy_ 29/08/2014 06:20 PM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
Quote:

Originally Posted by Kyance (Post 3179182)
Why do I have a feeling that you just posted that to get more Post Counts or w.e :l
But thanks though.


Thank you.

Haha not for postcount, I play on a server Where everywhere is Aimbotters, I just posted this topic there. So i was Happy :D

'This forum requires that you wait 120 seconds between posts. Please try again in 44 seconds.'
Now i feel like spammer. :o

Kyance 30/08/2014 05:10 AM

Re: "Silent" Aimbot Detector (FINAL RELEASE)
 
Quote:

Originally Posted by Abagail (Post 3179324)
Why did you remove the pastebin link?

It had the older version.. The one which didn't have that packetloss checker :p
Re-added though. http://pastebin.com/n00ig7SF

Quote:

Originally Posted by Rudy_ (Post 3179331)
Haha not for postcount, I play on a server Where everywhere is Aimbotters, I just posted this topic there. So i was Happy :D

'This forum requires that you wait 120 seconds between posts. Please try again in 44 seconds.'
Now i feel like spammer. :o

Keep in mind, that I don't know how much players this code can support, but since I've 'adjusted' it to work like the aimbot, It could be some-what more stable. :p


All times are GMT. The time now is 02:54 PM.

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