GetVehiclePaintjob: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
{{Server client function}}
{{Server client function}}
__NOTOC__
This function gets the current paintjob on the specified vehicle. <br />
This function gets the current paintjob on the specified vehicle. <br />


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">int getVehiclePaintjob ( vehicle theVehicle )</syntaxhighlight>
<syntaxhighlight lang="lua">int getVehiclePaintjob ( vehicle theVehicle )</syntaxhighlight>
 
{{OOP||[[vehicle]]:getPaintjob|paintjob|setVehiclePaintjob}}
===Required Arguments===
===Required Arguments===
*'''theVehicle''': The [[vehicle]] you wish to get the paintjob of.
*'''theVehicle''': the [[vehicle]] you wish to get the paintjob of.


==Returns==
==Returns==
Line 15: Line 15:
* '''2''': The third paintjob
* '''2''': The third paintjob
* '''3''': Default paintjob (no paintjob)
* '''3''': Default paintjob (no paintjob)
Note: Always returns 3 if paintjobs are not supported for the vehicle.
{{Note|Always returns 3 if paintjobs are not supported for the vehicle.}}


==Example==
==Example==
Line 30: Line 30:
==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}
[[pl:getVehiclePaintjob]]

Latest revision as of 04:22, 11 August 2019

This function gets the current paintjob on the specified vehicle.

Syntax

int getVehiclePaintjob ( vehicle theVehicle )

OOP Syntax Help! I don't understand this!

Method: vehicle:getPaintjob(...)
Variable: .paintjob
Counterpart: setVehiclePaintjob


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)
[[{{{image}}}|link=|]] 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