IsPedWearingJetpack
Jump to navigation
Jump to search
Checks whether or not a ped is currently wearing a jetpack.
Syntax
bool isPedWearingJetpack ( ped thePed )
OOP Syntax Help! I don't understand this!
- Method: ped:isWearingJetpack(...)
- Variable: .jetpack
Required Arguments
- thePed: the ped you want to check
Returns
Returns true if the ped is carrying a jetpack, false if he is not or an invalid element was passed.
Example
Click to collapse [-]
ServerExample 1: This examples adds a "jetpack" console command, which toggles a jetpack for the player.
addCommandHandler ( "jetpack", function ( player ) setPedWearingJetpack ( player, not isPedWearingJetpack ( player ) ) end )
Click to collapse [-]
ServerExample 2: This example provides a check to see if players have a jetpack when they enter a particular marker.
function onWarpMarkerHit ( player ) -- check whether the player has a jetpack if ( not isPedWearingJetpack ( player ) ) then -- warp the player to their destination setElementPosition ( player, 1337, 1337, 50 ) else -- tell the player to remove their jetpack outputChatBox ( "You must remove your jetpack to use this marker!", player ) end end -- create a marker and add the function above to its onMarkerHit event addEventHandler ( "onMarkerHit", createMarker( 3180, 200, 27 ), onWarpMarkerHit )
Requirements
This template will be deleted.
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