Page 1 of 1

Action after time passed / countdown reaching zero.

Posted: Sun Dec 20, 2009 4:37 pm
by Lee Strong
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.

Re: Action after time passed / countdown reaching zero.

Posted: Sun Dec 20, 2009 4:50 pm
by Griven
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.

Posted: Sun Dec 20, 2009 5:06 pm
by oscardog
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.
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.

If you use cPanel this is a good tutorial to look at:

http://www.siteground.com/tutorials/cpa ... n_jobs.htm :)