Jump to content
  • 0
Sign in to follow this  
penwilders

help with broadcaster npc

Question

this is my script of my broadcaster npc

 

 
prontera,146,169,5 script Broadcaster 114,{
//what's the npc name to show in messages?
set @npcname$, "Broadcaster";
//NPC Headers Name:
set @header$,"[^0000ff" + @npcname$ + "^000000]";
//NPC COST PER Broadcast:
set @broadcastfee, 5000000;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mes @header$;
mes "Hi, I'm the Broadcaster";
mes "I can Broadcast a message for you";
next;
mes @header$;
mes "It costs 5 Million Zeny ";
next;
mes @header$;
mes "Would you like to Broadcast?";
switch (select("Yes","No")){
case 1:
if(@Broadcast> gettimetick(2)) {
next;
mes @header$;
mes "Sorry you have to wait for 3 minutes.";
close;
}
next;
mes @header$;
if(Zeny<5000000) goto noZenybc;
set Zeny, Zeny - @broadcastfee;
mes "Please input your message.";
next;
input @broadcast$;
announce "Message from "+strcharinfo(0)+": "+@broadcast$+"",0,0x00FFFF;
close2;
set @Broadcast, gettimetick(2)+180;
dispbottom "Broadcaster: Please wait for 3 minutes until next broadcast to avoid flooding.";
end;
case 2:
mes "Suit yourself";
close;
}
noZenybc:
mes "I have to check that you have";
mes "enough money";
next;
mes @header$;
mes "Im sorry but you don't have enough Zeny";
mes "Go get it if you want to Broadcast";
close;
}
 
 
 
but once you relog you can broadcast again. i want 1 char/account/ only to broadcast for every 3 mins to avoid flooding/spamming
 
thanks in advance

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

^Hi simple replace 

@Broadcast

to

$Broadcast

Note:

"@"      - A temporary variable attached to the character.            They disappear when the character logs out."$"      - A global permanent variable.            They are stored in database table `mapreg`.

for more information about variables visit Variables

Share this post


Link to post
Share on other sites
  • 0

Change all :

@Broadcast

to :

Broadcast // character variable#Broadcast // account variable

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.