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 (Replaced HTML with template)
Line 1: Line 1:
Sets/gets the players eye color
Sets/gets the players eye color
== Syntax ==
== Syntax ==
<syntaxhighlight lang="javascript">
<pre>
player.eyeColor;
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}}

Revision as of 12:14, 26 October 2018

Sets/gets the players eye color

Syntax

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