Jump to content

setElementData


ChisleLP

Recommended Posts

Hello...

 

I have one question...

 

It's this normal? every time if i restart the server, it my "SetElementData" gone. Example I set myself an ElementData Phone number. After server Restart, it's it gone... 

This below its a example and running on Server side.

setElementData(thePlayer, "Phone", "12388282")

 

Thanks

Link to comment

Are you saving it?

if not, you have to save it.

 

local phoneNumber = getElementData(thePlayer, "Phone")
if phoneNumber then

       setAccountData(getPlayerAccount(thePlayer), "playerAccount:Phone", phoneNumber)

end



--then load it when player login.

local phoneNumber = getAccountData(getPlayerAccount(thePlayer), "playerAccount:Phone")

if phoneNumber then

     setElementData(thePlayer, "Phone", tonumber(phoneNumber))

end

 

Edited by TheMOG
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...