Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need a bit of help
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#4
RE: Need a bit of help

Yes, it's expected. You could run a looping timer to always reduce the health to 50 if the player goes above the limit.
The timer frequency is set to an amount which shouldn't bug the game, but it's fast enough for players not to notice the change.
You also need to start the timer somewhere. And use RemoveTimer to stop it

void HealthCap(string &in asTimer)
{
   AddTimer("loop", 0.4f, "HealthCap");
   if( GetPlayerHealth()  > 50.0f)
   {
       SetPlayerHealth(50.0f);
   }
}

(This post was last modified: 01-20-2019, 04:18 PM by Darkfire.)
01-20-2019, 04:16 PM
Find


Messages In This Thread
Need a bit of help - by RaXZerGamingZ - 01-19-2019, 07:35 PM
RE: Need a bit of help - by Mudbill - 01-19-2019, 10:22 PM
RE: Need a bit of help - by RaXZerGamingZ - 01-19-2019, 11:22 PM
RE: Need a bit of help - by Darkfire - 01-20-2019, 04:16 PM
RE: Need a bit of help - by RaXZerGamingZ - 01-20-2019, 04:32 PM
RE: Need a bit of help - by Mudbill - 01-20-2019, 07:15 PM



Users browsing this thread: 1 Guest(s)