Jump to content

Save a memo


WiBox

Recommended Posts

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 by #َxLysandeR
Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...