Squirrel/Server/Events/Misc/onScriptUnload

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|onScriptUnload}}
This function is called when a squirrel script is unloaded automatically by the server on shutdown or via manual console input.
+
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>
  
== Parameters ==
+
=== Arguments ===
  
 
* '''none'''
 
* '''none'''
 +
 +
=== Returns ===
 +
 +
This event does not handle return values.
  
 
== Example ==
 
== Example ==
  
When the script is unloaded, the name of the script is printed to the server console.
+
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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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

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

  1.  
  2. function onScriptUnload()
  3. {
  4. print( "Unloaded LU Test Script" );
  5. return 1;
  6. }
  7.  

Notes

The function print was used in in this example. More info about this in the corresponding page.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox