GetPedCameraRotation
From Multi Theft Auto: Wiki
Note: The camera rotation angle returned by this function is 360º - α (where α is the actual camera rotation angle). See example to know how to deal with this. |
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
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedClothes
- removePedFromVehicle
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
FROM VERSION 1.5.7 r19626 ONWARDS
FROM VERSION 1.5.7 r19626 ONWARDS