Vehicle::getNeonColour: Difference between revisions
No edit summary |
(Updated the example section's text to be grammatically correct.) |
||
| Line 13: | Line 13: | ||
==Example== | ==Example== | ||
An example showing the function's use. | |||
<syntaxhighlight lang="javascript" highlight="5"> | <syntaxhighlight lang="javascript" highlight="5"> | ||
Revision as of 19:47, 11 September 2020
This function used for get vehicle neon color in RGB format.
Syntax
Object vehicle.getNeonColour();
Returns
Return array containing colours.
Array content
- Red color in diapason 0 - 255.
- Green color in diapason 0 - 255.
- Blue color in diapason 0 - 255.
Example
An example showing the function's use.
mp.events.addCommand(`neonich`,
(player) => {
let vehicle = player.vehicle;
if (!!vehicle) {
let [r, g, b] = vehicle.getNeonColour();
player.outputChatBox(`R <b>${r}</b>; G <b>${g}</b>; B <b>${b}</b>`);
};
}
);