30.10.2016, 11:21
Hey guys, I am scripting an Anti GodMode along with an Assists system, so I tried to make the HP&AP server sided, although, for example if I have those variables:
And I am using
Since amount = health & armour
How can I know where to start reducing health if I don't know where the armour is lost ?
That's the code I am planning to script
How can I detect if the armour is gone and start reducing HP ?
PHP код:
new Float:Health[MAX_PLAYERS];
new Float:Armour[MAX_PLAYERS];
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
How can I know where to start reducing health if I don't know where the armour is lost ?
That's the code I am planning to script
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
{
// Here the health & armour are reduced from the array
new Float:hp, Float:ap;
GetPlayerHealth(playerid, hp);
GetPlayerArmour(playerid, ap);
if(Health[playerid] != hp || Armour[playerid] != ap) return AddBan(playerid, RPN(playerid), "Anti Cheat", "Health Hacking", RPIP(playerid));
return 1;
}