resetVehicleComponentRotation
Client-side
Server-side
Shared
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function reset to default component rotation for vehicle.
Syntax
resetVehicleComponentRotation ( )Code Examples
client
Example 1:This example would change the roatation of the component when the player enters a vehicle and resets it when you type /reset.
addEventHandler("onClientVehicleEnter", getRootElement(), function() local theVeh = getPedOccupiedVehicle(localPlayer) local getComponent = getVehicleComponents(theVeh) -- returns table with all the components of the vehicle if (theVeh) then for k in pairs (getComponent) do local rx, ry, rz = getVehicleComponentRotation(theVeh, k) --get the rotation of the component setVehicleComponentRotation(theVeh, k, rx+10, ry+10, rz+10) -- increases by 10 unit end end end)
addCommandHandler("reset", function() local theVeh = getPedOccupiedVehicle(localPlayer) local getComponent = getVehicleComponents(theVeh) -- returns table with all the components of the vehicle if (theVeh) then for k in pairs (getComponent) do resetVehicleComponentRotation(theVeh, k) -- resets the rotation of the component end end end)See Also
Vehicle Functions
- addVehicleSirens
- addVehicleUpgrade
- areVehicleLightsOn
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getHeliBladeCollisionsEnabled
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getVehicleAdjustableProperty
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleController
- getVehicleCurrentGear
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleDummyPosition
- getVehicleEngineState
- getVehicleEntryPoints
- getVehicleGravity
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleIdleRespawnDelay
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelDummyDefaultPosition
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelFromName
- getVehicleModelWheelSize
- getVehicleName
- getVehicleNameFromModel
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnDelay
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleRotorSpeed
- getVehicleRotorState
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehiclesOfType
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgrades
- getVehicleUpgradeSlotName
- getVehicleVariant
- getVehicleWheelFrictionState
- getVehicleWheelScale
- getVehicleWheelStates
- isTrainChainEngine
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleRespawnable
- isVehicleSmokeTrailEnabled
- isVehicleTaxiLightOn
- isVehicleWheelOnGround
- isVehicleWindowOpen
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- resetVehicleDummyPositions
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setHeliBladeCollisionsEnabled
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setVehicleAdjustableProperty
- setVehicleColor
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleDummyPosition
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleGravity
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleModelWheelSize
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleRotorSpeed
- setVehicleRotorState
- setVehicleSirens
- setVehicleSirensOn
- setVehicleSmokeTrailEnabled
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelScale
- setVehicleWheelsRotation
- setVehicleWheelStates
- setVehicleWindowOpen
- spawnVehicle
- spawnVehicleFlyingComponent
- toggleVehicleRespawn
Vehicle Events
- onClientTrailerAttach
- onClientTrailerDetach
- onClientVehicleCollision
- onClientVehicleDamage
- onClientVehicleEnter
- onClientVehicleExit
- onClientVehicleExplode
- onClientVehicleNitroStateChange
- onClientVehicleRespawn
- onClientVehicleStartEnter
- onClientVehicleStartExit
- onClientVehicleWeaponHit
- onTrailerAttach
- onTrailerDetach
- onVehicleDamage
- onVehicleEnter
- onVehicleExit
- onVehicleExplode
- onVehicleRespawn
- onVehicleStartEnter
- onVehicleStartExit