Nasal library: Difference between revisions

Jump to navigation Jump to search
(→‎rand(): Basic doc for registerFlightPlanDelegate(). More doc will be added to Nasal Flightplan in future)
Line 1,958: Line 1,958:


=== removecommand() ===
=== removecommand() ===
As you can guess, there's also a removecommand() function which will remove '''any''' command – even those implemented in C++! As such it can be very dangerous and remove core functionality, so use with caution.
{{Nasal doc
|syntax = removecommand(cmd);
|source = {{flightgear file|src/Scripting/NasalSys.cxx|l=668|t=Source}}
|text =
 
{{caution{{!}}1{{=}}This will remove '''any''' [[fgcommands{{!}}fgcommand]], even those implemented in C++, so use with caution!}}
Returns <code>'''nil'''</code>.
|param1 = cmd
|param1text = String specifying the name of the command to remove.
|example1 = addcommand("hello", func(){
    print("Hello");
});
fgcommand("hello"); # "Hello" will be printed
removecommand("hello"); # removes it
}}


=== removelistener() ===
=== removelistener() ===

Navigation menu