rehlds / ReAPI

AMXModX module providing APIs for ReHLDS, ReGameDLL, and Metamod plugins (e.g., ReUnion, ReVoice).
GNU General Public License v3.0
160 stars 105 forks source link

How to give hp? #69

Closed SinaloenseMx closed 7 years ago

SinaloenseMx commented 7 years ago

set_member(index, m_iClientHealth, value); doesn´t work. get_member(index, m_iClientHealth); does work.

I use: ReHLDS: 3.0.0.520-dev. ReAPI : v5.1.0.1 . ReGameDLL_CS: 5.2.0.183-dev.

justgo97 commented 7 years ago

try both : set_member(index, m_iClientHealth, 150.0); or set_member(index, m_iClientHealth, 150);

and see if they work.

WPMGPRoSToTeMa commented 7 years ago

What do you expect from changing m_iClientHealth?

SinaloenseMx commented 7 years ago

justgo97: don´t work.

WPMGPRoSToTeMa: Modify the player's hp. Is it not for that? >.<

Mistrick commented 7 years ago

Use set_entvar(id, var_health, value);

WPMGPRoSToTeMa commented 7 years ago

Modify the player's hp. Is it not for that? >.<

@SinaloenseMx nope, it is for updating health value in HUD (last value sent in Health message). You should use Float value: set_entvar(id, var_health, 50.0)

SinaloenseMx commented 7 years ago

Thanks to all for the help <3