SetPedCameraRotation: Difference between revisions
Jump to navigation
Jump to search
Line 23: | Line 23: | ||
addEventHandler ( 'onClientResourceStart', resourceRoot, function () | addEventHandler ( 'onClientResourceStart', resourceRoot, function () | ||
ped = createPed ( 0, 0,0,3) -- create the ped at the coordinate ( x = 0, y = 0, z = 3 ) | ped = createPed ( 0, 0,0,3) -- create the ped at the coordinate ( x = 0, y = 0, z = 3 ) | ||
setPedControlState ( ped, "forwards", true ) | |||
addEventHandler ('onClientPedDamage', ped, function () -- add Event when the ped got damaged | addEventHandler ('onClientPedDamage', ped, function () -- add Event when the ped got damaged |
Revision as of 10:06, 20 October 2013
This function sets the camera rotation of a ped.
Syntax
bool setPedCameraRotation ( ped thePed, float cameraRotation )
Required Arguments
- thePed: The ped whose camera rotation is to be changed
- cameraRotation: The new direction that the ped will walk if you set their forwards control state
Returns
Returns true if the camera rotation was changed, false otherwise.
Example
--TODO
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
addEventHandler ( 'onClientResourceStart', resourceRoot, function ()
ped = createPed ( 0, 0,0,3) -- create the ped at the coordinate ( x = 0, y = 0, z = 3 )
setPedControlState ( ped, "forwards", true )
addEventHandler ('onClientPedDamage', ped, function () -- add Event when the ped got damaged local rot = getPedCameraRotation ( ped ) -- get the current camera rotation setPedCameraRotation ( ped, rot + 90 ) -- add to the current camerarotation 90 deg. end)
end)