Development mode: hot reload
LS:MP can reload a resource without restarting the server. In server.cfg:
Development=true # never on a public server (it is then removed from the public list)
DevReload=auto # a saved file reloads by itself; manual: announced, then "reload"With manual: reload rlx_shops in the server console (or reload for everything that changed), /reload in F8, or the panel button. These are LS:MP developer commands: they live in the server console and the F8 console only (no script can run them, so /reload in the chat only explains it). Development console: lua @rlx return #lsmp.getPlayers(), clua <player> <code>, /slua in F8.
What RLX does to make it work:
- A reloaded resource (
rlx_shops, yours...): its points, blips, items, hooks, targets, commands go with it and come back when it restarts, as usual. rlxreloaded: each resource using it remembered what it registered and sends it again by itself (points, blips, usable items, hooks, xPlayer methods, commands, targets, F6 actions, jobs, items, accounts...). Characters in game are saved just before, then taken back from the database (rlx:playerResumed, thenrlx:playerLoadedas usual), without respawning. A player who was on the character screen goes back to it.- rlx client part reloaded: the client gets its character back instead of asking for the character screen again.
- During the few milliseconds of the restart, a call to rlx answers
nil, "rlx absent".
For your resource: nothing to do if it goes through RLX.*. If you keep server state tied to players, listen to rlx:playerLoaded (it is emitted on resume too). The local event rlx:replayed (resource name) says a resource has finished sending everything again.