View Single Post
Re: Metamod: setting player health
Old
  (#3)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Re: Metamod: setting player health - 13-02-2004

1) make sure you also set max_health or it may ignore your changes.

2) Be sure to do this inSpawm_post.
If you try it in Spawn() your changes will be overwritten.
Here is a little code that maxes out the health of the hostages.


int Spawn_post(edict_t *pent)
{
// are we spawning a hostage ?
if (strcmp (STRING (pent->v.classname), "hostage_entity") == 0)
{
// Max out the health of the hostages
pent->v.max_health = 0x0FFFFFFF;
pent->v.health = 0x0FFFFFFF;
}
RETURN_META_VALUE (MRES_IGNORED, 0);
}
  
Reply With Quote