๐ŸŽฎClient Function Reference

Learn about and how to use common core client functions!

QBCore.Functions.GetPlayerData

  • Perhaps the most used function in the framework. This function returns the players data of the current source which, since its used client side, is automatically the client or player. It can be used with modifiers on the end starting with a "." (period)

function QBCore.Functions.GetPlayerData(cb)
    if not cb then return QBCore.PlayerData end
    cb(QBCore.PlayerData)
end

-- Example

local Player = QBCore.Functions.GetPlayerData()
print(QBCore.Debug(Player))

OR

local Player = QBCore.Functions.GetPlayerData()
local jobName = Player.job.name
print(jobName)

QBCore.Functions.GetCoords

  • This function operates very similarly to how the native GetEntityCoords does, but it returns the heading as well

QBCore.Functions.HasItem

  • Returns whether a player has a certain item

QBCore.Functions.Notify

Arguments
Type
Required
Default

message

string | table

yes

'Placeholder'

type

string

yes

'primary'

length

number

yes

5000

QBCore.Functions.TriggerCallback

  • Function used to call from the client to the server and receive a value back

QBCore.Functions.Progressbar

  • Wrapper for progressbar export

QBCore.Functions.GetVehicles

  • Returns vehicle game pool (for backwards compatibility) - Not worth using

QBCore.Functions.GetCoreObject

  • Returns the core object for accessing

QBCore.Functions.GetPlayers

  • Returns active players in OneSync scope (for backwards compatibility) - Not worth using

QBCore.Functions.GetPeds

  • Returns a model hash filtered ped game pool

QBCore.Functions.GetClosestPed

  • Returns the closest ped to the player after filtering

QBCore.Functions.GetClosestVehicle

  • Returns the closest vehicle to the player

QBCore.Functions.GetClosestObject

  • Returns the closest object to the player

QBCore.Functions.GetClosestPlayer

  • Returns the closest player to the client

QBCore.Functions.GetPlayersFromCoords

  • Returns all players within a radius of specific coordinates

QBCore.Functions.SpawnVehicle

  • Spawn a vehicle

QBCore.Functions.DeleteVehicle

  • Delete a specific vehicle through the client - Not worth using

QBCore.Functions.GetPlate

  • Returns the plate text of a specific vehicle after trimming the whitespace from it

QBCore.Functions.GetVehicleProperties

  • Get all properties of a vehicle

QBCore.Functions.SetVehicleProperties

  • Set all properties for a vehicle

Last updated