0.3z anti health hack?
#1

What do you think about this code? It should detect a health hacker
pawn Код:
new hit[MAX_PLAYERS], Float:oldhealth[MAX_PLAYERS], Float:newhealth[MAX_PLAYERS];
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    switch(hittype)
    {
        case BULLET_HIT_TYPE_PLAYER:
        {
            hit[hitid]++;
            switch(hit[hitid])
            {
                case 1..3: GetPlayerHealth(hitid, oldhealth[hitid]);
                case 4..6:
                {
                    GetPlayerHealth(hitid, newhealth[hitid]);
                    if(newhealth[hitid] == oldhealth[hitid])
                    {
                        //Ban(playerid); //cheat
                        SendClientMessage(playerid, -1, "cheat");
                    }
                }
                default:hit[hitid] = 0;
            }
        }
    }
    return 1;
}
I tested it with server-side godmode(setting player's health to infinite), so far it works. But, I need your opinion. Maybe there's something that I forgot?
Reply


Messages In This Thread
0.3z anti health hack? - by newbienoob - 20.01.2014, 04:59
Re: 0.3z anti health hack? - by CuervO - 20.01.2014, 06:11
Re: 0.3z anti health hack? - by Optimus_Sprite - 20.01.2014, 06:22
Re: 0.3z anti health hack? - by CuervO - 20.01.2014, 06:42
Re: 0.3z anti health hack? - by chencong - 20.01.2014, 07:17
Respuesta: 0.3z anti health hack? - by MugiwaraNoLuffy - 20.01.2014, 07:29
Re: 0.3z anti health hack? - by cessil - 20.01.2014, 11:39
Re: 0.3z anti health hack? - by Cypress - 20.01.2014, 13:11
Re: 0.3z anti health hack? - by Riddick94 - 20.01.2014, 13:20
Re: 0.3z anti health hack? - by newbienoob - 20.01.2014, 13:54

Forum Jump:


Users browsing this thread: 1 Guest(s)