Simple method to hp regenerate
How can i regenerate hp gradually i mean if my hp is less than 100 it should regenerate like +5hp per 0.5 seconds till 100 ? What is the simple and easy way to do that ?
|
Re: Simple method to hp regenerate
Code:
|
Re: Simple method to hp regenerate
Code:
set_pev( id, pev_health, float( clamp( floatround( pev( id, pev_health ) ) + 5, 1, 100 ) ) );Code:
ExecuteHamB(Ham_TakeHealth, id, 5.0, DMG_GENERIC) |
Re: Simple method to hp regenerate
Quote:
|
Re: Simple method to hp regenerate
Quote:
Nice, didn't know you could do so with HAM. Will take in account in my future codes. Does pev_max_health affect the max healing value if using HAM? |
Re: Simple method to hp regenerate
yes, it will. So if you have max health > 100, than you need to overwrite the pev_max_health field value.
Spoiler
Quote:
|
Re: Simple method to hp regenerate
Quote:
|
Re: Simple method to hp regenerate
Quote:
|
Re: Simple method to hp regenerate
Quote:
If you don't use a task, you could create a trigger_hurt entity, set it dmg to -value, so it will heal instead of hurting. Also, maybe you can play with m_idrowndmg offset, so game will heal the player automatically. |
Re: Simple method to hp regenerate
PHP Code:
|
| All times are GMT -4. The time now is 09:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.