Force player to have not more than definied hp
#2

Create a timer with a loop through all players and check their health, if it's above 90, set it to 90. Like this:

pawn Код:
forward HealthTimer();

//Under OnGameModeInit
SetTimer("HealthTimer",1000,1);

//Somewhere else
public HealthTimer()
{
     for (new i=0;i<MAX_PLAYERS;i++)
     {
          if (IsPlayerConnected(i))
          {
            new Float:health;
            GetPlayerHealth(i, health);
            if (health > 90) SetPlayerHealth(i, 90);
          }
     }
}
Reply


Messages In This Thread
Force player to have not more than definied hp - by Face9000 - 06.01.2012, 18:51
Re: Force player to have not more than definied hp - by Jakku - 06.01.2012, 19:14
Re: Force player to have not more than definied hp - by Scenario - 06.01.2012, 19:37

Forum Jump:


Users browsing this thread: 1 Guest(s)