OnPlayerSpawn
Jump to navigation
Jump to search
This event is called when a player spawns.
Syntax
void onPlayerSpawn ( float x, float y, float z, float rotation, team theTeam, int model, int interior, int dimension )
Parameters
- The source of this event refers to the player who spawned.
- theSpawnpoint: a spawnpoint element representing the spawnpoint at which the player was spawned.
- theTeam: a team element representing the team of the spawnpoint.
Example
This example plays a sound when a player spawns.
-- when a player spawns, function player_Spawn ( inSpawnpoint, inTeam ) -- 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
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled