Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 4
Location: malaysia
Trades: 0
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
 
 
Register now for full access!
Old 02-08-2003, 02:54 AM
Mo Money's Avatar
Extreme Talker

Posts: 229
Location: Cali
Trades: 0
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?
__________________

Please login or register to view this content. Registration is FREE
- Free Internet Games!
Mo Money is offline
Reply With Quote
View Public Profile
 
Old 02-08-2003, 05:49 AM
Junior Talker

Posts: 4
Location: malaysia
Trades: 0
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, 10:20 AM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
- Everything a webmaster needs - for free

Please login or register to view this content. Registration is FREE
- Free web hosts reviewed and rated

Please login or register to view this content. Registration is FREE
- Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with scripting
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.30676 seconds with 12 queries