Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Sync Player Health and Armour

$
0
0
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

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?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>