[FilterScript] "Silent" Aimbot Detector (FINAL RELEASE)
#1

* This is the complete version of my "project" - https://sampforum.blast.hk/showthread.php?tid=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.
Reply
#2

wow :O Awsome

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

Good job!
Reply
#4

Good Work !
Reply
#5

Quote:
Originally Posted by Rudy_
View Post
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
View Post
Interesting!
Quote:
Originally Posted by Death1300
View Post
Good job!
Quote:
Originally Posted by DovFlaminggo
View Post
Good Work !
Thank you.
Reply
#6

You should include output for packetloss it can actually cause this detection to go off.
Reply
#7

Quote:
Originally Posted by Pottus
View Post
You should include output for packetloss it can actually cause this detection to go off.
Thanks for the help Pottus, added your tips
Reply
#8

Why did you remove the pastebin link?
Reply
#9

Quote:
Originally Posted by Kyance
View Post
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

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

Quote:
Originally Posted by Abagail
View Post
Why did you remove the pastebin link?
It had the older version.. The one which didn't have that packetloss checker
Re-added though. http://pastebin.com/n00ig7SF

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

'This forum requires that you wait 120 seconds between posts. Please try again in 44 seconds.'
Now i feel like spammer.
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.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)