githubEdit

🎮Client Event Reference

Learn about and how to use common core client events!

QBCore:Client:OnPlayerLoaded

  • Handles the player loading in after character selection

circle-check
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
    print('Im a client and i just loaded into your server!')
end)

QBCore:Client:OnPlayerUnload

  • Handles the player login out to character selection

circle-check
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
    print('Im a client and i just logged out of your server!')
end)

QBCore:Client:PvpHasToggled

circle-info

On player load this event checks is triggered after checking the qb-core config to see if PVP should be enabled or disabled

RegisterNetEvent('QBCore:Client:PvpHasToggled', function(pvp_state)
    print('PVP mode has been set to '..pvp_state..'!')
end)

QBCore:Command:SpawnVehicle

Arguments
Type
Required
Default

vehicle model

string

yes

none

circle-info

Client example

circle-info

Server example

QBCore:Command:DeleteVehicle

Arguments
Type
Required
Default

none

none

no

none

circle-info

Client example

circle-info

Server example

QBCore:Player:SetPlayerData

circle-check

QBCore:Client:VehicleInfo

circle-check

Data fields:

Field
Type
Description

vehicle

number

Vehicle Network ID

seat

number

Seat number (-1, 0, 1, 2, 3, 4, 5, 6)

name

string

Model Display Name

event

string

Entering, Entered, Left

QBCore:Notify

Arguments
Type
Required
Default

message

string | table

yes

'Placeholder'

type

string

yes

'primary'

length

number

yes

5000

circle-info

Client example

circle-info

Server example

QBCore:Client:UseItem

Arguments
Type
Required
Default

item name

string

yes

none

circle-info

Client example (must have the item in your inventory)

circle-info

Server example (must have the item in your inventory)

QBCore:Command:ShowMe3D

Arguments
Type
Required
Default

player id

number

yes

none

message

string

yes

none

circle-info

Client example

circle-info

Server example

QBCore:Client:OnSharedUpdate

circle-info

Server example

circle-info

This only updates shared data for the client, it does not update the server. Also it does not persist through server restarts. To make persistent changes you must update the shared files.

Arguments:

  1. tableName: The Shared field that should be updated

  2. key: Key of the field to update

  3. value: New value of the field to update

QBCore:Client:OnSharedUpdateMultiple

circle-info

Server example

circle-info

This only updates shared data for the client, it does not update the server. Also it does not persist through server restarts. To make persistent changes you must update the shared files.

Arguments:

  1. tableName: The Shared field it should be updated

  2. values: The key-value pairs to update

QBCore:Client:SharedUpdate

circle-info

Server example

circle-info

This only updates shared data for the client, it does not update the server. Also it does not persist through server restarts. To make persistent changes you must update the shared files.

Arguments:

  1. table: All shared data

QBCore:Client:UpdateObject

circle-check

Last updated

Was this helpful?