GetVehiclePaintjob: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
{{Server client function}}
__NOTOC__
__NOTOC__
This function gets the current paintjob on the specified vehicle. <br/>
This function gets the current paintjob on the specified vehicle. <br />
Note: Only works for supported vehicles.
Note: Only works for supported vehicles.


Line 10: Line 11:


==Returns==
==Returns==
Returns an integer representing the current paintjob on the vehicle. <br/>
Returns an integer representing the current paintjob on the vehicle. <br />
Note: Returns '255' for default (no paintjob/plain).
Note: Returns '255' for default (no paintjob/plain).


Line 16: Line 17:
This example will set the paintjob of a new sultan to '2', then check it was set.
This example will set the paintjob of a new sultan to '2', then check it was set.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
vehicle = createVehicle ( 560, 100, 100, 40 ) -- create the sultan
newvehicle = createVehicle ( 560, 100, 100, 40 )   -- create the sultan
setVehiclePaintjob ( vehicle, 2 ) -- change the paintjob
setVehiclePaintjob ( newvehicle, 2 )               -- change the paintjob
paintjob = getVehiclePaintjob ( vehicle )
paintjob = getVehiclePaintjob ( newvehicle )
if ( paintjob == 2 ) then
if ( paintjob == 2 ) then
  outputChatBox ( "the paintjob was successfully set" )
    outputChatBox ( "the paintjob was successfully set" )
end
end
</syntaxhighlight>
</syntaxhighlight>

Revision as of 18:12, 17 August 2007

This function gets the current paintjob on the specified vehicle.
Note: Only works for supported vehicles.

Syntax

int getVehiclePaintjob ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle you wish to get the paintjob of.

Returns

Returns an integer representing the current paintjob on the vehicle.
Note: Returns '255' for default (no paintjob/plain).

Example

This example will set the paintjob of a new sultan to '2', then check it was set.

newvehicle = createVehicle ( 560, 100, 100, 40 )   -- create the sultan
setVehiclePaintjob ( newvehicle, 2 )               -- change the paintjob
paintjob = getVehiclePaintjob ( newvehicle )
if ( paintjob == 2 ) then
    outputChatBox ( "the paintjob was successfully set" )
end

See Also