Scripting/Server/Functions/ReloadScripts

Restarts every script as if the server had just started. Runs on the next server tick, not immediately. Every connected player is sent back to the join screen (onPlayerPart runs first, in the old scripts) and rejoins by themselves, so the download window shows again for whatever changed. Then the world is wiped: vehicles, objects, pickups, markers, checkpoints, blips, NPCs, ambient traffic, gang zones, hash tables, timers, cached client files, removed buildings, and the settings a script changed (time, weather, gravity, game speed, rules, server name / password ...) go back to their start values; the VM is recreated and LU/content.xml is read again. The server console command reload_scripts does the same.

Syntax

ReloadScripts()

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "reloadscripts" )
	{
		ReloadScripts();
	}
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Server information and administration

Categories: Server functions | Server information and administration