Server Events
These events MUST NOT be triggered by any other scripts.
Some of these events use custom types. You can learn more about those in the Types section of this resource.
Non-Networked Events
OnPlayerUnload
Triggered when aplayer begins the process of logging out.
There is no guarantee that the player still exists in qbx_core's memory at the time this event is triggered.
AddEventHandler('QBCore:Server:OnPlayerUnload', function(source) end)
- source:
integer
OnPermissionUpdate
Triggered when the player's permissions are updated.
Only applies to permissions created through QB permission functions.
AddEventHandler('QBCore:Server:OnPermissionUpdate', function(source) end)
- source:
integer
OnJobUpdate
Triggered when a player's job updates.
AddEventHandler('QBCore:Server:OnJobUpdate', function(source, job) end)
- source:
integer
- job:
PlayerJob
OnGangUpdate
Triggered when a player's gang updates.
AddEventHandler('QBCore:Server:OnGangUpdate', function(source, gang) end)
- source:
integer
- gang:
PlayerGang
SetDuty
Triggered when a player's job duty updates.
AddEventHandler('QBCore:Server:SetDuty', function(source, onDuty) end)
- source:
integer
- onDuty:
boolean
onGroupUpdate
Triggered when the player's groups are updated. If grade is nil then group was removed otherwise group was added
AddEventHandler('qbx_core:server:onGroupUpdate', function(source, groupName, groupGrade) end)
- source:
integer
- groupName:
string
- groupGrade?:
number
OnMoneyChange
Triggered when a player's cash/bank balance updates.
AddEventHandler('QBCore:Server:OnMoneyChange', function(source, moneyType, amount, operation, reason) end)
- source:
integer
- moneyType:
'cash' | 'bank' | 'crypto'
- amount:
number
- operation:
'add' | 'remove' | 'set'
- reason:
string
onSetMetaData
Triggered when player.Functions.setMetaData() is used.
AddEventHandler('qbx_core:server:onSetMetaData', function(key, oldValue, newValue, source) end)
- key:
string
- oldValue:
any
- newValue:
any
- source:
number
Networked Events
OnPlayerLoaded
Triggered when a player has finished loading.
RegisterNetEvent('QBCore:Server:OnPlayerLoaded', function() end)