J-Tanzanite / Little-Anti-Cheat

Anti-Cheat for Source Games
280 stars 65 forks source link

AimLock false ban #39

Closed Lime18 closed 3 years ago

Lime18 commented 3 years ago

I have a false ban for aimlock, the fResh player, at 7.30 it bans! https://gofile.io/d/9EiMFK

J-Tanzanite commented 3 years ago

I see what's going on.

Normally, when you teleport (Through a teleporter building in TF2) or spawn, Aimlock tests get disabled for a few seconds because your aim "snapped"/teleported. As you can see here: https://github.com/J-Tanzanite/Little-Anti-Cheat/blob/6f85930f641ead431a391e4eaeb0e397e67ac7d3/scripting/lilac.sp#L1244

// Player recently teleported or taunted, ignore angle snaps.
if (GetGameTime() - playerinfo_time_teleported[i] < 2.0)
    continue;

However, the teleport exception only counts when you spawn or take a teleporter building (TF2).


Having watched your demo, I'm not sure if it's the map that teleports the player, or if it's a plugin which does it.


If it's a plugin:

As far as I know, there isn't a way to detect when plugins teleport players, plugins that do so need to tell Lilac to not test for Aimlock through the Forward Lilac provides:

public Action lilac_allow_cheat_detection(int client, int cheat)
{
    // Psudocode... Implementation depends on the teleport plugin author.
    // Block the detection.
    if (teleported_player_recently(client) && (cheat == CHEAT_AIMLOCK || cheat == CHEAT_AIMBOT))
        return Plugin_Stop;

    // Allow the detection, it wasn't an aimlock/aimbot detection, or the player didn't teleport recently.
    return Plugin_Continue;
}

If it's the map:

Then I'm not sure how I would detect that... I'll look into it...


Which one is it? Is it a plugin that teleports players or is it the map?

Lime18 commented 3 years ago

This is plugin DUELS https://github.com/boomix/csgo-duels

J-Tanzanite commented 3 years ago

I see, it's the plugin "duels" which is doing it. You should ask the developer of that plugin to add the code I showed above to fix it.

... Tho, it doesn't seem like that developer is active all that much anymore...?


I tried to fork his plugin and fix it myself, you can find my fix here: https://github.com/J-Tanzanite/csgo-duels

NOTE!

This fork is experimental! And may have issues and may not work! It should in theory work, I only changed one thing, which was to block Aimlock detections if a player recently teleported. Try it out and see if that fixes your problem.

Lime18 commented 3 years ago

Thanks, I'll try this.

J-Tanzanite commented 3 years ago

Did it work?

Lime18 commented 3 years ago

Yes, it seems to work.

J-Tanzanite commented 3 years ago

Awesome! I'll close this issue then, if you get further problems, just reopen this issue :)