• 0
cder

Using OnClock in my custom event

Question

Well, I'm scheduling an event, and I want to use this command correctly ... the result I'm looking for is that the command executes the "annouce" command every time it arrives at Midnight (00:00 AM)

 

Edited by cder

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
OnClock0000:
	announce "your message", bc_all;
end;

 

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
23 hours ago, dev LOOLP said:
OnClock0000:
	announce "your message", bc_all;
end;

 

Thanks again, although I can't understand the use of "bc_all", but I will check and anything is already "MVP" and close the topic ...

Share this post


Link to post
Share on other sites
  • 0

@dev LOOLP

 

I waited until 00:00 and it didn't work, can you take a look at my script? Well, the event is something that I'm creating so that the players on my server are only allowed to play 5 hours a day on my server. .

 

Script:

 

-	script	penalidadeconometrada	-1,{

//86400000 // 1 dia
//18000000  // 5 horas
//3600000 // 1 hora
//60000 // 1 minuto
//1000 // 1 segundo

// ADD TIMER

OnClock0000:

set CHARHMC, CHARHMC = 4;
set CHARMMC, CHARMMC = 59;
set CHARSMC, CHARSMC = 59;
set VerifiqueEventMC, VerifiqueEventMC = 0;
set CallCidadeEventMC, CallCidadeEventMC = 0;
announce "A Maldição do Conometro Foi Removida...", bc_all;
end;

OnPCLoginEvent:

if(PenalidadeConometrada < 1){
PenalidadeConometrada++;
set CHARHMC, CHARHMC = 4;
set CHARMMC, CHARMMC = 59;
set CHARSMC, CHARSMC = 59;
addtimer 3600000, strnpcinfo(3) + "::OnHoras";
addtimer 60000, strnpcinfo(3) + "::OnMinutos";
addtimer 1000, strnpcinfo(3) + "::OnSegundos";
addtimer 1000, strnpcinfo(3) + "::OnVerifiqueEvent";
end;
}
else
addtimer 3600000, strnpcinfo(3) + "::OnHoras";
addtimer 60000, strnpcinfo(3) + "::OnMinutos";
addtimer 1000, strnpcinfo(3) + "::OnSegundos";
addtimer 1000, strnpcinfo(3) + "::OnVerifiqueEvent";
end;

// Labels ADDTIMER

OnHoras: // Hours
if (CHARHMC > 0){
CHARHMC--;
deltimer strnpcinfo(3) + "::OnHoras";
addtimer 3600000, strnpcinfo(3) + "::OnHoras";
end;
	}
	else
	deltimer strnpcinfo(3) + "::OnHoras";
	addtimer 3600000, strnpcinfo(3) + "::OnHoras";
	end;

OnMinutos: // Minutes

if (CHARHMC == 0 && CHARMMC == 0 && CHARSMC == 0){
deltimer strnpcinfo(3) + "::OnMinutos";
addtimer 60000, strnpcinfo(3) + "::OnMinutos";	
}
else
	if (CHARMMC < 0){
	set CHARMMC, CHARMMC = 59;
	deltimer strnpcinfo(3) + "::OnMinutos";
	addtimer 60000, strnpcinfo(3) + "::OnMinutos";
	end;
		}
		else
		CHARMMC--;
		deltimer strnpcinfo(3) + "::OnMinutos";
		addtimer 60000, strnpcinfo(3) + "::OnMinutos";
		end;
		
OnSegundos: // Seconds

if (CHARHMC == 0 && CHARMMC == 0 && CHARSMC == 0){
set VerifiqueEventMC, VerifiqueEventMC = 1;
deltimer strnpcinfo(3) + "::OnSegundos";
addtimer 1000, strnpcinfo(3) + "::OnSegundos";	
}
else
	if (CHARSMC < 0){
	set CHARSMC, CHARSMC = 59;
	deltimer strnpcinfo(3) + "::OnSegundos";
	addtimer 1000, strnpcinfo(3) + "::OnSegundos";
	end;
		}
		else
		CHARSMC--;
		deltimer strnpcinfo(3) + "::OnSegundos";
		addtimer 1000, strnpcinfo(3) + "::OnSegundos";
		end;
	
OnVerifiqueEvent: // A cada 1 segundo online verifica se está com CallCidadeEventMC e OnVerifiqueEventMC Ligado == 1
if (CallCidadeEventMC == 1){
	deltimer strnpcinfo(3) + "::OnVerifiqueEvent";
	addtimer 1000, strnpcinfo(3) + "::OnVerifiqueEvent";
	end;
	}
	else
		if (VerifiqueEventMC == 1){
		CallCidadeEventMC++;
		warp "genese",214,168;
		deltimer strnpcinfo(3) + "::OnVerifiqueEvent";
		addtimer 1000, strnpcinfo(3) + "::OnVerifiqueEvent";
		end;
		}
		else
		deltimer strnpcinfo(3) + "::OnVerifiqueEvent";
		addtimer 1000, strnpcinfo(3) + "::OnVerifiqueEvent";
		end;
}

 

Share this post


Link to post
Share on other sites
  • 0

There are a lot of errors regarding the use of the variables of how you are using it!

I recommend that you make a request for someone to make in script request.

Share this post


Link to post
Share on other sites
  • 0
12 hours ago, Hyroshima said:

There are a lot of errors regarding the use of the variables of how you are using it!

I recommend that you make a request for someone to make in script request.

I created recently, but there are no "Various Errors", of course I'm not saying that there is no error, but "Various" also does not 🙂 I will ask for support there ...

Share this post


Link to post
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.

Loading...