Setting users health mod independant
Hi,
again one of my stupid questions. I wrote a plugin called HP Balance : http://forums.alliedmods.net/showthread.php?t=50285 It's working fine, but I need some help to improve it. Right now I set users health to some value at round start. In some mods, users may regenerate some how. How can I restrict/expand their regeneration to another health value than 100? This needs to be mod independant! Thx in advance, of course you will get credit and karma for your relevant help ... |
Re: Setting users health mod independant
Try checking their maximum HP.
Fakemeta: Code:
Engine: Code:
|
Re: Setting users health mod independant
I do not need to know it, I need to set it to another value until next respawn ...
|
Re: Setting users health mod independant
Uh, okay...
Fakemeta: Code:
Engine: Code:
|
Re: Setting users health mod independant
@Avalanche, he wasn't asking that.
@Isobold, I don't think thats possible without making it mod specific (j/w what mod are you talking about). |
Re: Setting users health mod independant
Lord_Destros: Then what was he asking?
|
Re: Setting users health mod independant
Quote:
If I said it was impossible earlier I somewhat lied. Heres the only method I can think of: To (re/de)generate their health: 1. Simply make a loop that gives players health every X seconds if their HP is greater than 100 UP TO whatever you initially used in set_pev. 2. To degenerate their health (they specify a value less than 100 in set_pev) Simply make a loop that removes players health every X seconds if their HP is greater than what you initially used in set_pev. To detect if the mod supports regeneration: 1. Check once every second to see if a players health has increased. If it has then measure the amount it has increased and over what period of time. Downsides to this method. It will not work if they were hurt but the damage they received was not enough to trigger regeneration and if someone increases a users health via a medical kit or admin command then that will confuse the plugin. If you want it to be mod independent I suggest just creating 2 cvars with examples shown below sv_regeneration "<0/1>" sv_regenerationRate "<Regeneration rate as a float in seconds>" |
Re: Setting users health mod independant
That would not solve my problem, as I was asked to solve an issue, where people would use an health kit and regain their health up to 100 health no matter to which health amount they were set at round start (instead of regenerating to the value they got asigned at round start).
What I need is to allow health to be regenerated (by what ever event) to a value calculated at round start, so that one would not be able to have more than 67 health, while another player would be able to have 133 hp. My plugin already gives them this health at round start, and I could manage to survey that the first player would not get more than 67 hp, but how could I manage to let player two regain his 133 health by picking up a health kit? If he is at 101 health for example, he would not even pick up the health kit, so no event would follow?!? Your idea to use a fix regeneration would not be a god idea, as wc3 for cs for example has regeneration for some characters only, others only regenerate if a healer is somewhere around. Is there really now way to set some kind of max-health-value? HLČ makes exentsive use of this, was it only introduced there? |
Re: Setting users health mod independant
My idea isn't that good since it has far too many problems but unless you specify the recover rate by cvar (and the amount to heal) then it should be impossible as far as I know to do it well.
About your wc3 comment you would be able to check if they are within range of someone else and are the correct 'race' with correct ability before giving them the HP. |
Re: Setting users health mod independant
Quote:
Mods that give players their own health regeneration certainly use max_health. Health chargers and medkit pickups check to make sure they don't go over max_health. So, change max_health, as I showed you already. |
| All times are GMT -4. The time now is 00:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.