Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Nihongo^ on Jul 30, 2023, 02:47 PM

Title: Reload script without losing players
Post by: Nihongo^ on Jul 30, 2023, 02:47 PM
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)
Title: Re: Reload script without losing players
Post by: Xmair on Jul 30, 2023, 04:10 PM
You have a typo in your code. It is supposed to be DisconnectSQL, not DiscconectSQL
Title: Re: Reload script without losing players
Post by: Nihongo^ on Jul 30, 2023, 05:31 PM
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 ?
Title: Re: Reload script without losing players
Post by: PSL on Jul 31, 2023, 02:29 PM
https://forum.vc-mp.org/index.php?topic=9251.0
2b2ttianxiu built a similar system!
Title: Re: Reload script without losing players
Post by: 2b2ttianxiu on Aug 11, 2023, 01:12 AM
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)