UnloadScript

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function will unload a script folder. Note that the script folder you wish to unload should be placed in the Scripts/ folder of your server.

Syntax

  1. bool UnloadScript( string scriptName )

Arguments

  • scriptName - The name of the script folder

Example

This example will unload the scripts specified in Script.xml in Scripts/SomeScript when someone types /unload.

  1.  
  2. function onPlayerCommand( id, cmd, text )
  3. {
  4. if ( cmd == "unload" )
  5. {
  6. UnloadScript( "SomeScript" );
  7. Message( "SomeScript unloaded!" );
  8. }
  9. return 1;
  10. }
  11.  

Notes

The function Message and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Unloading a script within a script will cause a crash. Likewise, unloading a script using CallFunc with a function which unloads the original script will also cause a crash.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox