Resource:Spawnmanager/onSpawnpointUse

From Multi Theft Auto: Wiki
Revision as of 20:34, 31 December 2007 by Talidan (talk | contribs) (Spawnmanager/onSpawnpointUse moved to Resource:Spawnmanager/onSpawnpointUse)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered when a player spawns at a spawnpoint.

Syntax

void onSpawnpointUse ( player player ) 

Variables

  • The source of this event refers to the spawnpoint that was used when a player spawned
  • player: A player element representing the player who spawned at the source spawnpoint.

Example

This example plays a sound when a player spawns

function spawnUse ( player ) --when a player spawns
	playSoundFrontEnd ( player, 16 ) --play a sound for him
end
addEventHandler ( "onSpawnpointUse", getElementRoot(), spawnUse ) --add an event for onSpawnpointUse