Server exports
Custom app storage
Server exports for a small key / value store kept per character for your own app.
Use this store instead of creating a database table for a few settings. See Custom apps.
#SetAppData
Saves a value for a character and an app.
lua---@param identifier string character identifier
---@param app string your app's id, 1 to 40 characters
---@param key string 1 to 64 characters
---@param value any text, a number, a boolean or a table, up to 16 KB as JSON; nil deletes the key
---@return boolean ok
exports['fx-phone']:SetAppData(identifier, app, key, value)
luaexports['fx-phone']:SetAppData(citizenid, 'garage', 'favourite', 'sultan')
- Returns
falsewhen an argument is outside the limits above.
#GetAppDataFor
Returns everything your app saved for a character.
lua---@param identifier string
---@param app string
---@return table<string, any> data empty when nothing is saved
exports['fx-phone']:GetAppDataFor(identifier, app)
lualocal data = exports['fx-phone']:GetAppDataFor(citizenid, 'garage')