Reply
Help with scripting
Old 02-08-2003, 12:32 AM Help with scripting
Junior Talker

Posts: 4
Location: malaysia
I need a simple PHP script that add 1 point to player every hours.

Define max limit so points can't exceed certain value. Example if 100 points, the counter will stop after reaching 100 points.

Thanks for help

Cheers
__________________
What's this??
Dqur is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 02-08-2003, 01:54 AM
Mo Money's Avatar
Extreme Talker

Posts: 229
Location: Cali
hmm, could you elaborate some more on this, I am assuming you mean one of those online games where you get points from hits right?
__________________
AbcArcade.com - Free Internet Games!
Mo Money is offline
Reply With Quote
View Public Profile Visit Mo Money's homepage!
 
Old 02-08-2003, 04:49 AM
Junior Talker

Posts: 4
Location: malaysia
It's just some bonus points given to each registered player.
This points added to the total points available in their account.
__________________
What's this??
Dqur is offline
Reply With Quote
View Public Profile
 
Old 02-09-2003, 09:20 AM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
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.
__________________
Free Webmaster Help - Everything a webmaster needs - for free
Free-Webhosting.info - Free web hosts reviewed and rated
Web Hosting Hunt - Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile Visit david's homepage!
 
Reply     « Reply to Help with scripting
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12675 seconds with 13 queries