Forum Moderators: coopster

Message Too Old, No Replies

Variables

         

TheDarkAvenger

1:59 pm on Jul 24, 2005 (gmt 0)

10+ Year Member



Hey again,

This is what I would like to achieve and I will try to expain this a best as possible:

Firstly, I want to explain what I am doing in order to help me explain and hopefully help you to assist me. I am making an RPG and I am currently working on a "Job Center". Basically you have a list of jobs and their minute-ly wage, all read from table `jobs`. The user has to type how many minutes they want to work for and then click a job which redirects to "startwork.php" and starts a sleep timer.[Sleep($var for how many minutes they want to work in seconds?!)]. Then the code changes a value in `character` to "1" which means the person is working and cannot access anything. Then I want a variable that multiplies the inputted text by a predefined "wage"(in db `jobs`) and then saves the outcome to db `character` in column `wage`. Then I after the sleep timer has finished the "1" changes to "0" and everything is back to normal. The user then has to go to the bank to transfer their wages into their bank account.

If anyone can help I would greatly appreciate it!

Thank You

mcibor

9:59 pm on Jul 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But what is the question?

To do that "working" you can't simply wait for some period of time.
Instead place in db a finish datetime and simply check if the time is before or after now. If the time in db is in the future, the character is working still, otherwise he finished his work.

Hope this helps you a bit to start
Michal Cibor