SetPedSkin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Client function}} This function changes the skin of a ped. ==Syntax== <syntaxhighlight lang="lua"> bool setPedSkin ( ped thePed, int skinID ) </syntaxhighlight> ===Required Arguments=== *'''thePed:...)
 
m (Changed "DeprecatedWithAlt" template to "Deprecated")
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Server client function}}
{{Deprecated|setElementModel|}}
 
This function changes the skin of a ped.
This function changes the skin of a ped.


Line 13: Line 15:


==Example==  
==Example==  
 
<section show="true" name="Server" class="server">
 
This example sets a players skin to the cop skin when they spawn.
<syntaxhighlight lang="lua">
function setCopSkin ()
setPedSkin ( source, 280 )
outputChatBox ( "You are now a cop.", source, 255, 0, 0 )
end
addEventHandler ( "onPlayerSpawn", getRootElement(), setCopSkin )
</syntaxhighlight>
</section>
==See Also==
==See Also==
{{Client_ped_functions}}
{{Client_ped_functions}}

Latest revision as of 16:36, 13 February 2015

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 ped.

Syntax

bool setPedSkin ( ped thePed, int skinID )

Required Arguments

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

Example

Click to collapse [-]
Server

This example sets a players skin to the cop skin when they spawn.

function setCopSkin ()
	setPedSkin ( source, 280 )
	outputChatBox ( "You are now a cop.", source, 255, 0, 0 )
end
addEventHandler ( "onPlayerSpawn", getRootElement(), setCopSkin )

See Also