Jump to content
MakeWebGames

Recommended Posts

Posted

Well I got bored and I saw mainmenu.php it relied on 2 crons to count players in Hospital and Jail so here's a quick edit to get rid of the crons.

  • Edit 2 PHP Files

 

First open up mainmenu.php and find:

You're unable to view this code.

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

 

and replace with:

You're unable to view this code.

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

 

now find your hosptial links and replace with:

You're unable to view this code.

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

 

and again with jail links and replace with:

You're unable to view this code.

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

Save it.

open up cron_minute.php find and delete the following queries:

You're unable to view this code.

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

Save it..

 

And Your Done.

Posted

Re: [MCCodes V2] Jail/Hosp Count

 

the main reason why i did this is because you can't run crons on wamp server just like that.

As a matter of fact... you can! you have a couple of ports to windows on the cronjobs. just google for "win cron" or "windows cronjobs" :)

Posted

Re: [MCCodes V2] Jail/Hosp Count

 

Is It Better Then Having It In The Min. Cron ???

Depends, do you like being 60 seconds out? it won't piss the users off so much, i don't have the count on there anyway :P

Posted

Re: [MCCodes V2] Jail/Hosp Count

Zero..think...is this much difference from the users online on the menu? not really....

 

+1 well done matey

Thanks Mate

  • 3 months later...
Posted

Re: [MCCodes V2] Jail/Hosp Count

 

You're unable to view this code.

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

 

Can't you just add this to your menu, and remove the whole cron? Like just replace the

 

You're unable to view this code.

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

with the line above?

Posted

Re: [MCCodes V2] Jail/Hosp Count

 

You're unable to view this code.

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

 

Can't you just add this to your menu, and remove the whole cron? Like just replace the

 

You're unable to view this code.

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

with the line above?

WAH!!! Don't select everything from the users table! lol

 

You're unable to view this code.

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

Posted

Re: [MCCodes V2] Jail/Hosp Count

 

Pardon the n00b of my coding, but what is the difference? I ask, not being sarcastic at all, because I really dont know :)

Ah, 'tis not a problem.

'tis the basics of physics (forgive the language, haven't slept yet..)

The more you select, the longer it takes.

If you have a database with 100 users, you won't notice much of a difference. But, on the other hand, if you have a database with 100,000 users, you'll surely feel the drain on your server!

Select only what is required to keep your code quick, and efficient!

You could also use this method:

You're unable to view this code.

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

 

Both methods I have posted would return the same answer.

Both methods would also work a lot faster than selecting everything. ;)

Posted

Re: [MCCodes V2] Jail/Hosp Count

Yeah but this still runs every time someone refreshes therefore normally more than 1 per minute depending on user base...

Which makes this bad for your website not good

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