Jump to content

Archived

This topic is now archived and is closed to further replies.

Dogboys

Every hour increase by 10 min...

Recommended Posts

Ok so i want the $manamin to increase its minium by 10 every single hour.

So

(If $manamin >= is lower than $manamax increase $manamin by 10

Share this post


Link to post
Share on other sites
Sounds reasonable. Care to share any code you have? Where/how are these variables stored? Where/how are these variables used?

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.