ChangeVehicleColor
From SA-MP Wiki
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.
(vehicleid, color1, color2)
| vehicleid | The vehicle ID of which you want to change the colors. |
| color1 | The new vehicle's primary Color ID. |
| color2 | The 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.
- ChangeVehiclePaintjob: Change the paintjob on a vehicle.
