Health Hack check not working
#1

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;
            }
        }
Reply
#2

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
Reply
#3

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
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)