Jump to content
  • 0

@events Timer Problem


Question

Posted

Every time i restart server  event timer will become negative
How can i avoid this from happening? That even if i restarted the server, event timer will remain as is and it will not show negative result or a negative time.

 

OnMinute00:
	$EVT_Dice_Timer = gettimetick(2);
	$EVT_Dice = 1;
	if( gettime(3) % 1 != 0 ) end;
	if (.EventStatus) end;
	.EventOnJoin = 1;
	.EventStatus = 1;
	announce "Dice: We are going to have a Dice event.",0;
	sleep 10000;
	announce "Dice: For those who wants to join, use @dice",0;
	sleep 10000;
	announce "Dice: After 1 Minute Event will close.",0;
	sleep 10000;
	announce "Dice: So please if you want to join. use @dice",0;
	initnpctimer;
	end;


OnTimer46000:
	announce "[ Dice ] Event Time's up.",0;
	.EventOnJoin = 0;
	$EVT_Dice = 0;
	$EVT_Dice_Status = 0;
	end;

 

-	script	eventstatus	-1,{

OnAtStatusEvent:
	.@evt_lim_time = $EVT_Dice_Timer + .RunEvery;
	.@evt_cur_time = gettimetick(2);
	.@evt_ent_t = (.@evt_lim_time - .@evt_cur_time);
	.@evt_h = (.@evt_ent_t / 3600);
	.@evt_m = (.@evt_ent_t - (.@evt_h * 3600)) / 60;
	.@evt_s = .@evt_ent_t - ((.@evt_h * 3600) + (.@evt_m * 60));

	mes " [ Event Status ] ";
		if ($EVT_Dice == 0) mes " Dice Event [^FF0000"+.@evt_h+"h "+.@evt_m+"m "+.@evt_s+"s^000000]";
		if ($EVT_Dice == 1) mes " Dice Event [^FF0000"+.@evt_h+"h "+.@evt_m+"m "+.@evt_s+"s^000000]";

	switch(select(
		"Dice Event - " + ($EVT_Dice ? "^FF0000Not Available":"^00FF00Join Event!") + "^000000")) 
	{
	case 1:
		break;
	}
	end;

OnInit:
	bindatcmd "event",strnpcinfo(0)+"::OnAtStatusEvent";
	.RunEvery = 3600; // second
	end;
}

 

6 answers to this question

Recommended Posts

  • 0
Posted
17 minutes ago, Mabuhay said:

That's obviously an event manager script. 

It's quite tedious to do. I will have to think about making a simple one for free. 

i already made like on photo but my only problem the tick timer alwys negative when restart server

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