The client-side playerSpawned event fires after spawnmanager creates and places
the local player ped. Use it for presentation and client initialization, while
keeping inventory, permissions, and other authoritative state on the server.
Do not assume the event runs only once during a session; respawns trigger it
again, so initialization should be safe to repeat.
Event Parameters
{
x: number, // The x coordinate of where the player spawned
y: number, // The y coordinate of where the player spawned
z: number, // The z coordinate of where the player spawned
heading: number, // The heading that the player is facing when spawned
idx: number, // The spawnpoint index
model: number, // The ped model hash the player spawned as
skipFade: boolean // Whether the fade was skipped when the player spawned
}Example
on('playerSpawned', (spawnInfo) => {
console.log('Player spawned at:', spawnInfo.x, spawnInfo.y, spawnInfo.z)
})