Vehicle::getCustomPrimaryColour: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(One intermediate revision by one other user not shown)
Line 10: Line 10:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
mp.events.add("playerEnterVehicle", (vehicle, seat) => { // Getting RED Color of RGB when player Enter vehicle
  let rgb = vehicle.getCustomPrimaryColour(0, 0, 0); //
  mp.gui.chat.push("Red color is: " + rgb.r); // rgb.r = from 0 to 255 depends on vehicle's color
});
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 11:34, 9 May 2024

Syntax

vehicle.getCustomPrimaryColour(r, g, b);

Required Arguments

  • r: int
  • g: int
  • b: int

Return value

  • object: r, g, b

Example

mp.events.add("playerEnterVehicle", (vehicle, seat) => { // Getting RED Color of RGB when player Enter vehicle
  let rgb = vehicle.getCustomPrimaryColour(0, 0, 0); // 
  mp.gui.chat.push("Red color is: " + rgb.r); // rgb.r = from 0 to 255 depends on vehicle's color
});

See also