Jump to content
MakeWebGames

Recommended Posts

Posted

This should make your hospital time display as X days, X hours, X mins

In hospital.php find:

You're unable to view this code.

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

 

Add below:

You're unable to view this code.

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

 

Replace:

You're unable to view this code.

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

 

with:

You're unable to view this code.

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

 

This should work for both versions of mccodes

Guest Anonymous
Posted

Re: Hospital Time

 

3) couldnt you do this in crons

Huh, what *are* you going on about .. it's purely an output display system i.e. nothing to do with the back end.

Posted

Re: Hospital Time

IMO output of the code looks better if you replace this:

 

You're unable to view this code.

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

 

...With...

 

You're unable to view this code.

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

 

It doesn't say "0 Minutes" when its at an hour, but instead it shows nothing...example:

Old code when it hit 1 hour in hospital: 1 Hours, 0 Mins

New code when it hits 1 hour in the hospital: 1 Hours

It all really depends on the appearance you want, just letting you all see.

  • 3 weeks later...
Posted

Re: Hospital Time

 

This should make your hospital time display as X days, X hours, X mins

In hospital.php find:

You're unable to view this code.

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

 

Add below:

You're unable to view this code.

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

 

Replace:

You're unable to view this code.

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

 

with:

You're unable to view this code.

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

 

This should work for both versions of mccodes

Good Addon. I used this on my hospital and jail, thanks ;)

Posted

Re: Hospital Time

For the newbies:

This should make your JAIL time display as X days, X hours, X mins

In jail.php find:

 

You're unable to view this code.

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

 

Add below:

 

You're unable to view this code.

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

 

Replace:

 

You're unable to view this code.

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

 

with:

 

You're unable to view this code.

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

  • 2 weeks later...
Posted

Re: Hospital Time

fedjail.php - Note: I tend to not fed anyone for more than a year, so I don't know if it will display years *goes to test* yup! That does it for me!

You're unable to view this code.

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

  • 5 months later...
  • 4 weeks later...
Posted

Re: [mccodes] Hospital Time

for it too display seconds as well you would need a unix_timestamp(); to be the time they are sent to jail/hospital then in seconds the time they are in there for.

then have in header.php

include "hospyjailthingy.php";

and in that file you would need something like

$realese_time=($time_they_went_in+$how_long_there_in_there_for);

select users hosptime if they are in hosp and put the hosp time to zero when they should be released

and in jail.php you would need

$timeleftin=($time_they_went_in - unix_timestamp());

$totaltimeleft=($how_long_there_in_there_for - $timeleftin);

and the $totaltimeleft is how long in seconds they would be in there for using a little maths you all can finish this off i think if there is any holes in my logic let me know :D

Posted

Re: [mccodes] Hospital Time

lol which bit did richards or mine lol either way if anyone is interested in the time going down to seconds just post in here and ill see if i can do it lol

  • 2 months later...
Posted

Re: [mccodes] Hospital Time

Just thought I'd make this a bit easier,

You're unable to view this code.

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

Put that into global_func.php

Then, to display a time as mins, hours and days,

Just put:

You're unable to view this code.

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

 

An example of the variable could be $r['memberHospital'] or $r['memberJail'] etc.

Hope this helps a bit

Posted

Re: [mccodes] Hospital Time

Ok, since I cant change my last post,

I'll add a new one.

New function:

You're unable to view this code.

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

 

Might be a bit easier to work with now,

To display hospital time would be:

You're unable to view this code.

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

 

Just a simple function which should make the time display look a bit tidier.

Hope it helps

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