Jump to content
  • 0

Bug Negative Countdown


Question

Posted (edited)

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

3 answers to this question

Recommended Posts

  • 0
Posted
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.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...