Using health as a percent value
Hello there.
I wanna use the health to show a percentage of the real health of a player, but everytime i want to use an PHP Code:
How can i put a value on the health whithout returning zero and have that 0hp Bug? Yes, i tried something like set_pev(victim,pev_health,27) and i failed miserably Thanks in Advance. |
Re: Using health as a percent value
Float.
|
Re: Using health as a percent value
Quote:
WHY GODDAMMIT GET STUCK WITH THINGS LIKE THIS.[/rage] @On: Thanks. I'm doing this on takeDamage: PHP Code:
|
Re: Using health as a percent value
You are doing it wrong. Don't change player health. Use this:
PHP Code:
|
Re: Using health as a percent value
It works perfect.
is there a way to call that message twice? Thanks again! |
Re: Using health as a percent value
Why do you want to send it twice?
|
Re: Using health as a percent value
Quote:
|
Re: Using health as a percent value
You don't change percent value. All you need to do is set MAX_HEALTH on player spawn before changing player health and my code will do the rest.
|
Re: Using health as a percent value
If plugin that you use is well coded, you should be able to use max_health as well.
PHP Code:
|
Re: Using health as a percent value
But in mods you usually store max health in some global array, so it's better to use it instead of a native. Also you made 2 mistakes. id in your code is message id and in some cases it will display 0 health.
|
| All times are GMT -4. The time now is 20:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.