Jump to content
MakeWebGames

Stuck please help...kindly!


Canjucks

Recommended Posts

So I tried to make russian roulette a hospital event instead of being killed you hit the hosp for x amount of time. So, I haven't understood yet how health works and I think this is where the issue lies but this is the code I changed in roulette and the screenshot is the error I get in hospital.

 

if ($shot) {
                $this->error("It was the chamber with the bullet and you paralysed yourself!");
                $this->user->set("US_energy", 0);
                $this->user->set("US_will", 0);
          // update health to 0 and timer to extended time in hospital
          // I tried health at 0 but then found it was linked to ranks so made higher value. 
                $this->user->set("US_health", 1000);
                $this->user->set("US_shotBy", $this->user->id);
                $this->user->updateTimer('hospital', (30000), true);

Thanks in advance if you can help me work this out as its been kinda bugging me - see what I did there lol

hospital-screenshot.jpg

Link to comment
Share on other sites

The issue is understanding how health is dealt with in GL. The mod that I modified isn't mine in Russian Roulette which kills you if you get hit. In my version it send you to hospital for x amount of time, losing your will and energy. After reading some of your responses it made me think if Health is always 0 then this change I made won't work unless I make further changes so Health can equal a greater number so when it hits 0 it does something more than it does now as setting it to 0 does nothing. You can set it to a higher number for reviving your health in the hospital mod if somehow you lose health you can pay to get it back to 100% which is not quite accurate as it is. This just might be a flaw with how I'm trying to change the game to suit the style I'm working towards.

Link to comment
Share on other sites

They way I understand it, a players full health equals zero and goes up with damage.  If the players health value exceeds the rank health value, then they should be dead.  When you check in to hospital,  health value is set to zero (full health) and player is released when hospital timer runs out.  It sounds like you want other players to be able to bust someone out of the hospital early by paying a fee or by other means  (just guessing because you didn't provide a lot of detail).  If that's the case, you should be trying to reduce or reset the player's hospital timer, to simulate that you are speeding up the healing / reviving them.

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, Tom V said:

They way I understand it, a players full health equals zero and goes up with damage.  If the players health value exceeds the rank health value, then they should be dead.  When you check in to hospital,  health value is set to zero (full health) and player is released when hospital timer runs out.  It sounds like you want other players to be able to bust someone out of the hospital early by paying a fee or by other means  (just guessing because you didn't provide a lot of detail).  If that's the case, you should be trying to reduce or reset the player's hospital timer, to simulate that you are speeding up the healing / reviving them.

Thanks for explaining how Health works that will go a long way to understanding this error (or lack of reason for the error that I have when using russian roulette). I thought I did explain it but yes I want to have a revive button (bust out) for a fee ultimately either with money or energy as the cost or both. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...