SA-MP Forums Archive
Health Hack check not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Health Hack check not working (/showthread.php?tid=592369)



Health Hack check not working - Aerotactics - 23.10.2015

Expectation: Player gets banned if their actual health is more than their stored health.

Reality: Player gets banned for taking fall damage.

pawn Код:
new Float:health;
        GetPlayerHealth(i, health);
        if(SpectatingPlayer[i] != -2)
        {
            if(health > OldHealth[i])
            {
                SpectatingPlayer[i] = -2;
                new hour, minute, second, bstring[256], gstring[128];
                TIMER_BAN[i] = SetTimerEx("BanTimer", 1000, false, "i", i);
                gettime(hour, minute, second);
                format(bstring,sizeof(bstring), "Banned Details\nBanned by: [HG AntiCheat]\nCurrent Time: %d:%d:%d\nBan Reason: Health Hacking\nTake a SS with F8\nAnd post on our forums at\nhttp://hungergames2015.enjin.com", hour, minute, second);
                ShowPlayerDialog(i, BAN_DIALOG, DIALOG_STYLE_MSGBOX, "You've been banned.", bstring, "OK", "");
                format(gstring,sizeof(gstring), "AdmCmd: {FFFFFF}[HG AntiCheat] has banned player %s for Health Hacking.", GetName(i));
                SCMA(COLOR_ORANGE, gstring);
            }
            else if(health <= OldHealth[i])
            {
                OldHealth[i] = health;
            }
        }



Re: Health Hack check not working - PrO.GameR - 23.10.2015

A simple printf("Current: %f, Old: %f",health,oldhealth[i]); usually helps, I suspect that you are not setting oldhealth when player joins server, it is 0.0 by default, therefore if player gets hit, and doesn't die, his health is always higher than 0, so he gets banned
Solution: put oldhealth as 100 when player's spawn


Re: Health Hack check not working - Aerotactics - 23.10.2015

Quote:
Originally Posted by PrO.GameR
Посмотреть сообщение
A simple printf("Current: %f, Old: %f",health,oldhealth[i]); usually helps, I suspect that you are not setting oldhealth when player joins server, it is 0.0 by default, therefore if player gets hit, and doesn't die, his health is always higher than 0, so he gets banned
Solution: put oldhealth as 100 when player's spawn
Yup, we realized there is a timer setting health to 100 without setting the variable. GG


Re: Health Hack check not working - Pottus - 23.10.2015

Why not just use Slices damage include which in my view is essential to any server it will completely eliminate the ability to health hack at all you are living in the dark ages my friend