ChangeVehicleColor

From SA-MP Wiki

Jump to: navigation, search

ChangeVehicleColor


This function allows you to change the primary and secondary colours of vehicles spawned in the game. There is no function available to edit the third colour of a vehicle, which some have.


Note: Some vehicles do not have a secondary color and some vehicles (such as patriot) do not allow you to change the color.


Parameters:
(vehicleid, color1, color2)
vehicleidThe vehicle ID of which you want to change the colors.
color1The new vehicle's primary Color ID.
color2The new vehicle's secondary Color ID.


This function does not return a specific value, it's best to simply ignore it.


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    // Change the primary color to black and the secondary color to white
    ChangeVehicleColor(vehicleid, 0, 1);
    return 1;
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

Personal tools
In other languages