Server sided health & armour
#1

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:
PHP код:
new Float:Health[MAX_PLAYERS];
new 
Float:Armour[MAX_PLAYERS]; 
And I am using
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart
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
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart)
{
    
// Here the health & armour are reduced from the array
    
new Float:hpFloat:ap;
    
GetPlayerHealth(playeridhp);
    
GetPlayerArmour(playeridap);
    if(
Health[playerid] != hp || Armour[playerid] != ap) return AddBan(playeridRPN(playerid), "Anti Cheat""Health Hacking"RPIP(playerid));
    return 
1;

How can I detect if the armour is gone and start reducing HP ?
Reply


Messages In This Thread
Server sided health & armour - by NeXoR - 30.10.2016, 11:21
Re: Server sided health & armour - by GoldenLion - 30.10.2016, 11:28
Re: Server sided health & armour - by NeXoR - 30.10.2016, 11:46

Forum Jump:


Users browsing this thread: 1 Guest(s)