Jump to content
  • 0

Day Countdown?


Echoes

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  155
  • Reputation:   6
  • Joined:  03/30/13
  • Last Seen:  

Hello!

 

Well, in simple works, is there a way to make a day counter?

In my script, I have to do a task to be able to proceed in a quest, and then I can speak freely to this NPC, but if 2 days have passed after completing the task, I will need to do it again.

 

I can't think an easy way to do this script :C

 

Please help! Thanks in advance.

Edited by Echoes
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   13
  • Joined:  06/20/12
  • Last Seen:  

Save in a char/account permanent variable the time he first spoke with the npc. And add a check too see if (now) > ( first_spoke + 60 * 60 * 24 ) { // repeat quest }

I don't remember the command that return unix time, check the scripts doc.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  155
  • Reputation:   6
  • Joined:  03/30/13
  • Last Seen:  

Thanks.

 

Yes, I will check it now. Thanks for the reply.

 

 

And I think that command is gettimetick(2), 2 stands for " The system time in UNIX epoch time, or the number of seconds elapsed since January 1st, 1970. Useful for reliably measuring time intervals."

 

____

EDIT

____

It worked :D, thank you Moriarty !

Edited by Echoes
Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...