Anti Health Hack doesn't work -
NeXoR - 30.10.2016
Hey guys, here is a quick script I made using someone's help from the forums, and I was wondering why is it bugged ...
Here is the code:
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
{
if(!SpawnProtected[damagedid])
{
if(Armour[damagedid] > amount) Armour[damagedid] -= amount;
else if(Armour[damagedid])
{
amount -= Armour[damagedid];
Armour[damagedid] = 0.0;
if(amount)
{
if(Health[damagedid] > amount) Health[damagedid] -= amount;
else Health[damagedid] = 0.0;
}
}
else if(Health[damagedid] > amount) Health[damagedid] -= amount;
else Health[damagedid] = 0.0;
new Float:hp, Float:ap;
GetPlayerHealth(damagedid, hp);
GetPlayerArmour(damagedid, ap);
if(Health[damagedid] != hp || Armour[damagedid] != ap) return AddBan(damagedid, RPN(damagedid), "Anti Cheat", "Health Hacking", RPIP(damagedid));
}
return 1;
}
When you get hit, your HP&AP lost is reduced from your HP & AP server sided array, if it's different = get banned.
The bug is: Even if I am not using any hacks, I am getting banned, anyone ?
Re: Anti Health Hack doesn't work -
GoldenLion - 30.10.2016
I guess it's because when you do something under OnPlayerTakeDamage it does all the stuff before player loses health so basically you recude the amount from the variable and after that you get the player's actual health which didn't lose that "amount" of health yet so they differ. For example you got 100 health, the amount is 50, you remove amount from the variable, there's 50 left in the variable, but when you get the actual health after that it's still 100, because it will take the actual health after all of that stuff so I guess only way is adding serversided weapon damages.
Re: Anti Health Hack doesn't work -
NeXoR - 30.10.2016
OnPlayerGiveDamage/OnPlayerTakeDamage is called AFTER the health&armour is reduced or before ?
Re: Anti Health Hack doesn't work -
GoldenLion - 30.10.2016
Before.
Re: Anti Health Hack doesn't work - iLearner - 30.10.2016
Best way for anti health & armour hacks = set max HP and Armour to 99, in ammunitions admin cmds & check with a timer if its > 99 : Ban.
Worked for my CnR at least, you gotta remove vendor machines tho
Re: Anti Health Hack doesn't work -
NeXoR - 30.10.2016
Quote:
Originally Posted by iLearner
Best way for anti health & armour hacks = set max HP and Armour to 99, in ammunitions admin cmds & check with a timer if its > 99 : Ban.
Worked for my CnR at least, you gotta remove vendor machines tho
|
Don't you think it's possible to set less than 99 HP ? (using hacks)
Re: Anti Health Hack doesn't work - iLearner - 30.10.2016
Usually & most likely they set to 100%.