GetPedOccupiedVehicle: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} This function gets the vehicle that the ped is currently in, if any. ==Syntax== <syntaxhighlight lang="lua">vehicle getPedOccupiedVehicle ( ped thePed )</syntaxhighlight> ===Requ...) |
(Server and client now.) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Server client function}} | ||
This function gets the [[vehicle]] that the ped is currently in, if any. | This function gets the [[vehicle]] that the ped is currently in, if any. | ||
Revision as of 23:18, 18 January 2009
This function gets the vehicle that the ped is currently in, if any.
Syntax
vehicle getPedOccupiedVehicle ( ped thePed )
Required Arguments
- thePed: The ped whose vehicle you're looking up.
Returns
Returns the vehicle that the specified ped is in, or false if the ped is not in a vehicle or is an invalid ped.
Example
When a ped enters the 'vehiclename' command and is currently in a vehicle, this example outputs the name of the vehicle.
function showVehicleName ( thePed ) local theVehicle = getPedOccupiedVehicle ( thePed ) if ( theVehicle ) then local vehicleName = getVehicleName ( theVehicle ) outputChatBox ( "Vehicle name: " .. vehicleName, thePlayer ) end end addCommandHandler ( "vehiclename", showVehicleName )
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