SetPedFrozen: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Server client function}} This function freezes (or un-freezes) a pedestrian, meaning they cannot move, jump, aim, shoot, etcetera. ==Syntax== <syntaxhighlight lang="lua"> bool setPedFrozen ...) |
No edit summary |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
{{Deprecated|setElementFrozen}} | |||
This function freezes (or un-freezes) a pedestrian, meaning they cannot move, jump, aim, shoot, etcetera. | This function freezes (or un-freezes) a pedestrian, meaning they cannot move, jump, aim, shoot, etcetera. | ||
Line 11: | Line 14: | ||
*'''thePed:''' The [[ped]] whose frozen state will be changed. | *'''thePed:''' The [[ped]] whose frozen state will be changed. | ||
*'''frozen:''' A [[bool]] value as to whether the ped is frozen or not. | *'''frozen:''' A [[bool]] value as to whether the ped is frozen or not. | ||
===Returns=== | |||
Returns ''true'' if the frozen state was set successfully, or ''false'' if invalid arguments were passed. | |||
==Example== | ==Example== | ||
This example adds a 'togglefreeze' console command that lets players alternate their frozen state. | This example adds a 'togglefreeze' console command that lets players alternate their frozen state. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function toggleFreeze ( sourcePlayer | function toggleFreeze ( sourcePlayer ) | ||
local frozen = getPedFrozen ( sourcePlayer ) | local frozen = getPedFrozen ( sourcePlayer ) | ||
setPedFrozen ( sourcePlayer, not frozen ) | setPedFrozen ( sourcePlayer, not frozen ) | ||
end | end | ||
addCommandHandler ( "togglefreeze", toggleFreeze ) | addCommandHandler ( "togglefreeze", toggleFreeze ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Ped functions}} | ||
[[ru:setPedFrozen]] |
Latest revision as of 20:18, 23 September 2016
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use setElementFrozen instead. |
This function freezes (or un-freezes) a pedestrian, meaning they cannot move, jump, aim, shoot, etcetera.
Syntax
bool setPedFrozen ( ped thePed, bool frozen )
Required Arguments
- thePed: The ped whose frozen state will be changed.
- frozen: A bool value as to whether the ped is frozen or not.
Returns
Returns true if the frozen state was set successfully, or false if invalid arguments were passed.
Example
This example adds a 'togglefreeze' console command that lets players alternate their frozen state.
function toggleFreeze ( sourcePlayer ) local frozen = getPedFrozen ( sourcePlayer ) setPedFrozen ( sourcePlayer, not frozen ) end addCommandHandler ( "togglefreeze", toggleFreeze )
See Also
- 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