Reload script without losing players

Started by Nihongo^, Jul 30, 2023, 02:47 PM

Previous topic - Next topic

Nihongo^

Hy, every time I lose my players, whenever I restart my server from the control panel.

So I found this script in the forum, thinking it would help me to reload the script without losing players

But it gives me an error
case "reload":
if (highestRole.GetLevel() < 2) sendMessage(channels["staffchat"], "You do not have permission to use this command.");
else
  {
::onScriptUnload();
::ReloadScripts()
}
Fu error The index Disconnect SQL: does not exist



Xmair

You have a typo in your code. It is supposed to be DisconnectSQL, not DiscconectSQL

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Nihongo^

Quote from: Xmair on Jul 30, 2023, 04:10 PMYou have a typo in your code. It is supposed to be DisconnectSQL, not DiscconectSQL
Thank you so much, it was a typo error

it reloaded the script, but some function not work like when i type /stats it said Kills doesn't exist any suggest ?


2b2ttianxiu

#4
The reason I don't use the "ReloadScript()" function is because I don't know if it calls functions that handle events (calling events such as onPlayerPart, onPlayerJoin, onPlayerRequestClass and onPlayerSpawn)