Jump to content

Question

Posted

Hey everybody,

 

im having some problems with a NPC script, hopefully you could help me.

 

the problem nothing is broadcasted.

 

// -- Announcer Script
// -- Author: DZeroX
// -- Description: Announce whatever you want, easily. You can add as many messages as you want.

-	script	Announcements	-1,{

OnInit:
	setarray $announcer_mes$[0],"Check our website for latest News and Patches, & Vote For Us @ http://and-ro.tk  ´«";
	set $announcer_ticks,10; // -- Replace 300 with seconds, time between individual announcements.
	set $@loop,0;
	set $announcer_wait,$announcer_ticks*120;
	initnpctimer;
	end;

OnTimer1800000:
	set $@messages,getarraysize($announcer_mes$);
	goto L_announce;

L_announce:
	if ($@loop == $@messages) goto L_reset;
	announce $announcer_mes$[$@loop],0;
	sleep2 $announcer_wait;
	set $@loop,$@loop + 1;
	goto L_announce;

L_reset:
	set $@loop,0;
	set $@messages,0;
	stopnpctimer;
	initnpctimer;
	end;

}

 

 

 

 

3 answers to this question

Recommended Posts

Posted
-	script	Announcements	-1,{

OnInit:
	setarray .announcer_mes$[0],"Check our website for latest News and Patches, & Vote For Us @ http://and-ro.tk  ´«";
	set .size_messages, getarraysize( .announcer_mes$ );
	set .announcer_ticks, 10; // in secs -- Replace 300 with seconds, time between individual announcements.
	set .announcer_wait, .announcer_ticks * 1000;
	initnpctimer;
	end;

OnTimer1800000:	// = 1800 secs = 30 mins
	while( .@loop < .size_messages ) {
		announce .announcer_mes$[.@loop], 0;
		sleep .announcer_wait;
		set .@loop,.@loop + 1;
	}
	stopnpctimer;
	initnpctimer;
	end;
}

I cleaned your script a little but it worked for me  /hmm

Check your mapserver maybe you have an error ?

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