natives.changeCarColour: Difference between revisions

Jump to navigation Jump to search
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
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 = Intended to be used when a player streams in; 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 = addEventHandler("OnElementStreamIn", function(event, element) {
     if (localPlayer && localPlayer.vehicle) {
     natives.givePedFakeNetworkName(element, "Officer_John", 255, 255, 255, 255);
        natives.changeCarColour(localPlayer.vehicle, 1, 2);  
});
    }
});  
}}
}}
53

edits

Navigation menu