30.10.2016, 12:42
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:
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 ?
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;
}
The bug is: Even if I am not using any hacks, I am getting banned, anyone ?