Raised This Month: $12 Target: $400
 3% 

Safe room health bump to 50%


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Austinbots
Member
Join Date: Jan 2010
Old 09-07-2013 , 21:13   Safe room health bump to 50%
Reply With Quote #1

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!

Code:
public Action:timer_PlayerSpawn(Handle:timer, any:client)
{
    if(IsClientInGame(client))
    {
        if(GetClientHealth(client) < 50)
        {
            // bump health up to 50%
            SetEntityHealth(client, 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);
            
        }
    }
}

Last edited by Austinbots; 09-07-2013 at 21:16.
Austinbots is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode