GetVehiclePaintjob: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 2: Line 2:
__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.


==Syntax==
==Syntax==
Line 12: 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).
* '''0''': The first paintjob
* '''1''': The second paintjob
* '''2''': The third paintjob
* '''3''': Default paintjob (no paintjob)
Note: Always returns 3 if paintjobs are not supported for the vehicle.


==Example==
==Example==

Revision as of 16:50, 29 October 2009

This function gets the current paintjob on the specified vehicle.

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.

  • 0: The first paintjob
  • 1: The second paintjob
  • 2: The third paintjob
  • 3: Default paintjob (no paintjob)

Note: Always returns 3 if paintjobs are not supported for the vehicle.

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