|
There are really two ways you could do this. Firstly you could set up a chron job that ran a PHP script every hour. This would then add one point to each player that hour. Its probably a bit of overkill to do this, though, so I would suggest that instead your logon script (or even your points display script) would calculate extra points each time it's run.
Assuming you are using a database, you would store the time of the script being run. Then, the next time the script was run (when the user logs in again) you would compare this with the current date/time and do a quick calculation to find how many hours have passed. Then you would add the appropriate number of points, and set the database time to the current time/date.
This is probably the best method to use as it is less resource intensive and makes checking numbers of points added etc. very easy.
|