05.02.2018, 13:33
(
Последний раз редактировалось RedGun2015; 07.02.2018 в 10:17.
)
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?
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?