Jump to content
  • 0

Daily Reward


Jyabil

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  89
  • Reputation:   7
  • Joined:  02/27/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  89
  • Reputation:   7
  • Joined:  02/27/12
  • Last Seen:  

Thanks Zero,

Will be trying this when I got home.

Do you also mind helping me on this topic?

http://rathena.org/board/topic/63860-team-deathmatch/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  89
  • Reputation:   7
  • Joined:  02/27/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  89
  • Reputation:   7
  • Joined:  02/27/12
  • Last Seen:  

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