[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


Messages In This Thread
0.3z Aimbot Detection - by Kyance - 24.06.2014, 06:02
Re: 0.3z Aimbot Detection - by greentarch - 24.06.2014, 06:30
Re: 0.3z Aimbot Detection - by Kyance - 24.06.2014, 06:43
Re: 0.3z Aimbot Detection - by greentarch - 24.06.2014, 06:47
Re: 0.3z Aimbot Detection - by Kyance - 24.06.2014, 06:54
Re: 0.3z Aimbot Detection - by greentarch - 24.06.2014, 06:57
Re: 0.3z Aimbot Detection - by Kyance - 24.06.2014, 09:32
Re: 0.3z Aimbot Detection - by Tamer - 24.06.2014, 09:48
Re: 0.3z Aimbot Detection - by DemME - 24.06.2014, 09:54
Re: 0.3z Aimbot Detection - by Kyance - 24.06.2014, 11:39

Forum Jump:


Users browsing this thread: 1 Guest(s)