Jump to content
MakeWebGames

Your Local Pub


SecurityEh

Recommended Posts

Information:

The base of it really is to try and add an incentive to gain currency/items and I thought why not have a bit of fun with it :).

Features:

  • Use's TheMasterGeneral's Hospital/Jail's functions
  • Chance of player obtaining a small amount of SilverCoins/GoldCoins
  • Chance of Removing x amount of GoldCoins
  • Chance of removing a percentage of Will/Exp

 

Code Below:

 

You're unable to view this code.

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

 

 

Things to note some of the functions/variables may or may not be in your game just remove or replace these thank you.

Added Improvements by Guest ;)

Any feedback welcomed.

~SecurityEh

Link to comment
Share on other sites

Nice.

 

  • Can you supply the hospitalize() function (if I remember, stock McCodes don't come with these)
  • Can you supply the lockup() function (if I remember, stock McCodes don't come with these)
  • Would be cool for a staff area to add more outcomes dynamically
Link to comment
Share on other sites

Points to note;

Calculations Pointless

In the code, you have multiple calculations for values, such as;

You're unable to view this code.

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

Why are we even calculating with PHP when you can just answer the math yourself and use a static number? Respectively, they are;

You're unable to view this code.

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

 

Indentation Style :: None

Please, pick a bracket style and indentation style. And use it.

Multiple Line Ternary

Why do we need 3 lines here?

You're unable to view this code.

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

Also, use ctype_digit in place of is_numeric and you won't need to type cast the shizzle. 0 doesn't need quotations. It's a number, not a string.

You're unable to view this code.

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

 

White Space - Why so much, bro!?

Why do we have so much random indentation here?

You're unable to view this code.

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

And why are 2 echo's required? They do do calls at PHP level to re-initiate - negligable, but if you want to learn to do "this" (AKA Comp00tr shiz), do it properly.

Also, no idea why there is a closing select, yet no opening ones, or options.

You're unable to view this code.

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

Link to comment
Share on other sites

Thanks for the criticism Guest, I now look it and think yeah did I really need to add that much space etc cheers I also adding what you said about is_numeric it does make sense to use ctype_digit now I think about it, As for the math side I was'nt if by adding a static number it would do as intended but as you said it woul just calcuate to that static number anyway so it would make sense just to out the static number in the first place.

As for ~Rob0t, the functions can be found here http://makewebgames.io/showthread.php/46842-Jail-Hospital-Timestamps?highlight=TheMasterGeneral.

As for a staff panel/area It will be something I would definitely look into as it should would work really nicely with it.

Other thoughts:

What are peoples opinions about adding MySQL to the mix?

So maybe have the outcomes in the database for the staff panel as well has having somesort of way of limiting how many times can a user use the Pub.

Any more thoughts that anyone would like to add?

Edited by SecurityEh
Link to comment
Share on other sites

Those functions make the assumption people are using time stamps and not countdown minutes. If those are added to to a game using count down minutes, you are essentially giving them an hour hospital time per minute.

Might want to include your own functions, for when game owners haven't converted there stuff over to time stamps.

Link to comment
Share on other sites

Changed the file around some for you.

 

Pub File

You're unable to view this code.

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

 

SQL - Assuming none of these are in the end-users database;

You're unable to view this code.

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

 

Cron Lines - daily/hourly cron

You're unable to view this code.

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

 

Notes

At this point, it's worth noting that the drinks selection does nothing at all and

the results are the same whichever you use. Anybody feel like expanding it?

 

Disclaimer

THIS IS NOT TESTED AND I OFFER NO WARRANTY OF IT WORKING. HOWEVER, IF YOU FIND A

PROBLEM, POST IT HERE - MYSELF OR OTHER COMMUNITY USERS MAY BE ABLE TO FIX IT FOR YOU.

Link to comment
Share on other sites

Changed the file around some for you.

 

Pub File

You're unable to view this code.

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

 

SQL - Assuming none of these are in the end-users database;

You're unable to view this code.

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

 

Cron Lines - daily/hourly cron

You're unable to view this code.

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

 

Notes

At this point, it's worth noting that the drinks selection does nothing at all and

the results are the same whichever you use. Anybody feel like expanding it?

 

Disclaimer

THIS IS NOT TESTED AND I OFFER NO WARRANTY OF IT WORKING. HOWEVER, IF YOU FIND A

PROBLEM, POST IT HERE - MYSELF OR OTHER COMMUNITY USERS MAY BE ABLE TO FIX IT FOR YOU.

Thanks again I tweaked it slighty as there were one or two parse errors but nothing majour other then that it works a treat.

Edited OP*

Cheers :)

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