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

Safe room health bump to 50%


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austinbots
Member
Join Date: Jan 2010
Old 09-07-2013 , 22: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 22:16.
Austinbots is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 09-08-2013 , 00:15   Re: Safe room health bump to 50%
Reply With Quote #2

Quote:
Originally Posted by Austinbots View Post
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);
            
        }
    }
}
It defeats the purpose of setting health to 50% in saferoom, when you transition to the next map, survivors already get 50% to begin with after death. So you must be setting their health back to 50, even if they are not dead. As for the black and white, you cannot remove black and white as far as i know, unless sdkhooks is involved. You can remove temp health by setting it to 0, should not be difficult.

Someone said that to enforce black and white you had to set the max incaps, the health to 0, the temp health higher than 0, and the is going to die tag to 1. If this is true, then setting the opposite, should rectify the black and white status. Don't quote me on that.

Remove/Fix Temp Health:
PHP Code:
SetEntPropFloat(clientProp_Send"m_healthBuffer"0.0); 
Fix/Remove Health Display Incorrect:
PHP Code:
SetEntProp(clientProp_Send"m_isGoingToDie"0); 
__________________

Last edited by Marcus101RR; 09-08-2013 at 00:30.
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Reply


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 05:07.


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