Jump to content
  • 0
Jyabil

Daily Reward

Question

Based on this topic,

http://rathena.org/b...ard-npc-script/

But instead of waiting for 24 hours to get the rewards again from the NPC,

It just resets on 00:00 time, so the player can get his reward between 00:01 to 23:59 (Server Time)

Thanks and regards,

Jyabil

Edited by Jyabil
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

// Check Value Against Stored Value
if (gettimestr("%Y-%m/%d") == lastTimeTalked$) {
 mes "You have already talked to me today";
 close;
}

// Do NPC Dialog

// Store as a String (YearMonthDay)
set lastTimeTalked$, gettimestr("%Y-%m/%d");

// Do Whatever Else Dialog

// You do not need to worry about time changing, because it's already dependent on the year/month/day
// when the date changes, the variable changes

// If you would like this be a PER ACCOUNT, instead of PER CHAR, simply change the lastTimeTalked$ to #lastTimeTalked$

// Enjoy

Link to comment
Share on other sites

I'm having errors on ("%Y-%m/%d")

Can you also include the minute? So I can test it if the minute changes, then if its working, i'll remove the minute and stick with the days.

Thanks

Link to comment
Share on other sites

mes (test$ != gettimestr("%m",4))?"Minute changes.":"Minute doesn't change.";
close2;
set test$, gettimestr("%m",4);
end;

Link to comment
Share on other sites

I don't get it, not familiar with the gettimestr function.

I just wanted it to reset at 00:00 server time.

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.