Jump to content

Command Expire time


sjizzle
 Share

Recommended Posts

Hello,

When I want a command to be used only ones within 2 days, what is the best way to do this?

I created a extra table:

`Time_of_Usage` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Absolute start date, the command was used'

I used:

time_t currenttime = sWorld.GetGameTime();

time_t now = time(NULL);

I do not exactly know how to get the time? Which is best and what the values really mean.

Also how do I add 48 hours to the variable now or cuttentime ?

Next to that, how do I check if it passed 2 days, so the command can be used again?

Any help is welcome.

Link to comment
Share on other sites

 Share

×
×
  • 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. Privacy Policy Terms of Use