OnPlayerSpawn
From Multi Theft Auto: Wiki
This event is called when a player spawns.
Parameters
- posX: The X position the player spawned at
- posY: The Y position the player spawned at
- posZ: The Z position the player spawned at
- spawnRotation: The rotation the player spawned with
- theTeam: The team the player spawned with
- theSkin: The skin / model the player spawned with
- theInterior: The interior the player spawned in
- theDimension: The dimension the player spawned in
Source
The source of this event is the player that just spawned.
Example
This example plays a sound when a player spawns.
-- when a player spawns, function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) -- play a frontend sound for him playSoundFrontEnd ( source, 16 ) end -- add the player_Spawn function as a handler for onPlayerSpawn addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )
See Also
Player events
- onPlayerBan
- onPlayerChat
- onPlayerPrivateMessage
- onPlayerConnect
- onPlayerChangeNick
- onPlayerLogin
- onPlayerLogout
- onPlayerDamage
- onPlayerJoin
- onPlayerQuit
- onPlayerSpawn
- onPlayerWasted
- onPlayerTarget
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerWeaponSwitch
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerPickupHit
- onPlayerPickupUse
- onPlayerClick
- onPlayerContact
- onPlayerStealthKill
Event functions
- addEvent
- addEventHandler
- cancelEvent
- getCancelReason
- removeEventHandler
- triggerClientEvent
- triggerEvent
- wasEventCancelled
FROM VERSION 1.3.1 ONWARDS