๐ŸŽฎClient Event Reference

Learn about and how to use common core client events!

QBCore:Client:OnPlayerLoaded

  • Handles the player loading in after character selection

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

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

QBCore:Client:PvpHasToggled

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

Client example

Server example

QBCore:Command:DeleteVehicle

Arguments
Type
Required
Default

none

none

no

none

Client example

Server example

QBCore:Player:SetPlayerData

QBCore:Client:VehicleInfo

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

Client example

Server example

QBCore:Client:UseItem

Arguments
Type
Required
Default

item name

string

yes

none

Client example (must have the item in your inventory)

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

Client example

Server example

QBCore:Client:OnSharedUpdate

Server example

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

Server example

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

Server example

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

Last updated

Was this helpful?