Thread: GS2 'cron jobs'
View Single Post
  #6  
Old 05-11-2009, 10:34 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Tigairius View Post
I think what Loriel means is, save a timevar2 each time the shop is restocked, then each time someone enters the shop, subtract the saved timevar2 from the current timevar2, if it's > 86400 (24 hours), then divide the result by 86400 and it will give you how many days have passed since the last restock. Then you can stock based on that data. It's probably the best way to approach it.
Or you can just do serverr.restocktime = timevar2 + 86400 then if (timevar2 >= serverr.restocktime) restock().
__________________
Reply With Quote