natives.changeCarColour: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
(Created page with "{{ScriptItem |endpoint = client |games = iv |type = function |name = natives.changeCarColour |parameters = Vehicle vehicle, int primaryColor, int secondaryColor |parameter1 = Vehicle vehicle The vehicle |parameter2 = int primaryColor The primary color index |parameter3 = int secondaryColor The secondary color index |usage = Change the primary and secondary colors of a vehicle |notes = Color indices usually range from 0 to 133 in GTA IV |return1 = void |exampleJS = addCom...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
|type = function
|type = function
|name = natives.changeCarColour
|name = natives.changeCarColour
|parameters = Vehicle vehicle, int primaryColor, int secondaryColor
|parameters = Vehicle vehicle, int colour1, int colour2
|parameter1 = Vehicle vehicle The vehicle
|parameter1 = Vehicle vehicle The vehicle
|parameter2 = int primaryColor The primary color index
|parameter2 = int colour1 The primary colour index
|parameter3 = int secondaryColor The secondary color index
|parameter3 = int colour2 The secondary colour index
|usage = Change the primary and secondary colors of a vehicle
|usage = Change the primary and secondary colours of a vehicle
|notes = Color indices usually range from 0 to 133 in GTA IV
|return1 = void
|return1 = void
|exampleJS = addCommandHandler("color", function(command, params, client) {  
|exampleJS = addCommandHandler("paintcar", function(command, params, client) {
     if (localPlayer && localPlayer.vehicle) {
     natives.changeCarColour(localPlayer.vehicle, 5, 10);
        natives.changeCarColour(localPlayer.vehicle, 1, 2);  
});
    }
});  
}}
}}

Latest revision as of 04:25, 10 January 2026

Function Client Only icon-iv.png Online and Offline

Available since Client 1.0.0
void natives.changeCarColour(Vehicle vehicle, int colour1, int colour2)
The natives.changeCarColour function is used to Change the primary and secondary colours of a vehicle.

Parameters

1) Vehicle vehicle The vehicle.
2) int colour1 The primary colour index.
3) int colour2 The secondary colour index.

Return

void This function doesn't return a value.

Notes

There aren't any notes for this function.

Examples

Example 1 - JavaScript:

addCommandHandler("paintcar", function(command, params, client) {
    natives.changeCarColour(localPlayer.vehicle, 5, 10);
});

Compatibility

There isn't any compatibility information for this function.