Jump to content
  • 0

NPC Problems


acocalypso

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   0
  • Joined:  06/15/12
  • Last Seen:  

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;

}

 

 

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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

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