natives.changeCarColour: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
|games = iv
|games = iv
|type = function
|type = function
|name = natives.setDisplayPlayerNameAndIcon
|name = natives.changeCarColour
|parameters = int playerId, bool enable
|parameters = Vehicle vehicle, int colour1, int colour2
|parameter1 = int playerId The player index to affect
|parameter1 = Vehicle vehicle The vehicle
|parameter2 = bool enable True to show the name and icon, false to hide
|parameter2 = int colour1 The primary colour index
|usage = Display or hide the player’s name and icon above their ped
|parameter3 = int colour2 The secondary colour index
|notes = Intended to be used when a player streams in; playerId must be a valid client index
|usage = Change the primary and secondary colours of a vehicle
|return1 = void
|return1 = void
|exampleJS = addEventHandler("OnElementStreamIn", function(event, element) {
|exampleJS = addCommandHandler("paintcar", function(command, params, client) {
     natives.givePedFakeNetworkName(element, "Officer_John", 255, 255, 255, 255);
     natives.changeCarColour(localPlayer.vehicle, 5, 10);
});
});
}}
}}

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.