SetPlayerSkin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(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.)
No edit summary
 
(8 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Client function}}
{{Server client function}}
__NOTOC__
__NOTOC__
{{Deprecated|setElementModel}}
This function changes the skin of a player.
This function changes the skin of a player.


Line 13: Line 15:


==Example==  
==Example==  
This example sets you a police skin when you type the command /law.
<syntaxhighlight lang="lua">
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)
</syntaxhighlight>


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

Latest revision as of 09:10, 9 November 2018


Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use setElementModel instead.


This function changes the skin of a player.

Syntax

bool setPlayerSkin ( player thePlayer, int skinID )

Required Arguments

  • 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