diff --git a/pages/ox_core/Events/client.mdx b/pages/ox_core/Events/client.mdx index 3a611ad4b..287fe40d5 100644 --- a/pages/ox_core/Events/client.mdx +++ b/pages/ox_core/Events/client.mdx @@ -30,6 +30,55 @@ When a character is loaded * playerId: `number` * isNew?: `boolean` +## ox:playerLogout + +When a character is logged out + + + + ```lua copy + AddEventHandler('ox:playerLogout', function() + print('Log out received') + end) + ``` + + + ```ts copy + on('ox:playerLogout', () => { + console.log('Log out received'); + }); + ``` + + + +## ox:player:\ + +These events are all triggered when using [`OxPlayer.set`](/ox_core/Classes/Server/OxPlayer#oxplayerset) with the replicatd flag. +These can be used as a parallel system compared to statebags where the data is only known by the server & concerned client. + +For example, when a players active group is updated it will trigger the `ox:player:activeGroup` event. Parameters: + + + + ```lua copy + RegisterNetEvent('ox:player:activeGroup', function(newActiveGroup) + print(newActiveGroup) + end) + ``` + + * newActiveGroup: `string` | `nil` + + + ```ts copy + onNet('ox:player:activeGroup', (newActiveGroup: string | null) => { + console.log(newActiveGroup); + }); + ``` + + * newActiveGroup: `string` | `null` + + + ## ox:statusTick On each status tick, returning changed statuses