health regeneration for my vip players.
#3

pawn Код:
#define         HEALTH_REGEN_TIME           53640 // Approximately 1 minute
#define         HP_INCREMENT                1.0

public OnGameModeInit()
{
    SetTimer("VIPHealthRegen", HEALTH_REGEN_TIME, true);
}

forward VIPHealthRegen();
public VIPHealthRegen()
{
    new Float:hp;
    foreach(new i : Player)
    {
        if(VipPlayer[i])
        {
            GetPlayerHealth(i, hp);
            if(hp < 100.0)
            {
                hp += HP_INCREMENT;
                if(hp > 100.0) hp = 100.0;
                SetPlayerHealth(i, hp);
            }
        }
    }
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)