Difference between revisions of "Vehicle::livery"

From RAGE Multiplayer Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
== Getter ==
 
== Getter ==
 
* {{RageType|int}} livery value
 
* {{RageType|int}} livery value
 +
 +
== Example Vehcile Livery ==
 +
[[File:Livery0.png|200px|thumb|left|police livery 0]]
 +
[[File:Livery1.png|200px|thumb|left|police livery 1]]
 +
[[File:Livery2.png|200px|thumb|left|police livery 2]]
 +
 +
"police" have 5 livery. top number 32, 76, 05, 84, 43
 +
  
 
== Example ==
 
== Example ==
Line 13: Line 21:
 
     'livery' : (player, _, livery) => {
 
     'livery' : (player, _, livery) => {
 
         if(!player.vehicle) return; // check if player in vehicle or not
 
         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
+
         if(!livery || livery < 0) return; // check player input livery or not, and livery less than 0
        // livery higher than 2 may work
 
 
         player.vehicle.livery = JSON.parse([livery]); // set vehicle's livery
 
         player.vehicle.livery = JSON.parse([livery]); // set vehicle's livery
 
     },
 
     },

Latest revision as of 21:34, 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

"police" have 5 livery. top number 32, 76, 05, 84, 43


Example

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