Player::eyeColor: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Sets/gets the players eye color == Syntax == <syntaxhighlight lang="javascript"> player.eyeColor; </syntaxhighlight> ==Examples== This lets you set the eye color of your play...")
 
m (category)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Sets/gets the players eye color
Sets/gets the players eye color
== Syntax ==
== Syntax ==
<syntaxhighlight lang="javascript">
<pre>
player.eyeColor;
Number player.eyeColor;
</syntaxhighlight>
</pre>


==Examples==
==Examples==
This lets you set the eye color of your player and will output the value of the players eye color in the chat.
This lets you set the eye color of your player and will output the value of the players eye color in the chat.
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServersideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<pre>
<syntaxhighlight lang="javascript">
mp.events.addCommand('eyecolor', (player, _, id) => {
mp.events.addCommand('eyecolor', (player, _, id) => {
     player.eyeColor = parseInt(id);
     player.eyeColor = parseInt(id);
     player.outputChatBox("Eye Color: " + eColor);
     player.outputChatBox("Eye Color: " + eColor);
});
});
</syntaxhighlight>
</pre>
</div>
}}


==See Also==
==See Also==
{{Player_block}}
{{Player_block}}
[[Category:Player Appearance]]
[[Category:Server-side Property]]

Latest revision as of 13:13, 30 April 2019

Sets/gets the players eye color

Syntax

Number player.eyeColor;

Examples

This lets you set the eye color of your player and will output the value of the players eye color in the chat.

Server-Side
mp.events.addCommand('eyecolor', (player, _, id) => {
    player.eyeColor = parseInt(id);
    player.outputChatBox("Eye Color: " + eColor);
});

See Also