Label::drawDistance: Difference between revisions

From RAGE Multiplayer Wiki
(Created page)
 
m (Replaced HTML with template)
 
Line 4: Line 4:


== Syntax ==
== Syntax ==
<pre>
Number label.drawDistance
</pre>


<syntaxhighlight lang="javascript">
label.drawDistance = distance;
</syntaxhighlight>
*'''distance''' - {{RageType|Number}}
*'''distance''' - {{RageType|Number}}


Line 13: Line 13:
Updates the draw distance of the label through the command /labeldistance
Updates the draw distance of the label through the command /labeldistance


<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">
let startLabel = mp.labels.new("Use /labeldistance to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327),
let startLabel = mp.labels.new("Use /labeldistance to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327),
{
{
Line 27: Line 26:
     player.outputChatBox(`You have updated the draw distance of the label to: ${dist}`);
     player.outputChatBox(`You have updated the draw distance of the label to: ${dist}`);
});
});
</syntaxhighlight>
</pre>
</div>
}}


== See Also ==
== See Also ==
{{Label_definition}}
{{Label_definition}}

Latest revision as of 12:32, 26 October 2018

Shared

Update the draw distance of the selected label

Syntax

Number label.drawDistance
  • distance - Number

Examples

Updates the draw distance of the label through the command /labeldistance

Server-Side
let startLabel = mp.labels.new("Use /labeldistance to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327),
{
    los: false,
    font: 1,
    drawDistance: 100,
});

mp.events.addCommand("labeldistance", (player, _, dist) => {
    startLabel.drawDistance = parseInt(dist);
    player.outputChatBox(`You have updated the draw distance of the label to: ${dist}`);
});

See Also