Resource:Spawnmanager/onSpawnpointUse: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ This event is triggered when a player spawns at a spawnpoint. ==Syntax== <syntaxhighlight lang="lua"> void onSpawnpointUse ( player player ) </syntaxhighlight> ==Variables== * The source of this...)
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server event}}
This event is triggered when a player spawns at a spawnpoint.
This event is triggered when a player spawns at a spawnpoint.


Line 8: Line 9:


==Variables==
==Variables==
* The [[source]] of this event refers to the spawnpoint that was used when a player spawned
* The [[event system#Event source|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.
*'''player''':  A player element representing the player who spawned at the source spawnpoint.



Latest revision as of 20:34, 31 December 2007

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