Hey. I need help with max health stock. People have their health above 100, so this stock is kinda useless. How do i get their actual max health (not 100). Im running ZM server, so HP changes dynamically (change Zp class)
PHP Code:
stock get_user_maxhealth( idUser )
{
new maxHealth = 100
static iSkillLevel;
iSkillLevel = SM_GetSkillLevel( idUser, SKILL_DEVOTION );
// Human Devotion Skill
if ( iSkillLevel > 0 )
{
maxHealth += iSkillLevel * p_devotion;
}
// For talisman +
// Player has a health bonus from the Periapt of Health
if ( ITEM_Has( idUser, ITEM_HEALTH ) > ITEM_NONE || fWorkTalismanPassive(idUser, arrTalismanActive[idUser]) == TALISMAN_ITEM_HEALTH )
maxHealth += get_pcvar_num( CVAR_wc3_health );
if(maxHealth > 255)
maxHealth = 255;
return maxHealth
}
Can i simply use
PHP Code:
pev(idUser, pev_max_health, maxHealth)
Instead of
PHP Code:
new maxHealth = 100