SetPlayerSkin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Removed Template:Needs_Checking: The function works, the player argument is there to allow changing other player's appearance locally. Removed serverside example, it's a client function.)
Line 1: Line 1:
{{Needs_Checking|Broke I think. Also why player arg on client only funct?--[[User:Ransom|Ransom]] 22:22, 10 September 2007 (CDT)}}
{{Client function}}
{{Client function}}
__NOTOC__
__NOTOC__
Changes the model (skin) of a player.
This function changes the skin of a player.


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">bool setPlayerSkin ( player thePlayer, int id )</syntaxhighlight>  
<syntaxhighlight lang="lua">
bool setPlayerSkin ( player thePlayer, int skinID )
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''thePlayer:''' Refers to a player whose model (skin) ID will be changed.
*'''thePlayer:''' The [[player]] whose model will be changed.
*'''id:''' A GTASA player model (skin) ID. List of [[Character Skins]]
*'''skinID:''' A GTASA player model (skin) ID. See [[Character Skins]].


==Example==  
==Example==  
This code will apply a random skin to a player each time he spawns.
<syntaxhighlight lang="lua">
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 )
</syntaxhighlight>


==See Also==
==See Also==
{{IDs}}
{{Player functions}}
{{Player functions}}

Revision as of 01:48, 12 September 2007