Jump to content
MakeWebGames

New Job Addon


Recommended Posts

Instead of the cron going work for your players why not them do it there self?

So I decided to make something like that :)

Also you will need to go on this thread to link into this -

http://makewebgames.io/showthread.php/43543-Job-Addon

Alter this -

 

You're unable to view this code.

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

 

 

Open up cron_hour.php and remove the job cron bit and then open up cron_day.php and add this somewhere -

 

You're unable to view this code.

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

 

 

Open up job.php and find -

 

You're unable to view this code.

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

 

 

Under that add -

 

You're unable to view this code.

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

 

 

Then find -

 

You're unable to view this code.

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

 

 

Top of that add -

 

You're unable to view this code.

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

 

 

Replace your Job index function to this -

 

You're unable to view this code.

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

 

 

 

And your done!

Link to comment
Share on other sites

Well there is nothing wrong with this method I would like to give you some advice. I wouldn't keep adding things into the user table.

For this you could create a Jobs table and store job done, when(timestamp), and remove the cron completely. might be something to think about?

Edited by Dominion
Link to comment
Share on other sites

I would like to add something here too, and ill start from the top and work my way down.

For your sql your adding besides it being in users table your using int 11, how big of numbers can you possibly need, 2 bill?

Since you are posting this in V2 and mysql_ is going to be depreciated you can either do mysqli_query($c,"now your query"); or use $db-> query("you query here"); notice no connection var? This way since there is classes on v2 it gives people the option to switch back and forth between mysql and mysqli, in which the ladder is a bit safer and won't depreciate for a long time coming.

For your functions you are adding you can get rid of the global vars your not using like for example your work () you can get rid of $c and $h. $c is your connection var which is not really needed here and $h is your header var which is commonly used for $h-endpage (), a die () replacement. and for both functions if you use the $db class you would have to add that to your global.

Thats pretty much it, and I'm not nit-picking so don't take it that way I'm just letting you know for future reference cause just by looking at it this should still work.

Good work and keep them coming

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