jump.tf Forums
Welcome B)

Per-tick Health Regen

AI · 2 · 1232

AI

  • Administrator
  • Proficient
  • *****
    • Posts: 419
    • Frags: +0/-0
  • Plugins Developer
    • View Profile
    • Jump Academy
Here is the simple plugin for consistent health regeneration regardless of map that I made to help the demo jumpers during this year's Tip of the Hats.
It sets the player's health to its maximum only if the current health is lower.  If the map has already given the player a health buff, there is no effect.

Code: [Select]
public Action OnPlayerRunCmd(int iClient, int &iButtons, int &iImpulse, float fVel[3], float fAng[3], int &iWeapon) {
int iMaxHealth = Entity_GetMaxHealth(iClient);
if (Entity_GetHealth(iClient) < iMaxHealth) {
Entity_SetHealth(iClient, iMaxHealth);
}

return Plugin_Continue;
}


JoinedSenses

  • ECJ Owner
  • Administrator
  • Novice
  • *****
    • Posts: 56
    • Frags: +0/-0
    • View Profile