Thread: GS2 'cron jobs'
View Single Post
  #4  
Old 05-11-2009, 10:17 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by LoneAngelIbesu View Post
Timeouts are reset each time the weapon is updated, right? Is there any way to prevent this, or would I have to create a separate weapon for the timeout?
There's not really a way to prevent that, but loriel gives a good suggestion.

Quote:
Originally Posted by LoneAngelIbesu View Post
That would defeat the purpose. I don't want the shops to have an endless stock of items at all times.
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.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote