SpawnPlayer: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 24: | Line 24: | ||
==Example== | ==Example== | ||
This example spawns all the players in the map | This example spawns all the players in the middle of the game map. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- Get a table of all the players | -- Get a table of all the players | ||
Line 31: | Line 31: | ||
for playerKey, playerValue in ipairs(players) do | for playerKey, playerValue in ipairs(players) do | ||
-- Spawn them at the desired coordinates | -- Spawn them at the desired coordinates | ||
spawnPlayer ( playerValue, 0.0, 0.0, | spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 7 ) | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 15:25, 29 August 2007
This function spawns the player at an arbitary point on the map.
Syntax
bool spawnPlayer ( player thePlayer, float x, float y, float z, [ int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil ] )
Required Arguments
- x: The x co-ordinate to spawn the player at
- y: The y co-ordinate to spawn the player at
- z: The z co-ordinate to spawn the player at
Optional Arguments
- rotation: rotation of the player on spawn
- skinID: players skin on spawn
- interior: interior the player will spawn into
- dimension: The ID of the dimension that the player should be in
- theTeam: the team the player will join
Returns
Returns true if the player was spawned successfully, false otherwise.
Example
This example spawns all the players in the middle of the game map.
-- Get a table of all the players players = getElementsByType ( "player" ) -- Go through every player for playerKey, playerValue in ipairs(players) do -- Spawn them at the desired coordinates spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 7 ) end
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState