Squirrel/Server/Events/Misc/onScriptUnload
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|onScriptUnload}} | |
− | This function is called when a squirrel script is unloaded automatically by the server on shutdown | + | This function is called when a squirrel script is unloaded automatically by the server on shutdown, via manual console input or using the function [[Squirrel/Server/Functions/Scripts/UnloadScript|UnloadScript]]. This event is only called in the script which was unloaded. |
== Syntax == | == Syntax == | ||
Line 6: | Line 6: | ||
<code>function onScriptUnload()</code> | <code>function onScriptUnload()</code> | ||
− | == | + | === Arguments === |
* '''none''' | * '''none''' | ||
+ | |||
+ | === Returns === | ||
+ | |||
+ | This event does not handle return values. | ||
== Example == | == Example == | ||
− | + | This example will print the name of the loaded script to the server console. | |
<code lang="squirrel"> | <code lang="squirrel"> | ||
Line 18: | Line 22: | ||
{ | { | ||
print( "Unloaded LU Test Script" ); | print( "Unloaded LU Test Script" ); | ||
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
+ | |||
+ | === Notes === | ||
+ | |||
+ | The function [[Squirrel/Server/Functions/Misc/print|print]] was used in in this example. More info about this in the corresponding page. | ||
== Related Events == | == Related Events == | ||
{{Squirrel/Server/Events/Misc}} | {{Squirrel/Server/Events/Misc}} |
Revision as of 16:23, 4 November 2010
This function is called when a squirrel script is unloaded automatically by the server on shutdown, via manual console input or using the function UnloadScript. This event is only called in the script which was unloaded.
Syntax
function onScriptUnload()
Arguments
- none
Returns
This event does not handle return values.
Example
This example will print the name of the loaded script to the server console.
function onScriptUnload() { print( "Unloaded LU Test Script" ); return 1; }
Notes
The function print was used in in this example. More info about this in the corresponding page.
Related Events
- onConsoleInput
- onScriptLoad
- onScriptUnload
- onServerStart