Vehicle::livery: Difference between revisions
No edit summary |
No edit summary |
||
| Line 18: | Line 18: | ||
}, | }, | ||
//... other commands | //... other commands | ||
}); | |||
</source> | </source> | ||
Revision as of 21:23, 12 February 2020
This property using for getting or setting vehicle livery.
Setter
- int livery value
Getter
- int livery value
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
});