SpawnPlayer: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→Syntax) |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool spawnPlayer ( player thePlayer, | bool spawnPlayer ( player thePlayer, spawnpoint theSpawnpoint ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''OR''' | '''OR''' | ||
Line 13: | Line 13: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''thePlayer:''' the player to spawn | *'''thePlayer:''' the player to spawn | ||
*''' | *'''theSpawnpoint:''' the spawnpoint element at which to spawn the player | ||
*'''x:''' The x co-ordinate to spawn the player at | *'''x:''' The x co-ordinate to spawn the player at | ||
*'''y:''' The x co-ordinate to spawn the player at | *'''y:''' The x co-ordinate to spawn the player at |
Revision as of 02:19, 29 May 2006
This function spawns the player at a spawnpoint or at an arbitary point on the map.
Syntax
bool spawnPlayer ( player thePlayer, spawnpoint theSpawnpoint )
OR
bool spawnPlayer ( player thePlayer, float x, float y, float z, int rotation, int skinID )
Required Arguments
- thePlayer: the player to spawn
- theSpawnpoint: the spawnpoint element at which to spawn the player
- x: The x co-ordinate to spawn the player at
- y: The x co-ordinate to spawn the player at
- z: The x co-ordinate to spawn the player at
- rotation: rotation of the player on spawn
- skinID: players skin on spawn
Returns
Returns true if the player was spawned successfully, false otherwise.
Example
This example spawns all the players in the map at the first spawnpoint there is.
-- Get a table of all the players players = getElementsByType ( "player" ) -- Get a table of all the spawnpoints spawnpoints = getElementByType ( "spawnpoint" ) -- Go through every player for playerKey, playerValue in players do -- Spawn them at the first spawnpoint spawnPlayer ( playerValue, spawnpoints[1] ) end