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

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

  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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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