[FilterScript] 0.3z Aimbot Detection
#1

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 Код:
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

Well, nice try. I've tested it (video uploading). Results :
1) No false detections
2) Aimbot is NOT DETECTED at all.
Well, I did this in your script:
pawn Код:
stock CheckForAimbot(playerid, Float:X, Float:Y, Float:Z)
{
    new string[118], Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(HasHit[playerid] && TimesShot[playerid] >= 1)
    {
        if(!DetectedForAimbot{playerid})
        {
            foreach(Player, i)
            {
                if(GetPlayerState(i) != PLAYER_STATE_SPECTATING && playerid != i)
                {
                    if(!IsPlayerInRangeOfPoint(i, 4, X, Y, Z) && IsPlayerInRangeOfPoint(i, 175, pX, pY, pZ))
                    {
                        format(string, sizeof(string), "WARNING: %s(%d) is possibly using aimbot. /spec %d and /atest %d to test him.", GetName(playerid), playerid, playerid, playerid);
                        SendClientMessageToAll(-1, string);
                        DetectedForAimbot{playerid} = true;
                    }
                }
            }
        }
    }
}
See that ClientMessageToAll?
(I'm not an aimbotter, I only used that aimbot to test this filterscript)

Keep working on it.
Reply
#3

Quote:
Originally Posted by greentarch
Посмотреть сообщение
Well, nice try. I've tested it (video uploading). Results :
1) No false detections
2) Aimbot is NOT DETECTED at all.
Well, I did this in your script:
pawn Код:
stock CheckForAimbot(playerid, Float:X, Float:Y, Float:Z)
{
    new string[118], Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(HasHit[playerid] && TimesShot[playerid] >= 1)
    {
        if(!DetectedForAimbot{playerid})
        {
            foreach(Player, i)
            {
                if(GetPlayerState(i) != PLAYER_STATE_SPECTATING && playerid != i)
                {
                    if(!IsPlayerInRangeOfPoint(i, 4, X, Y, Z) && IsPlayerInRangeOfPoint(i, 175, pX, pY, pZ))
                    {
                        format(string, sizeof(string), "WARNING: %s(%d) is possibly using aimbot. /spec %d and /atest %d to test him.", GetName(playerid), playerid, playerid, playerid);
                        SendClientMessageToAll(-1, string);
                        DetectedForAimbot{playerid} = true;
                    }
                }
            }
        }
    }
}
See that ClientMessageToAll?
(I'm not an aimbotter, I only used that aimbot to test this filterscript)

Keep working on it.
hm.. will check it out later.
About that ClientMessageToAll - Well, a message for admins would be better

EDIT;
I'm guessing that "if(!IsPlayerInRangeOfPoint(i, 4, X, Y, Z)" would be the problem..
Eh, will check it out later ( as said above ) xd
Reply
#4

Sorry for crappy quality
Video:
http://www.youtube.com/watch?v=kHC5y...ature=*********
Reply
#5

Quote:
Originally Posted by greentarch
Посмотреть сообщение
Uff.. weird..
Try this, i changed some stuff with the radius check.
Btw, are you using the whole filter-script, or just the "CheckForAimbot" stock? d:

https://www.mediafire.com/?7389iavrq52tf5l

If that doesn't work, then i will edit / test it fully when i have time ( today or tomorrow.. hopefully sooner )
Reply
#6

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Uff.. weird..
Try this, i changed some stuff with the radius check.
Btw, are you using the whole filter-script, or just the "CheckForAimbot" stock? d:

https://www.mediafire.com/?7389iavrq52tf5l

If that doesn't work, then i will edit / test it fully when i have time ( today or tomorrow.. hopefully sooner )
I'm not stupid lmao :P
I used the whole filterscript, of course.
Trying your new filterscript....
btw, another video (deagle as wep) on your old version:
http://www.youtube.com/watch?v=hvStX...ature=*********
same results.

EDIT: tried v2
Not even either of these messages show up :
"DEBUG: %s is using aimbot" or "DEBUG: %s is not using aimbot"
Video uploading. (WEAPON: DESERT EAGLE)
Reply
#7

Quote:
Originally Posted by greentarch
Посмотреть сообщение
I'm not stupid lmao :P
I used the whole filterscript, of course.
Trying your new filterscript....
btw, another video (deagle as wep) on your old version:
http://www.youtube.com/watch?v=hvStX...ature=*********
same results.

EDIT: tried v2
Not even either of these messages show up :
"DEBUG: %s is using aimbot" or "DEBUG: %s is not using aimbot"
Video uploading. (WEAPON: DESERT EAGLE)
Slowly tracking that issue.
Will be fixed today or tomorrow, because now i only have 1 issue ( Text shows, is accurate, but due to that 0.3z hit/sync problem, it does give out false alerts.. )
Reply
#8

Try using LastShotVectors and where is the player's actual position.
Reply
#9

Simple to block thier command no? just to prevent them from typing " aim " at the chat.
Reply
#10

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
Try using LastShotVectors and where is the player's actual position.
It worked at first, but the more it got used, the more false results started to show up :\
But it is better.

Direct hits( chest, head ) cause it to bug, dunno d:
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)