natives.changeCarColour: Difference between revisions

no edit summary
(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
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
|games = iv
|games = iv
|type = function
|type = function
|name = natives.changeCarColour
|name = natives.setDisplayPlayerNameAndIcon
|parameters = Vehicle vehicle, int primaryColor, int secondaryColor
|parameters = int playerId, bool enable
|parameter1 = Vehicle vehicle The vehicle
|parameter1 = int playerId The player index to affect
|parameter2 = int primaryColor The primary color index
|parameter2 = bool enable True to show the name and icon, false to hide
|parameter3 = int secondaryColor The secondary color index
|usage = Display or hide the player’s name and icon above their ped
|usage = Change the primary and secondary colors of a vehicle
|notes = playerId must be a valid client index
|notes = Color indices usually range from 0 to 133 in GTA IV
|return1 = void
|return1 = void
|exampleJS = addCommandHandler("color", function(command, params, client) {
|exampleJS = natives.setDisplayPlayerNameAndIcon(localPlayer.id, true);
    if (localPlayer && localPlayer.vehicle) {
        natives.changeCarColour(localPlayer.vehicle, 1, 2);
    }
});  
}}
}}
53

edits