Jump to content

Question

Posted

i need a NPC script that

*Only GMs can access the NPC*

*Menu (Announce,Nothing)

*onAnnounce = Broadcast the typed Message every 30 mins*(configurable)

*onAnnounce(Again) = removed previous Annouce and Broadcast the new announced message

thanks thats it for now..

 

 

 

2 answers to this question

Recommended Posts

  • 0
Posted
25 minutes ago, celeron0134 said:

i need a NPC script that

*Only GMs can access the NPC*

*Menu (Announce,Nothing)

*onAnnounce = Broadcast the typed Message every 30 mins*(configurable)

*onAnnounce(Again) = removed previous Annouce and Broadcast the new announced message

thanks thats it for now..

 

 

 

I don't know why you want to make a script instead of manually doing /lb command.

but try this: (Not tested)

https://github.com/pajodex/ScriptCollections/blob/master/gmannouncer.txt

  • 0
Posted
22 hours ago, pajodex said:

I don't know why you want to make a script instead of manually doing /lb command.

but try this: (Not tested)

https://github.com/pajodex/ScriptCollections/blob/master/gmannouncer.txt

// GM Announcer
// By pajodex
-	script	GMAnnouncer	-1,{
OnResetAnnounce:
OnAtCmd:
	if(select("Announce:Nothing") == 2 ) close;
		mes "What messaage to announce?";
		input .@announce$;
		next;
		mes "Announce: "+.@announce$+" ?";
		if(select("Yes:No") == 2) callsub OnResetAnnounce;
			.announce$ = .@announce$;
			mes "Announce Interval? (in minutes)";
			mes "- How many times will the broadcast be repeated?";
			input .@interval;
			next;
			mes "Are you sure broadcast interval will be every "+.@interval+" mins?";
			if(select("Yes:No") == 2) callsub OnResetAnnounce;
				.interval = .@interval;
				donpcevent strnpcinfo(3)+"::OnAnnounce";
				mes "Done!";
				close;
			
OnAnnounce:
	announce .announce$, 0;
	initnpctimer;
	end;
	
OnTimer60000:
	.timer++;
	if(.interval == .timer) {
		announce .announce$, 0;
		.timer = 0;
		end;
	}
	setnpctimer 0;
	end;
	
OnInit:
	.interval = 0;
	.announce$ = "";
	.timer = 0;
	bindatcmd "gmbroadcast",strnpcinfo(3)+"::OnAtCmd",0,60;
	end;
}

i think its working.. i fixed some typos tho.. "+.@interval+" and the OnTimer60000:

thank you again pajodex for the fast replies and for helping us newbies thanks alot more power

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