Jump to content

Changing ped health / max health[solved]


crossed99
 Share

Recommended Posts

EDIT: Nevermind, it was another mod interfering.

 

Anyone has experience with changing a non-player ped's health? 

If I use this code and log it:

ENTITY::SET_ENTITY_MAX_HEALTH(myPed, 1000);	
ENTITY::SET_ENTITY_HEALTH(myPed, 500, 0);

LOGD << " " << ENTITY::GET_ENTITY_HEALTH(myPed) << " " << ENTITY::GET_ENTITY_MAX_HEALTH(myPed, 0);
WAIT(0);
LOGD << " " << ENTITY::GET_ENTITY_HEALTH(myPed) << " " << ENTITY::GET_ENTITY_MAX_HEALTH(myPed, 0);

It logs this:

2021-09-24 20:28:28. 500 1000
2021-09-24 20:28:28. 105 105

 

So it changes it's health but it changes back right after. Same if I change it to lower values. I can set it to 0 though to kill them.

Is there a way to do this, or am I doing something wrong?

Thanks!

 

On an unrelated note: I think the search function isn't working, I don't get any hits no matter what I search for..

Edited by crossed99
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...