SetVehicleAdjustableProperty: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→Example) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{client function}} | {{client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function is used for adjusting the movable parts of a model, for example hydra jets or dump truck tray. | This function is used for adjusting the movable parts of a model, for example hydra jets or dump truck tray. | ||
This function only works on vehicles with adjustable properties. | This function only works on vehicles with adjustable properties. | ||
Line 15: | Line 14: | ||
===Returns=== | ===Returns=== | ||
Returns true if the adjustable property was set | Returns true if the adjustable property was set, ''false'' otherwise. | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | |||
This clientside function allows the user to set the vehicle adjustable property of a vehicle that the user is in by typing a command: | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function adjustProperty ( command, adjustValue ) | |||
--First check if our player is in a vehicle (otherwise there is nothing to adjust) | |||
if isPedInVehicle (getLocalPlayer()) then | |||
--Next check if there is a property to adjust on this vehicle that our player is in | |||
if getVehicleAdjustableProperty(getPedOccupiedVehicle(getLocalPlayer())) then | |||
--Set the vehicle property to the argument that was given with the command (adjustValue) | |||
setVehicleAdjustableProperty (getPedOccupiedVehicle(getLocalPlayer()), adjustValue ) | |||
else | |||
outputChatBox("You are in a vehicle that has no adjustable property!") | |||
end | |||
else | |||
outputChatBox("You are not in a vehicle!") | |||
end | |||
end | |||
addCommandHandler ( "adjust", adjustProperty ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{ | {{Client_vehicle_functions}} |
Latest revision as of 11:05, 9 October 2012
This function is used for adjusting the movable parts of a model, for example hydra jets or dump truck tray. This function only works on vehicles with adjustable properties.
Syntax
bool setVehicleAdjustableProperty ( element theVehicle, int value )
Required Arguments
- theVehicle: The vehicle you wish to change the adjustable property of.
- value: A value from 0 between ?. (Set the adjustable value between 0 and N. 0 is the default value. It is possible to force the setting beyond default maximum, for example setting above 5000 on the dump truck (normal max 2500) will cause the tray to be fully vertical.)
Returns
Returns true if the adjustable property was set, false otherwise.
Example
Click to collapse [-]
ClientThis clientside function allows the user to set the vehicle adjustable property of a vehicle that the user is in by typing a command:
function adjustProperty ( command, adjustValue ) --First check if our player is in a vehicle (otherwise there is nothing to adjust) if isPedInVehicle (getLocalPlayer()) then --Next check if there is a property to adjust on this vehicle that our player is in if getVehicleAdjustableProperty(getPedOccupiedVehicle(getLocalPlayer())) then --Set the vehicle property to the argument that was given with the command (adjustValue) setVehicleAdjustableProperty (getPedOccupiedVehicle(getLocalPlayer()), adjustValue ) else outputChatBox("You are in a vehicle that has no adjustable property!") end else outputChatBox("You are not in a vehicle!") end end addCommandHandler ( "adjust", adjustProperty )
See Also
- areVehicleLightsOn
- getHeliBladeCollisionsEnabled
- getHelicopterRotorSpeed
- getVehicleAdjustableProperty
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleCurrentGear
- getVehicleDummyPosition
- getVehicleGravity
- getVehicleLandingGearDown
- getVehicleModelDummyDefaultPosition
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelWheelSize
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleWheelFrictionState
- getVehicleWheelScale
- isTrainChainEngine
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleWheelOnGround
- isVehicleWindowOpen
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- resetVehicleDummyPositions
- setHeliBladeCollisionsEnabled
- setHelicopterRotorSpeed
- setVehicleAdjustableProperty
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDummyPosition
- setVehicleGravity
- setVehicleLandingGearDown
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleModelWheelSize
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleWheelScale
- setVehicleWheelStates
- setVehicleWindowOpen
- Shared
- 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