Jump to content
  • 0

Remaining time goes Negative (-)


kitty14

Question


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.03
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

Help me with this script please.

if it's below 00:00 it becomes -00 : -00 negative. how can i stop it to 00:00 claim prize now?

Payon,161,240,3	script	Playing Game	911,{
		.@last = #lastTimeTalked  + .countdown - gettimetick(2);
		.@days = .@last / 60 / 60 / 24;
		.@hours = .@last / 60 / 60 % 24;
		.@minutes = .@last / 60 % 60;
		.@seconds = .@last % 60;

	mes .@rewname$;
	mes "Sorry you can get the";
	mes "Reward again after ";
	mes ""+.@hours+":"+.@minutes+":"+.@seconds+"!";
	close;
}
if (#lastTimeTalked + .countdown > gettimetick(2)) {
mes .@rewname$;
mes "Hello "+strcharinfo(0)+",I";
mes "am here to give you a daily";
mes "Reward. Do you want to have it?";
next;
switch(select("-Yes,sure!:-No,bye!:-Cancel")) {
	case 1:
	mes .@rewname$;
	mes "Okay going to give you the item!";
	next;
	mes .@rewname$;
	getitem .rewardid,@rewardamount;
	mes "Okay have fun with it!";
	set #lastTimeTalked,gettimetick(2);
	close;
	case 2:
	mes .@rewname$;
	mes "Okay goodbye!";
	close;
	case 3:
	close;
	}
	}

OnInit:
	.countdown = 60 * 60 * 24;
end;
}

 

Edited by kitty14
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   7
  • Joined:  07/17/18
  • Last Seen:  

Maybe something like:

Quote

.@time$ = .@hours+":"+.@minutes+":"+.@seconds;

if(.@hours < 1 && .@minutes < 1 && .@seconds < 1) .@time$ = "Claim your prize!";

mes .@time$;

 

  • Upvote 1
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...