Scripting/Server/Functions/UnloadScript
(v0.4.6+) Takes a loaded script folder out again: the event handlers and global functions / variables / classes it defined, the timers it started and the vehicles, objects, pickups, markers, blips, NPCs and gang zones its top-level code created while loading are removed; its custom content leaves the download list (the players rejoin). Things a handler created later while the script ran, and values other scripts copied out of it, stay. Returns false when the folder is not loaded. Console: unload_script <folder>.
Syntax
UnloadScript("Folder")Arguments
- any "Folder"
Returns
bool
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "unloadscript" )
{
local result = UnloadScript( 0 );
MessagePlayer( "UnloadScript returned: " + result, player );
}
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- SetServerName
- SetPassword
- SetServerRule
- RemoveBuildingForPlayer
- SyncPlayerSkins
- ReloadScripts
- LoadScript
- GetScripts
- ToggleRagdollPhysics
- ToggleVehicleDents
- LoadModule
- GetTickCount
Section: Server information and administration
Categories: Server functions | Server information and administration