28.04.2013, 01:25
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);
}
}
}
}