Login & Authentication
Login
Login a player to the server with their character data.Player server ID
Citizen ID for existing character
New character data if creating a character
true if login was successful, false otherwiseLogout
Logout a player and save their data.Player server ID
Offline Player Management
GetOfflinePlayer
Get a player object for an offline player by citizen ID.The citizen ID of the offline player
Player object if found in database, otherwise
nilJob Management
SetJob
Set a player’s primary job, replacing their current primary job.Player source or citizen ID
Name of the job to set
Job grade level (defaults to 0)
true if job was set successfullyError details if the operation failed
SetJobDuty
Set a player’s on-duty status for their job.Player source or citizen ID
Whether the player should be on duty
AddPlayerToJob
Add a player to a job or update their grade if already in the job.Player’s citizen ID
Job name to add player to
Job grade (defaults to 0)
true if player was added successfullyError details if the operation failed
RemovePlayerFromJob
Remove a player from a job. If it’s their primary job, sets primary to unemployed.Player’s citizen ID
Job name to remove player from
true if player was removed successfullyError details if the operation failed
SetPlayerPrimaryJob
Set a player’s primary job (must already have the job).Player’s citizen ID
Job name to set as primary
true if primary job was setError details if the operation failed
Gang Management
SetGang
Set a player’s primary gang, replacing their current primary gang.Player source or citizen ID
Name of the gang to set
Gang grade level (defaults to 0)
true if gang was set successfullyError details if the operation failed
AddPlayerToGang
Add a player to a gang or update their grade if already in the gang.Player’s citizen ID
Gang name to add player to
Gang grade (defaults to 0)
true if player was added successfullyError details if the operation failed
RemovePlayerFromGang
Remove a player from a gang. If it’s their primary gang, sets primary to ‘none’.Player’s citizen ID
Gang name to remove player from
true if player was removed successfullyError details if the operation failed
Player Data Management
SetPlayerData
Set a player data field.Player source or citizen ID
Data field name
Value to set
UpdatePlayerData
Trigger a player data update sync to client.Player source or citizen ID
SetMetadata
Set a metadata field for a player.Player source or citizen ID
Metadata field name (supports dot notation for nested fields)
Value to set
GetMetadata
Get a metadata field from a player.Player source or citizen ID
Metadata field name (supports dot notation)
The metadata value
SetCharInfo
Set a character info field.Player source or citizen ID
Character info field name
Value to set
Money Management
AddMoney
Add money to a player’s account.Player source or citizen ID
Type of money:
'cash', 'bank', 'crypto'Amount to add
Reason for the transaction (for logging)
true if money was added successfullyRemoveMoney
Remove money from a player’s account.Player source or citizen ID
Type of money:
'cash', 'bank', 'crypto'Amount to remove
Reason for the transaction (for logging)
true if money was removed successfullySetMoney
Set a player’s money to a specific amount.Player source or citizen ID
Type of money:
'cash', 'bank', 'crypto'Amount to set
Reason for the transaction (for logging)
true if money was set successfullyGetMoney
Get the amount of money a player has.Player source or citizen ID
Type of money to check
Amount of money, or
false if money type doesn’t existSave Functions
Save
Save an online player’s data to the database.Player server ID
SaveOffline
Save an offline player’s data to the database.Player data object to save