setGameData(...args)

Overview:

Set user game data for the current game and current citizen.

You can save any data of the current game and current citizen to the server and can achieve that data by additional API later. The default compressed flag is true, which means the server will compress data for lower saved data size. You can also customize your compressed data and set compressed = false to save your custom compressed data.

Usage:

client.user.data.setGameData(data: any, compressed = true)
.then((response) => {
    const userGameData = response;
    // write your code here.
})
.catch((error) => {
    // handle error.
})

Requirement:

none

Parameters:

data: any
compressed: boolean. Default: true.

Return:

  • Success:

Promise<IUserGameData>
  • Failed:

error

Error:

500 Internal Server Error

Last updated