Vehicle::getNeonColour: Difference between revisions
(Updated example section to use "<pre>" tags instead of incorrect syntax highlighting.) |
MrPancakers2 (talk | contribs) No edit summary |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
This function used | __NOTOC__ | ||
{{ServersideJsFunction}} | |||
This function is used to get the vehicle's neon colour in an RGB format. | |||
{{JSContainer| | |||
==Syntax== | ==Syntax== | ||
< | <pre> | ||
vehicle.getNeonColour(); | |||
</ | </pre> | ||
===Returns=== | ===Returns=== | ||
*'''neonColours''': {{RageType|Array}} Array containing the colours. | |||
** '''r''': Red [0 - 255] | |||
* Red | ** '''g''': Green [0 - 255] | ||
* Green | ** '''b''': Blue [0 - 255] | ||
* Blue | |||
==Example== | ==Example== | ||
{{ServersideCode| | {{ServersideCode| | ||
<pre> | <pre> | ||
mp.events.addCommand(` | mp.events.addCommand(`getneon`, | ||
(player) => { | (player) => { | ||
let vehicle = player.vehicle; | let vehicle = player.vehicle; | ||
| Line 25: | Line 28: | ||
); | ); | ||
</pre> | </pre> | ||
}} | |||
}} | }} | ||
==See Also== | == See Also == | ||
{{ | {{Vehicle_function}} | ||
Latest revision as of 00:58, 14 September 2020
Server-Side Function
This function is used to get the vehicle's neon colour in an RGB format.
JavaScript Syntax
Syntax
vehicle.getNeonColour();
Returns
- neonColours: Array Array containing the colours.
- r: Red [0 - 255]
- g: Green [0 - 255]
- b: Blue [0 - 255]
Example
Server-Side
mp.events.addCommand(`getneon`,
(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>`);
};
}
);
See Also
- Functions
- Vehicle::Vehicle
- Vehicle::repair
- Vehicle::destroy
- Vehicle::setNeonColour
- Vehicle::getNeonColour
- Vehicle::setMod
- Vehicle::getMod
- Vehicle::setColour
- Vehicle::setColourRGB
- Vehicle::setPaint
- Vehicle::getColour
- Vehicle::getColourRGB
- Vehicle::getPaint
- Vehicle::getOccupant
- Vehicle::setOccupant
- Vehicle::getOccupants
- Vehicle::explode
- Vehicle::spawn
- Properties
- Entity::id
- Entity::dimension
- Entity::type
- Vehicle::model
- Vehicle::alpha
- Vehicle::position
- Vehicle::rotation
- Vehicle::velocity
- Vehicle::siren
- Vehicle::horn
- Vehicle::engine
- Vehicle::highbeams
- Vehicle::engineHealth
- Vehicle::bodyHealth
- Vehicle::steerAngle
- Vehicle::rocketBoost
- Vehicle::brake
- Vehicle::locked
- Vehicle::numberPlate
- Vehicle::neonEnabled
- Vehicle::dead
- Vehicle::wheelType