Sign in to follow this  
Skittes

How to change liveries on vehicle?

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.