Greetings everyone, I'm fairly new in the web development industry and I need your help with a little problem of mine.
My creation uses data from MySQL, and is a game.
I wish to implement a system of which will add up x resources on a certain interval.
I'll explain it of how I understand it in terms of my script,
for example;
If a user has 0 resources to start, and given the users statistics should be collecting '520' of a resource (Titanium for example.) every hour. I've no idea where to start with this, it's rather important that the current resources variable is stored as a string/in the database.
Can anyone give me a heads up?
Kind Regards,
Lee.
Action after time passed / countdown reaching zero.
Moderator: General Moderators
-
Lee Strong
- Forum Newbie
- Posts: 1
- Joined: Sun Dec 20, 2009 4:31 pm
Re: Action after time passed / countdown reaching zero.
If you're hosting on a Linux server, you could try creating a CRON job that activates a PHP script which adds 520 resources to each active player.
Re: Action after time passed / countdown reaching zero.
This would be the easiest way, although you'll need some sort of onscreen timer to let the play know how long until the next update is.Griven wrote:If you're hosting on a Linux server, you could try creating a CRON job that activates a PHP script which adds 520 resources to each active player.
If you use cPanel this is a good tutorial to look at:
http://www.siteground.com/tutorials/cpa ... n_jobs.htm