GetVehiclePaintjob: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function gets the current paintjob on the specified vehicle. <br/> | {{Server client function}} | ||
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''': | *'''theVehicle''': the [[vehicle]] you wish to get the paintjob of. | ||
==Returns== | ==Returns== | ||
Returns an integer representing the current paintjob on the vehicle. <br/> | Returns an integer representing the current paintjob on the vehicle. <br /> | ||
* '''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== | ||
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"> | ||
newvehicle = createVehicle ( 560, 100, 100, 40 ) -- create the sultan | |||
setVehiclePaintjob ( | setVehiclePaintjob ( newvehicle, 2 ) -- change the paintjob | ||
paintjob = getVehiclePaintjob ( | paintjob = getVehiclePaintjob ( newvehicle ) | ||
if ( paintjob == 2 ) then | if ( paintjob == 2 ) then | ||
outputChatBox ( "the paintjob was successfully set" ) | |||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 26: | 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)
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
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates