Sync Player Health and Armour
#1

So...i have a deathmatch system with many features.

I need to figure it out how to do a sync player health and armour.

I have 2 var, Health[playerid] and Armour[playerid], and I check every time when someone shoot in him using OnPlayerGiveDamage

here what I use: https://pastebin.com/ed6WhGW2

So all works, but the problem is when no one shot him, and he falls from a building or else (when no one shoot in him) hes health or amour(if has) are decrease, so after that, a player come and shot for example 1 bullet the health will change to the variable health/armour (the variable does not know when it's been downgraded his last health/armour) so .. i need to know how to do that. When the player take damage from falling/explosion to decrease in health[playerid] or armour[playerid]..

Example:

The player has health 100 (Health[playerid] = 100.0).
The player lost 50 hp from falling from a building (remain health: 50, but the variabile Health[playerid] remain 100);
Another player came to our player and shot 1 bullet with m4 (-10hp). his health is set to 90 not to 40.

I know that his variabile (health[playerid]) is changed only when someone shoot in him, but i don't really know how to check if the player has falling or something else..

Can someone give me some advice or explain me how to resolve that?
Reply


Messages In This Thread
Sync Player Health and Armour - by RedGun2015 - 05.02.2018, 13:33
Re: Sync Player Health and Armour - by Sew_Sumi - 05.02.2018, 14:20
Re: Sync Player Health and Armour - by RedGun2015 - 05.02.2018, 14:24
Re: Sync Player Health and Armour - by Sew_Sumi - 05.02.2018, 14:55
Re: Sync Player Health and Armour - by RedGun2015 - 07.02.2018, 10:13
Re: Sync Player Health and Armour - by Sew_Sumi - 07.02.2018, 16:05
Re: Sync Player Health and Armour - by RedGun2015 - 07.02.2018, 18:57
Re: Sync Player Health and Armour - by Sew_Sumi - 07.02.2018, 21:21
Re: Sync Player Health and Armour - by Mugala - 08.02.2018, 10:27
Re: Sync Player Health and Armour - by Sew_Sumi - 08.02.2018, 10:29

Forum Jump:


Users browsing this thread: 1 Guest(s)