Vehicle::livery: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
mNo edit summary
Line 8: Line 8:


== Example Vehcile Livery ==
== Example Vehcile Livery ==
[[File:Livery0.jpg]]
[[File:Livery0.png|police livery 0]]
[[File:Livery1.jpg]]
[[File:Livery1.png|police livery 1]]
[[File:Livery2.jpg]]
[[File:Livery2.png|police livery 2]]


== Example ==
== Example ==

Revision as of 21:31, 12 February 2020

This property using for getting or setting vehicle livery.

Setter

  • int livery value

Getter

  • int livery value

Example Vehcile Livery

police livery 0 police livery 1 police livery 2

Example

mp.events.addCommand({
    //... other commands
    'livery' : (player, _, livery) => {
        if(!player.vehicle) return; // check if player in vehicle or not
        if(!livery || livery < 0 || livery > 2) return; // check player input livery or not, and livery less than 0 or higher than 2
        // livery higher than 2 may work
        player.vehicle.livery = JSON.parse([livery]); // set vehicle's livery
    },
    //... other commands
});