Jump to content
  • 0

Broadcasting NPC. Cant seem to work


Kiritoryu

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   0
  • Joined:  12/13/12
  • Last Seen:  

This is the broadcaster npc but cant seem to work when i whisper to it? Any help?

mes "[broadcaster]";
mes "Hello "+strcharinfo(0);
mes "If you want to broadcast some messages,";
mes "type ^ff0000NPC:Broadcaster^000000 in the";
mes "Whisper Box, then type ^ff0000Global#<Text>^000000, or ^ff0000Map:<Text>^000000";
mes "in the Text Box.";
next;
mes "[broadcaster]";
mes "Example:";
mes "[WhisperBox:] NPC:Broadcaster";
mes "[TextBox:] Global#Hi Guys!";
mes "";
mes "The message 'Hi Guys' will be";
mes "announced to everyone on the Server.";
mes "If I had put 'Map' instead of 'Global'";
mes "the message would be announced to the";
mes "current Map your on.";
next;
mes "[broadcaster]";
mes "A Global Broadcast costs "+$global_price+" Zeny.";
mes "A Map Broadcast costs "+$map_price+" Zeny.";
close;
}
- script Broadcaster -1,{
   end;OnInit:
set $map_price,75000;
set $global_price,150000;
end;
OnWhisperGlobal:
if(@whispervar0$ == "Global") {
if(@whispervar1$ != "") {
 if(Zeny < $global_price) dispbottom "You don't have enough Zeny."; end;
 set Zeny, Zeny - $global_price;
 announce "(From "+strcharinfo(0)+"): "+@whispervar1$+"",bc_yellow;
 end;
} else {
 announce "You didn't put a message.",bc_self|bc_red;
 end;
}

} else if(@whispervar0$ == "Map") {
if(@whispervar1$ != "") {
 getmapxy(@mapn$,@mapx,@mapy,0);
 if(Zeny < $map_price) dispbottom "You don't have enough Zeny."; end;
 set Zeny, Zeny - $map_price;
 mapannounce @mapn$,"(From "+strcharinfo(0)+"): "+@whispervar1$+"",bc_yellow;
 end;
} else {
 announce "You didn't put a message.",bc_self|bc_red;
 end;
}
}
}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


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

/bo

prontera,150,150,5    script    Broadcaster    456,{
   mes "[broadcaster]";
   mes "Hello "+strcharinfo(0);
   mes "If you want to broadcast some messages,";
   mes "type ^ff0000NPC:Broadcaster^000000 in the";
   mes "Whisper Box, then type ^ff0000Global#<Text>^000000, or ^ff0000Map:<Text>^000000";
   mes "in the Text Box.";
   next;
   mes "[broadcaster]";
   mes "Example:";
   mes "[WhisperBox:] NPC:Broadcaster";
   mes "[TextBox:] Global#Hi Guys!";
   mes "";
   mes "The message 'Hi Guys' will be";
   mes "announced to everyone on the Server.";
   mes "If I had put 'Map' instead of 'Global'";
   mes "the message would be announced to the";
   mes "current Map your on.";
   next;
   mes "[broadcaster]";
   mes "A Global Broadcast costs "+.global_price+" Zeny.";
   mes "A Map Broadcast costs "+.map_price+" Zeny.";
   close;

OnInit:
   set .map_price,75000;
   set .global_price,150000;
   end;

OnWhisperGlobal:
   if(@whispervar0$ == "Global") {
       if(@whispervar1$ != "") {
           if(Zeny < .global_price) { dispbottom "You don't have enough Zeny."; end; }
           set Zeny, Zeny - .global_price;
           announce "(From "+strcharinfo(0)+"): "+@whispervar1$+"",bc_yellow;
       } else
           announce "You didn't put a message.",bc_self|bc_red;
       end;

   } else if(@whispervar0$ == "Map") {
       if(@whispervar1$ != "") {
           getmapxy(@mapn$,@mapx,@mapy,0);
           if(Zeny < .map_price) { dispbottom "You don't have enough Zeny."; end; }
           set Zeny, Zeny - .map_price;
           mapannounce @mapn$,"(From "+strcharinfo(0)+"): "+@whispervar1$+"",bc_yellow;
       } else
           announce "You didn't put a message.",bc_self|bc_red;
       end;
   }
   end;
}

Doc whisper system :

http://svn.rathena.org/svn/rathena/trunk/doc/whisper_sys.txt

and it's working ;)

  • Upvote 1
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...