GetPedCameraRotation: Difference between revisions
Jump to navigation
Jump to search
m (add oop syntax) |
m (→Example) |
||
Line 22: | Line 22: | ||
function () | function () | ||
local rot = 360 - getPedCameraRotation(localPlayer) -- Also fix the camera rotation | local rot = 360 - getPedCameraRotation(localPlayer) -- Also fix the camera rotation | ||
outputChatBox("Your camera rotation is " .. | outputChatBox("Your camera rotation is " .. rot .. "º", 0, 225, 0) | ||
end | end | ||
) | ) |
Revision as of 10:48, 13 February 2018
This function gets the current camera rotation of a ped.
Syntax
float getPedCameraRotation( ped thePed )
OOP Syntax Help! I don't understand this!
- Method: ped:getCameraRotation(...)
- Variable: .cameraRotation
- Counterpart: setPedCameraRotation
Required Arguments
- thePed: the ped to retrieve the camera rotation of.
Returns
Returns the camera rotation of the ped in degrees if successful. Returns false if an invalid element was passed.
Example
This example creates a /getrotation command which outputs the expected camera rotation of the player which types it.
addCommandHandler( "getrotation", function () local rot = 360 - getPedCameraRotation(localPlayer) -- Also fix the camera rotation outputChatBox("Your camera rotation is " .. rot .. "º", 0, 225, 0) end )
See Also
- canPedBeKnockedOffBike
- getPedAnalogControlState
- getPedAnimation
- getPedBonePosition
- getPedCameraRotation
- getPedControlState
- getPedMoveState
- getPedOxygenLevel
- getPedSimplestTask
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedVoice
- getPedWeaponMuzzlePosition
- givePedWeapon
- isPedBleeding
- isPedDoingTask
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedControlState
- setPedEnterVehicle
- setPedExitVehicle
- IsPedFootBloodEnabled
- setPedFootBloodEnabled
- setPedLookAt
- setPedOxygenLevel
- setPedTargetingMarkerEnabled
- setPedVoice
- Shared
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle