Set Player's max HP on spawn (TF2)
I have seen several plugins on servers running sourcemod that do this, but everytime I have messed with it in the past, it would up their health, and then it would decrease like it was overhealing.
I am looking for a way to set their max health on spawn. Anyone have this code block laying around or care to explain to me what I need to do? |
Re: Set Player's max HP on spawn (TF2)
Code:
/** |
Re: Set Player's max HP on spawn (TF2)
n00b question:
Why do you need to create a timer in event_PlayerSpawn to make a delayed call to timer_PlayerSpawn? |
Re: Set Player's max HP on spawn (TF2)
A bug with the way Valve handles player's Max Health. When they spawn, they have 100 health, and then a split second later (less than 0.1s), it's bumped up to the appropriate number. Having the delay is the only real way to change it, otherwise Valve's stuff will bump it back to what they want.
|
Re: Set Player's max HP on spawn (TF2)
bl4nk you can try making the delay 0.0, which would fire the next frame, this way player's won't notice it being changed and it should bypass the weird way Valve handle's HP in TF2
|
Re: Set Player's max HP on spawn (TF2)
You try it. I didn't even compile my version. :P
|
Re: Set Player's max HP on spawn (TF2)
I don't even have a TF2 server lol, CrimsonGT, wanna give a delay of 0.0 a try?
|
Re: Set Player's max HP on spawn (TF2)
This way doesn't work anymore to set higher max health. I do really need that thing, any fresh ideas?
|
Re: Set Player's max HP on spawn (TF2)
Well, I have system I use for a different mod entirely to incap player's HP due to super-regeneration of health.
It basically modifies the HP on every game frame (there is no obvious incap for health the mod I am working with) to lower it. In the case of TF2, only minor tweaks are required - an array to store all the client's maximum possible HP, another for their current HP (modifying it via the hurt_event manually getting the damage), and setting their HP to match the 'current HP' stored in an array in OnGameFrame (killing them when they fall below 1HP). Absolutely nightmarish way of doing it, but it's pretty much guaranteed to work. Or, if someone knows how; disable the degeneration element of the HP. |
Re: Set Player's max HP on spawn (TF2)
Well, there are those nasty workarounds but the reason i want to increase max health:
In my mod health is dynamic, some have 321 max health, somebody else have 432 max health. In CSS it wasn't a problem. In TF2 there is a really good hud of hp and all those workarounds will make that pretty hud be useless for health - I do really want to use it instead of writing in the mid of screen or somewhere else the mod health. If remove degeneration then there will be a visual bug with "outer crest" in hp hud and problems with medic's healing and medcits.. |
All times are GMT -4. The time now is 13:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.