Jump to content
  • 0

OnWhisperGlobal:


Question

8 answers to this question

Recommended Posts

Posted

No.

Labels in each NPC object must be unique (this includes your own labels, like L_Menu,

and pre-defined labels like OnWhisperGlobal, OnPCDieEvent, etc).

Could your code be combined into 1 OnWhisperGlobal label in the same NPC?

If they must be separate, then just make 2 NPCs.

Posted (edited)

How about if I use this?

- <tab>script<tab>NPCNAME<tab>-1,{
OnWhisperGlobal:
if (@whispervar0$ == "NPC On") callfunc(OnInit);
OnInit:
<Script>
end;
}

The reason of using OnWhisperGlobal: is to trigger OnInit: function because I don't want to use @reloadscript or restart the server. After digging some thread at here, I found that OnInit: function can be trigger by OnWhisperGlobal: after using @loadnpc command.

And I want to add more call function from using OnWhisperGlobal:

Edited by uDe
Posted

You just put both labels at the beginning of the script,

-	script	NPCNAME	-1,{
OnWhisperGlobal:
OnInit:
// do stuff here

end;
}

then either label will trigger the "do stuff".

Posted (edited)

- <tab>script<tab>NPCNAME<tab>-1,{
OnWhisperGlobal:
if (@whispervar0$ != "NPC On")end;
OnInit:
<Script>
end;
}

or other way

http://rathena.org/b...oninit-trigger/

Looks great..

How to add 1 more call function?

Example :

function TestMenus {

The first one is for trigger the OnInit and then second purpose is to use call/use the another function.

Edited by uDe
Posted

Thank you for helping me and I've found this and it's working :

OnWhisperGlobal:
if (@whispervar0$ == "On") goto L_Menu; else if (@whispervar0$ == "Off") goto L_Menu2;

Just need some tweak a bit on that..

I don't really mind about

set .@whaid,getchaird(3);

So, I think my problems is solve here. Thanks for help Brian & QQfoolsorellina

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