ChangeVehicleColor

From SA-MP Wiki

Jump to: navigation, search


Description:

Change a vehicle's primary and secondary colors.


Image:32px-Ambox_warning_orange.png

Note

Some vehicles have only a primary color and some can not have the color changed at all. A few (cement, squallo) have 4 colors, of which 2 can not be changed in SA:MP


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


Return Values:

  • 1: The function executed successfully. The vehicle's color was successfully changed.
  • 0: The function failed to execute. The vehicle does not exist.


Example Usage:

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 may be useful, as they are related to this function in one way or another.


Related Callbacks

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

Personal tools
Navigation
Toolbox