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
(https://i.postimg.cc/B6s4BH4Q/Untitled.png)
You have a typo in your code. It is supposed to be DisconnectSQL, not DiscconectSQL
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 ?
https://forum.vc-mp.org/index.php?topic=9251.0
2b2ttianxiu built a similar system!
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)
Quote from: Nihongo^ on Jul 30, 2023, 02:47 PMHy, 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
(https://i.postimg.cc/B6s4BH4Q/Untitled.png)
Bro,I think is easy, just u need split ur script for example: main.nut & main2.nut ,and if u want to reload ur server just let the server dofile("main2.nut"); in fact our problem is that something can't do twice ,if do ,them will make error,so put that script in main.nut , just onServer first start to load that and put other thing in main2.nut ,use dofile we can reload that main2.nut script.
bro wrote in onscriptunload DiscconectSQL he should replace it with DisconnectSQL
its working fine with me