Jump to content
MakeWebGames

Hospital Explore Updated **TESTED**


boionfire81

Recommended Posts

So, I found this mod at

http://makewebgames.io/forum/ga...spital-explore

and I decided to update it a bit. Instead of using energy and restricting the amount of attempts, I decided to use stamina with unlimited attempts (as there are no medical items for healing, if you get hurt your hurt! or have insurance for healing and/or credits).

I also added the ability to find items with a random amount, and a bribe feature. So here it is.

Real simple. 1 file. 1 sql. 1 line for cron_day. Replace the numbers 87 & 88 with your item id's.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add to cron_day

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Feedback is welcome. But just remember I basically read my first line of php only a month ago.

Edited by boionfire81
  • Like 1
Link to comment
Share on other sites

Looks good, but, $result 6 does not check for if the player has enough cash on them for the bribe. They'll go negative cash if they have none.

Someone can correct me if I'm wrong, but I think its a better idea to use mt_rand() over rand().

Also, in $result == 2, I think it may be smart to resolve the item_id to a variable, for easier editing.

I understand you were only fixing bugs from an existing mod, but, still, a little advice might help you when it comes to your own mods. :D

-TMG

  • Like 1
Link to comment
Share on other sites

Yeah. I was trying to think how to solve that. I can check the cash, but no idea how to properly add that. And I'll add the items to a variable. Just had to update to use the cron. Without steps you can just keep going and time added has no effect. So when time is added it simply blocks you from exploring anymore that day. So a simple roll of the dice.

Link to comment
Share on other sites

...

Someone can correct me if I'm wrong, but I think its a better idea to use mt_rand() over rand...

This is debatable and I believe Guest knows a great resource to show a comparison of rand vs mt_rand. But I believe with such a small range you won't really see a huge difference in random number generation with mt_rand.

And to test it with rand just change the mt_rand to rand

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...