Jump to content
  • 0

Bug Negative Countdown


Takuyakii

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

Hi! i need help for this. 

 

after 24 hours the timer go count again negatively.

 

See pic below. and no error on map.

 

set .Hour,24;
if(gettimetick(2) - #dailytimer < ( .Hour * 3600)) {
mes .@npcname$;


		set .@last,#dailytimer - gettimetick(2);
		set .@hour, .@last % ( 24 * 3600 ) / 3600;
		set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
		set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
		mes "You have to wait for your next delivery.";
		mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
close;
}


mes .@npcname$;
mes "Congrats!";
mes " ";
mes "Here's your reward 1 Activity Point!(s)";
mes "Check your Chat-Log!";
++#activity_points;
dispbottom "You've gained one Activity Point! Your total is ["+#activity_points+"] Activity point(s).";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );

 

bug.png

Edited by Takuyakii
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

if(gettimetick(2) - #dailytimer < ( .Hour * 3600)) {

change to

if(#dailytimer > gettimetick(2)) {

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

If you could post your whole script, i will fix it for you.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.02
  • Content Count:  291
  • Reputation:   26
  • Joined:  12/16/17
  • Last Seen:  

12 hours ago, Takuyakii said:

Hi! i need help for this. 

 

after 24 hours the timer go count again negatively.

 

See pic below. and no error on map.

 


set .Hour,24;
if(gettimetick(2) - #dailytimer < ( .Hour * 3600)) {
mes .@npcname$;


		set .@last,#dailytimer - gettimetick(2);
		set .@hour, .@last % ( 24 * 3600 ) / 3600;
		set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
		set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
		mes "You have to wait for your next delivery.";
		mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
close;
}


mes .@npcname$;
mes "Congrats!";
mes " ";
mes "Here's your reward 1 Activity Point!(s)";
mes "Check your Chat-Log!";
++#activity_points;
dispbottom "You've gained one Activity Point! Your total is ["+#activity_points+"] Activity point(s).";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );

 

bug.png

Post your whole script. We'll fix it for you.

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