CanPedBeKnockedOffBike: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 7: | Line 7: | ||
bool canPedBeKnockedOffBike ( ped thePed ) | bool canPedBeKnockedOffBike ( ped thePed ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[ped]]:canBeKnockedOffBike||setPedCanBeKnockedOffBike}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 15: | Line 17: | ||
==Example== | ==Example== | ||
This example adds a console command with which the local player can toggle whether he can fall off bikes. | |||
<syntaxhighlight lang="lua"> | |||
function changeCanBeKnockedOff ( command ) | |||
-- lets players be knocked off bikes if it was set to false, true otherwise | |||
local bCanBeKnockedOff = canPedBeKnockedOffBike(localPlayer) | |||
setPedCanBeKnockedOffBike(localPlayer, not bCanBeKnockedOff) | |||
-- outputs the respective message | |||
outputChatBox( ('Now you %s be knocked off your bike.'):format(bCanBeKnockedOff and 'can\'t' or 'can') ) | |||
end | |||
addCommandHandler('knock', changeCanBeKnockedOff) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{Client_ped_functions}} | {{Client_ped_functions}} | ||
[[hu:canPedBeKnockedOffBike]] |
Latest revision as of 18:25, 7 October 2018
This function checks if the given ped can fall off bikes.
Syntax
bool canPedBeKnockedOffBike ( ped thePed )
OOP Syntax Help! I don't understand this!
- Method: ped:canBeKnockedOffBike(...)
- Counterpart: setPedCanBeKnockedOffBike
Required Arguments
- thePed: the ped you want to check.
Returns
Returns true if the ped can be knocked off bikes, false if he cannot or an invalid element was passed.
Example
This example adds a console command with which the local player can toggle whether he can fall off bikes.
function changeCanBeKnockedOff ( command ) -- lets players be knocked off bikes if it was set to false, true otherwise local bCanBeKnockedOff = canPedBeKnockedOffBike(localPlayer) setPedCanBeKnockedOffBike(localPlayer, not bCanBeKnockedOff) -- outputs the respective message outputChatBox( ('Now you %s be knocked off your bike.'):format(bCanBeKnockedOff and 'can\'t' or 'can') ) end addCommandHandler('knock', changeCanBeKnockedOff)
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