Player::setDecoration: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Applies an Item from a PedDecorationCollection to a player. These include tattoos and shirt decals.<br><br>collection - PedDecorationCollection filename hash<br>overlay - Item name hash<br><br>Example:<br>Entry inside 'mpbeach_overlays.xml' -<br>&lt;Item&gt;<br>  &lt;uvPos x='0.500000' y='0.500000' /&gt;<br>  &lt;scale x='0.600000' y='0.500000' /&gt;<br>  &lt;rotation value='0.000000' /&gt;<br>  &lt;nameHash&gt;FM_Hair_Fuzz&lt;/nameHash&gt;<br>  &lt;txdHash&gt;mp_hair_fuzz&lt;/txdHash&gt;<br>  &lt;txtHash&gt;mp_hair_fuzz&lt;/txtHash&gt;<br>  &lt;zone&gt;ZONE_HEAD&lt;/zone&gt;<br>  &lt;type&gt;TYPE_TATTOO&lt;/type&gt;<br>  &lt;faction&gt;FM&lt;/faction&gt;<br>  &lt;garment&gt;All&lt;/garment&gt;<br>  &lt;gender&gt;GENDER_DONTCARE&lt;/gender&gt;<br>  &lt;award /&gt;<br>  &lt;awardLevel /&gt;<br>&lt;/Item&gt;<br><br>Code:<br>Player::_0x5F5D1665E352A839(PLAYER::PLAYER_Player_ID(), GAMEPLAY::GET_HASH_KEY('mpbeach_overlays'), GAMEPLAY::GET_HASH_KEY('fm_hair_fuzz'))
{{ClientsideJsFunction}}
==Syntax==
{{JSContainer|
<syntaxhighlight lang="javascript">player.setDecoration(collection, overlay);</syntaxhighlight>
 
=== Required Arguments ===
This function applies an item from a `PedDecorationCollection` to a player, such as tattoos or shirt decals.
*'''collection:''' Model hash or name
 
*'''overlay:''' Model hash or name
===Required Params===
*'''collection:''' {{RageType|number}} — the hash of the `PedDecorationCollection`, e.g., `mp.game.joaat('mpbeach_overlays')`
*'''overlay:''' {{RageType|number}} — the hash of the item to apply from the collection, e.g., `mp.game.joaat('fm_hair_fuzz')`
 
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Syntax==
<syntaxhighlight lang="javascript">
mp.players.local.setDecoration(collection, overlay);
</syntaxhighlight>
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
// Applies a head tattoo to the player
mp.players.local.setDecoration(mp.game.joaat('mpbeach_overlays'), mp.game.joaat('fm_hair_fuzz'));
</syntaxhighlight>
</syntaxhighlight>
===Common PedDecorationCollections===
* '''mpbeach_overlays'''
* '''mpbusiness_overlays'''
* '''mphipster_overlays'''
* '''mplowrider_overlays'''
* '''mpbiker_overlays'''
}}
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Player Appearance]]
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]
[[Category:Server-side Function]]
[[Category:Client-side Function]]

Latest revision as of 11:12, 2 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


This function applies an item from a `PedDecorationCollection` to a player, such as tattoos or shirt decals.

Required Params

  • collection: number — the hash of the `PedDecorationCollection`, e.g., `mp.game.joaat('mpbeach_overlays')`
  • overlay: number — the hash of the item to apply from the collection, e.g., `mp.game.joaat('fm_hair_fuzz')`

Return value

  • Undefined

Syntax

mp.players.local.setDecoration(collection, overlay);

Example

// Applies a head tattoo to the player
mp.players.local.setDecoration(mp.game.joaat('mpbeach_overlays'), mp.game.joaat('fm_hair_fuzz'));

Common PedDecorationCollections

  • mpbeach_overlays
  • mpbusiness_overlays
  • mphipster_overlays
  • mplowrider_overlays
  • mpbiker_overlays


See also