Force player to have not more than definied hp
#1

Hello,since i'm making an anticheat i need to force player to NOT have HP/Armour MORE than 90.

Ex: If player buy a pizza from pizza stack and he fully restore his hp,the script will make automatically to 90.

Thanks (:
Reply
#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
#3

A good way around a health cheat would be something like your own server-side health system. It would work just like server-side money.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)