How do I increase the players health? The mod is using classes, I only want to adjust 1 of the classes.
Thanks
It is currently Fri May 31, 2024 4:32 am



Welsh Mullet wrote:Have a look at how classes are done in the sdk template mod. They allow for changes of health, armour and moove speed based on class.









void CHL2MP_Player::SetHealthValue( int value )
{
m_iHealth = value;
}
// Max Health Settings.
void CHL2MP_Player::SetMaxHealthValue( int MaxHealthValue )
{
m_iMaxHealth = MaxHealthValue;
}









Welsh Mullet wrote:Ta Zombie, i had UK extended instead of UK. Stupid dead keys....
Anyway, now that's fixed, the code will be up tonight

int m_iHealth;
int m_iMaxHealth;pPlayer->SetHealth(pClassInfo.m_iHealth);
pPlayer->SetMaxHealth(pClassInfo.m_iMaxHealth);#define SDK_DEFAULT_PLAYER_HEALTH 100
#define SDK_DEFAULT_PLAYER_MAXHEALTH 100m_iHealth = pKeyValuesData->GetInt( "health", 0);
m_iMaxHealth = pKeyValuesData->GetInt( "maxhealth", 0);int m_iHealth;
int m_iMaxHealth;

Users browsing this forum: No registered users