SetPlayerSkin: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
__NOTOC__ | {{Client function}} | ||
Changes the model (skin) of a player | __NOTOC__ | ||
Changes the model (skin) of a player. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setPlayerSkin ( | <syntaxhighlight lang="lua">bool setPlayerSkin ( player thePlayer, int id )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''thePlayer:''' Refers to a player whose model (skin) ID will be changed. | ||
*''' | *'''id:''' A GTASA player model (skin) ID. List of [[Character Skins]] | ||
==Example== | ==Example== | ||
This code will apply a random skin to a player each time he spawns. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function onSpawnpointUse ( spawnedplayer ) -- When a player uses a maps spawnpoint | |||
function onSpawnpointUse ( | setPlayerSkin ( spawnedplayer, randInt ( 10, 100 ) ) -- Set the spawned player's skin to a random number between 10 and 100 | ||
setPlayerSkin ( | end | ||
end</syntaxhighlight> | addEventHandler ( "onSpawnpointUse", getRootElement ( ), onSpawnpointUse ) | ||
</syntaxhighlight> | |||
==See Also== | ==See Also== |
Revision as of 21:58, 15 August 2007
Changes the model (skin) of a player.
Syntax
bool setPlayerSkin ( player thePlayer, int id )
Required Arguments
- thePlayer: Refers to a player whose model (skin) ID will be changed.
- id: A GTASA player model (skin) ID. List of Character Skins
Example
This code will apply a random skin to a player each time he spawns.
function onSpawnpointUse ( spawnedplayer ) -- When a player uses a maps spawnpoint setPlayerSkin ( spawnedplayer, randInt ( 10, 100 ) ) -- Set the spawned player's skin to a random number between 10 and 100 end addEventHandler ( "onSpawnpointUse", getRootElement ( ), onSpawnpointUse )
See Also
GTASA IDs (vehicles, weapons, weathers, characters, colors): http://info.vces.net/ (Special thanks to Brophy and Ratt for making these lists)
- 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