^iiEcoo'x_) Posted September 12, 2022 Share Posted September 12, 2022 addEventHandler ( 'onResourceStop' , resourceRoot , function ( ) local XmlSave = xmlCreateFile ( 'Xml-Files/Players-Money.xml' , 'root' ) exports [ 'Useful-Functions' ]:outputMessage ( false , 'De-Bug' , '[Money System] : ( Players-Money.xml ) Created' , 0 , 255 , 0 , 3 ) if ( XmlSave ) then local NewChild = xmlCreateChild ( XmlSave , 'Save' ) xmlNodeSetAttribute ( NewChild , 'Table' , toJSON ( Settings [ 'Table' ] [ 'Money' ] ) ) xmlSaveFile ( XmlSave ) end end ) Hi, when resource stopped, xml created and saved. but when server shutdown nothing saved ! so, how i can do the save of xml even the server is shutting down? Link to comment
Tails Posted September 12, 2022 Share Posted September 12, 2022 You have to shut down your server safely with ctrl+c in windows, or shutdown command in the server console. If the server is stopped abruptly, onResourceStop will not be triggered! To avoid losing data in the instance your server crashes, I highly recommend saving important player data such as money every time you update something. Link to comment
^iiEcoo'x_) Posted September 12, 2022 Author Share Posted September 12, 2022 4 hours ago, Tails said: You have to shut down your server safely with ctrl+c in windows, or shutdown command in the server console. If the server is stopped abruptly, onResourceStop will not be triggered! To avoid losing data in the instance your server crashes, I highly recommend saving important player data such as money every time you update something. thanks, done. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now