SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 29/08/2014, 12:29 PM   #1
Kyance
Gangsta
 
Kyance's Avatar
 
Join Date: Mar 2013
Posts: 817
Reputation: 92
Default "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.
__________________
I'm amazed how you people are still wasting your time on a decade old game.

Last edited by Kyance; 21/12/2014 at 07:46 AM. Reason: Updated links and credits.
Kyance is offline   Reply With Quote
Old 29/08/2014, 12:44 PM   #2
Rudy_
High-roller
 
Rudy_'s Avatar
 
Join Date: Nov 2011
Location: Pakistan
Posts: 1,355
Reputation: 230
Default 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.
__________________
And now my Watch has Ended.


[Tutorial]
[TuT]How to create a car shooting Neon

[Filterscript]
Neon Vehicle Laser


__________________________________________________
Rudy_ is offline   Reply With Quote
Old 29/08/2014, 04:17 PM   #3
Kyance
Gangsta
 
Kyance's Avatar
 
Join Date: Mar 2013
Posts: 817
Reputation: 92
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

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.
__________________
I'm amazed how you people are still wasting your time on a decade old game.
Kyance is offline   Reply With Quote
Old 29/08/2014, 06:20 PM   #4
Rudy_
High-roller
 
Rudy_'s Avatar
 
Join Date: Nov 2011
Location: Pakistan
Posts: 1,355
Reputation: 230
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

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.
__________________
And now my Watch has Ended.


[Tutorial]
[TuT]How to create a car shooting Neon

[Filterscript]
Neon Vehicle Laser


__________________________________________________
Rudy_ is offline   Reply With Quote
Old 29/08/2014, 02:25 PM   #5
Sledgehammer
Huge Clucker
 
Sledgehammer's Avatar
 
Join Date: Jun 2013
Location: My computer
Posts: 485
Reputation: 114
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

Good job!
__________________
Sledgehammer is offline   Reply With Quote
Old 29/08/2014, 02:28 PM   #6
DovFlaminggo
Little Clucker
 
DovFlaminggo's Avatar
 
Join Date: Jun 2014
Location: Surakarta/Indonesia
Posts: 12
Reputation: 1
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

Good Work !
__________________
Quote:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
DovFlaminggo is offline   Reply With Quote
Old 29/08/2014, 04:21 PM   #7
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,885
Reputation: 1337
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

You should include output for packetloss it can actually cause this detection to go off.
Pottus is offline   Reply With Quote
Old 29/08/2014, 06:05 PM   #8
Kyance
Gangsta
 
Kyance's Avatar
 
Join Date: Mar 2013
Posts: 817
Reputation: 92
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

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
__________________
I'm amazed how you people are still wasting your time on a decade old game.
Kyance is offline   Reply With Quote
Old 29/08/2014, 06:11 PM   #9
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,133
Reputation: 445
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

Why did you remove the pastebin link?
Abagail is offline   Reply With Quote
Old 30/08/2014, 05:10 AM   #10
Kyance
Gangsta
 
Kyance's Avatar
 
Join Date: Mar 2013
Posts: 817
Reputation: 92
Default Re: "Silent" Aimbot Detector (FINAL RELEASE)

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.
__________________
I'm amazed how you people are still wasting your time on a decade old game.
Kyance 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
[GameMode] SATDM~RP.:"V11.5 Final":."0.3b/c/d XREVOLUTIONX" -=Revolution Release!=- $$$PiMp Gamemode Scripts 2446 17/03/2020 02:06 PM
error: undefine symbol "j" and expected token ";" but found "]" JEkvall95 Scripting Help 9 27/07/2013 10:09 AM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 12:08 PM


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


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