Player Functions
SERVER SIDE ONLY
These functions operate directly on the player's class and are accessible from any codebase using FiveM's exports.
Accounts
get_accounts
Use the following to retrieve all accounts the player holds.
get_account
Use the following to retrieve a specific account the player holds by given account type.
add_balance
Use the following to add balance to an account the player holds.
remove_balance
Use the following to remove balance from an account the player holds.
add_account
Use the following to add a new account to the players accounts.
Accounts must be defined in accounts.json in order to be added.
remove_account
Use the following to remove an account from the players accounts.
Identity
get_full_name
Use the following to retrieve a formatted version of the players full name.
change_name
Use the following to change a players name.
set_profile_picture
Use the following to set a new profile picture for the player.
Inventory
get_inventory
Use the following to retrieve the players inventory.
get_items
Use the following to get all items in the players inventory.
get_item
Use the following to get an item the player has in their inventory by its ID, slot, or metadata.
has_item
Use the following to check if a player has a specified item and quantity.
add_item
Use the following to add an item to the players inventory.
remove_item
Use the following to remove an item from the players inventory by specifying the item id, slot, or metadata.
update_item_data
Use the following to update the metadata for an item by specifying the item id, slot, or metadata.
Roles
get_roles
Use the following to retrieve all roles the player holds.
get_role
Use the following to retrieve a role the player holds by given role id.
has_role
Use the following to check the the player has a specified role.
This currently has no way of checking for grade, this will be updated asap.
add_role
Use the following to add a new role on the player.
Only roles that have been defined within roles.json can be added.
remove_role
Use the following to remove a role from the player.
Statuses
get_statuses
Use the following to retrieve all statuses for the player.
get_status
Use the following to retrieve a specific status.
set_statuses
Use the following to set multiple statuses on the player.
set_status
Use the following to set a single status on the player.
get_flags
Use the following to retrieve all flags on the player.
get_flag
Use the following to retrieve a specific flag on the player.
set_flags
Use the following to set multiple flags on the player.
set_flag
Use the following to set a single flag on the player.
get_effects
Use the following to retrieve all effects the player holds.
get_effect
Use the following to retrieve a effect the player holds by given id.
set_effects
Use the following to multiple effects on the player.
set_effect
Use the following to set a single effect on the player.
Styles
get_style
Use the following to retrieve the players current style data.
set_style
Use the following to set a new style for the player.
get_outfits
Use the following to retrieve all outfits for the player.
get_outfit
Use the following to retrieve a specific outfit by given id.
add_outfit
Use the following to add a new outfit to the players data.
remove_outfit
Use the following to remove a saved outfit from the player.
mark_as_customised
Use the following to mark the player as "has_customised". This allows direct entrance into the server on their next connection, instead of being routed into the character customisation.
This is done automatically when a player first customises their character however if you need to do this for another reason you can.
has_customised
Use the following to check if a player is marked as "has_customised".
Last updated