WiBox Posted July 29, 2018 Share Posted July 29, 2018 Hey, I made a panel with an memo.. But if I restart the script, what was written on that memo will disappear so is there a way I can save an memo even if I restart the script? Link to comment
itHyperoX Posted July 29, 2018 Share Posted July 29, 2018 i think you can with onClientResourceStop, setElementData / getElementData, or just with a simple Table Link to comment
WiBox Posted July 29, 2018 Author Share Posted July 29, 2018 Sorry but I didn't understand anything from what you said.. If you can give a small example it would help a lot, as I understand you said, I can use a table to save inside it, how is it possible? Link to comment
SycroX Posted July 29, 2018 Share Posted July 29, 2018 (edited) the easiest way is to save it by using setAccountData / getAccountData on Console's account or u can just use mysql if u've some experience in it i don't recommend to use the tables because if u restart the resource all the data in the table will gone ( unless u have some experience in creating files so u can save the table by creating a file and exporting all the data in the table to the file and then when the resource start u can import it again and insert it to the table etc.. ) Edited July 29, 2018 by #َxLysandeR Link to comment
WiBox Posted July 29, 2018 Author Share Posted July 29, 2018 (edited) To be honest you didn't help me with anything, I know what the functions needed I just don't know how to use them... Edited July 29, 2018 by SSKE Link to comment
SycroX Posted July 29, 2018 Share Posted July 29, 2018 what's the difficult in this ?? addCommandHandler("saveMemo", function() local text = guiGetText(yourMemo) if text and text ~= "" then triggerServerEvent("saveMyMemo", localPlayer, text) end end ) --#server addEvent("saveMyMemo", true) addEventHandler("saveMyMemo", root, function(text) setAccountData(getAccount("Console"), "memo", text) end ) idk if it's possible to use setAccountData on console's account but if it didn't work you can create a specific account for this stuffs 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