Label::color

From RAGE Multiplayer Wiki
Revision as of 18:47, 4 September 2020 by Leinader (talk | contribs) (Leinader)
Shared

Update the color of the selected label

Syntax

Number label.color
  • colorR - Number
  • colorG - Number
  • colorB - Number
  • colorAlpha - Number

Examples

Updates the color of the label through the command /labelcolor

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

mp.events.addCommand("labelcolor", (player, _, colorR, colorG, colorB, colorAlpha) => {
   startLabel.color = parseInt(colorR, colorG, colorB, colorAlpha);
   player.outputChatBox(`You have updated the color of the label to: ${colorR} ${colorG} ${colorB} ${colorAlpha}`);
});
Page created by Leinader
Hi Grand Brown!
Sorry! Greetings will be until 09/05/2020 (01:00 PM)