Jump to content

Every hour increase by 10 min...


Dogboys

Recommended Posts

[!--quoteo(post=375831:date=May 21 2006, 01:14 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 21 2006, 01:14 PM) [snapback]375831[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Sounds reasonable. Care to share any code you have? Where/how are these variables stored? Where/how are these variables used?
[/quote]

Well i was wondering if you could just convert it to a proper php code instead of my phony version of it.


Well variables are stored into a database.

Well my part of a script for the part the variable is used...


if ($usepoints==true) {
if ($userrow["$manamin"] < $townrow["$manacost"]) {
display("You dont have enough mana..", "Travel To"); die();

Im sorry if they script is wrong im no good at php.
Link to comment
Share on other sites

too general, but here's some algo you can use:
1. keep track of starting time, store it on DB
2. convert to timestamp and check difference of current time and starting time
3. if less than 1 hour, skip update
4. if more than or equal to 1 hour, increase value by 10, set starting time to current time, then update the fields on the database

Link to comment
Share on other sites

As you can see, it's exactly the same problem and solution as the previous one that you posted.

[a href=\"http://www.phpfreaks.com/forums/index.php?s=&showtopic=93883&view=findpost&p=375705\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=375705[/a]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.