SetPlayerSkin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments By xjulianGilx===  
*'''thePlayer:''' The [[player]] whose model will be changed.
*'''thePlayer:''' The [[player]] whose model will be changed.
*'''skinID:''' A GTASA player model (skin) ID. See [[Character Skins]].
*'''skinID:''' A GTASA player model (skin) ID. See [[Character Skins]].

Revision as of 19:17, 24 February 2018


Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does.


Please use setElementModel

This function changes the skin of a player.

Syntax

bool setPlayerSkin ( player thePlayer, int skinID )

Required Arguments By xjulianGilx

  • thePlayer: The player whose model will be changed.
  • skinID: A GTASA player model (skin) ID. See Character Skins.

Example

This example sets you a police skin when you type the command /law.

 
function enterTheLaw(playerSource)
  if (getPlayerSkin(playerSource) == 280) then
    outputChatBox("You are already in the law!", playerSource)
  else
    setPlayerSkin(playerSource, 280)
    outputChatBox("Welcome to the law, protect the innocents.", playerSource)
  end
end

addCommandHandler("law", enterTheLaw)

See Also