I have a plugin to bump survivor's health up to 50% when they spawn in the safe room.
This keeps people from killing each other when they reach the safe room just to get the default 50% spawn health in safe room.
I have it it working where it gives 50% health but it has these remaining problems:
1) it sets health to 50% but the health bar display doesn't show the health correctly.
The heath bar shows everyone that was set as having very little health, even though they do have 50% and they see 50%.
2) It doesn't reset the black and white status if you entered the safe room B+W.
And now on first hit you will die even though you have 50% health. I am guessing I have to reset the incap count but my try at resetting it doesn't work.
3) If you had temp health going into the safe room you keep your temp health and this means you can get more then 100% heath counting your temp health. I would like to reset all temp healt or probably better give only up to 100 health counting your new 50 health and your left over temp health.
Here is my code.
As always, thanks for any help!
public Action:timer_PlayerSpawn(Handle:timer, any:client)
if(GetClientHealth(client) < 50)
// bump health up to 50%
// reset player B&W count
SetEntProp(client, Prop_Send, "m_currentReviveCount", 0)
//ClientCommand(client, "music_dynamic_stop_playing Player.Heartbeat"); // stop the music
//set temp heath to 0
//SetEntPropFloat(client, Prop_Send, "m_healthBuffer", 0.0);
new temphpoffset = FindSendPropOffs("CTerrorPlayer","m_healthBuffer");
SetEntDataFloat(client, temphpoffset, 0.0, true);