Jump to content

setSerialData/getSerialData


Leo Messi

Recommended Posts

Hello, I am suggesting to add setSerialData/getSerialData.

How it will work?

Example

function registerPlayer(player, cmd, account, password)

    local plrSerial = getPlayerSerial(player)

    setSerialData(plrSerial, "accountsRegistered", 1)

    triggerEvent("accounts.register", localPlayer, account)

end

addCommandHandler("register", registerPlayer) -- A function for test..

 

function accountRegister(player, account, password)

     if getSerialData(getPlayerSerial(player), "accountsRegistered") == 1 then

       outputChatBox("You already registered an account before!", player, 255, 0, 0)

      return

    end

   addAccount(getAccount(account), password)

   outputChatBox("You successfully registered an account in our server!", player, 0, 255, 0)

end

addEvent("accounts.register", true)

addEventHandler("accounts.register", root, accountRegister)

 

I hopefully this one gets added as it will be very useful/easier to all developers, Thank you for your time!

 

 

Link to comment
  • Recently Browsing   0 members

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