Jump to content

How to change liveries on vehicle?


Skittes

Recommended Posts

What's wrong?

TypeError: player.vehicle.setLivery is not a function 
player.vehicle.setLivery(parseInt(livery, 10));

script: 

mp.events.addCommand('setlivery', (player, string, livery) => {
    if (player.vehicle) {
      if(!string){
        return player.outputChatBox("Syntax: /setlivery [liveryID]");
      } else {
        player.vehicle.setLivery(parseInt(livery, 10));
      }
    } else {
         return player.outputChatBox("You must be in vehicle");
     }
});

Edited by Skittes
update
Link to comment
Share on other sites

Hi ! 

I don't have the time to make this script for the moment but if you want to use vehicles liveries you can use these functions :

https://wiki.rage.mp/index.php?title=Vehicle::getLiveryCount

https://wiki.rage.mp/index.php?title=Vehicle::setLivery

https://wiki.rage.mp/index.php?title=Vehicle::getLivery

 

with this, using a bit NativeUI (or your favorite UI) you can do a small menu to set your livery 😛

Edited by karyunoporo
Link to comment
Share on other sites

mp.events.addCommand('setLivery', (player, string, livery) => {
    if(player.vehicle) {
        if(!string) {
            return player.outputChatBox("Syntax: /setlivery [liveryID]");
        }

        player.eval(`mp.players.local.vehicle.setLivery(${livery});`)
    } else {
        return player.outputChatBox("You must be in vehicle");
    }
});

Server-Side

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...