SetPedRotation: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 15: | Line 15: | ||
Returns ''true'' if successful, ''false'' otherwise. | Returns ''true'' if successful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | |||
This example allows a player to type the command 'disco', which will result in the player being rotated to a random direction every 1 second, infinite times. | This example allows a player to type the command 'disco', which will result in the player being rotated to a random direction every 1 second, infinite times. | ||
<syntaxhighlight lang="lua">function discoTime ( ) | <syntaxhighlight lang="lua">function discoTime ( ) | ||
Line 27: | Line 28: | ||
setTimer (discoTime, 1000, 0 ) | setTimer (discoTime, 1000, 0 ) | ||
end | end | ||
addCommandHandler ( "disco", initiateDiscoMode )</syntaxhighlight> | addCommandHandler ( "disco", initiateDiscoMode ) | ||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{Client_ped_functions}} | {{Client_ped_functions}} |
Revision as of 20:33, 25 May 2008
This function allows you to set the current rotation of the specified ped.
Syntax
bool setPedRotation ( ped thePed, float rotation )
Required Arguments
- thePed: The ped to set the rotation of
- rotation: A float specifying the desired rotation in degrees.
Returns
Returns true if successful, false otherwise.
Example
Click to collapse [-]
ClientThis example allows a player to type the command 'disco', which will result in the player being rotated to a random direction every 1 second, infinite times.
function discoTime ( ) -- Randomly choose a new player rotation and set it newRotation = math.random ( 0, 360 ) setPedRotation ( getLocalPlayer(), newRotation ) end function initiateDiscoMode ( commandName ) -- Trigger a random change in player rotation every second setTimer (discoTime, 1000, 0 ) end addCommandHandler ( "disco", initiateDiscoMode )
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