HU/getPedOccupiedVehicle
Jump to navigation
Jump to search
This function gets the vehicle that the ped is currently in or is trying to enter, if any.
Syntax
vehicle getPedOccupiedVehicle ( ped thePed )
OOP Syntax Help! I don't understand this!
- Note: Set the variable to nil to execute removePedFromVehicle
- Method: ped:getOccupiedVehicle(...)
- Variable: .vehicle
- Counterpart: warpPedIntoVehicle
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 'getcarname' command and is currently in a vehicle, this example outputs the name of the vehicle.
function showVehicleName ( thePlayer ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if theVehicle then outputChatBox ( "Name of the Vehicle: " .. getVehicleName ( theVehicle ), thePlayer ) else outputChatBox ( "You do not have a Vehicle!", thePlayer, 255, 0, 0, true ) end end addCommandHandler ( "getcarname", showVehicleName )
See Also
- HU/addPedClothes
- HU/canPedBeKnockedOffBike
- HU/createPed
- HU/getPedAmmoInClip
- HU/getPedAnalogControlState
- HU/getPedAnimation
- HU/getPedArmor
- HU/getPedBonePosition
- HU/getPedCameraRotation
- HU/getPedClothes
- HU/getPedContactElement
- HU/getPedControlState
- HU/getPedMoveState
- HU/getPedOccupiedVehicle
- HU/getPedOccupiedVehicleSeat
- HU/getPedOxygenLevel
- HU/getPedSimplestTask
- HU/getPedStat
- HU/getPedTarget
- HU/getPedTargetCollision
- HU/getPedTargetEnd
- HU/getPedTargetStart
- HU/getPedTask
- HU/getPedTotalAmmo
- HU/getPedVoice
- HU/getPedWalkingStyle
- HU/getPedWeapon
- HU/getPedWeaponMuzzlePosition
- HU/getPedWeaponSlot
- HU/getValidPedModels
- HU/givePedWeapon
- HU/isPedChoking
- HU/isPedDead
- HU/isPedDoingGangDriveby
- HU/isPedDoingTask
- HU/isPedDucked
- HU/isPedHeadless
- HU/isPedInVehicle
- HU/isPedOnFire
- HU/isPedOnGround
- HU/isPedWearingJetpack
- HU/killPed
- HU/removePedClothes
- HU/removePedFromVehicle
- HU/setAnalogControlState
- HU/setPedAimTarget
- HU/setPedAnalogControlState
- HU/setPedAnimation
- HU/setPedAnimationProgress
- HU/setPedCameraRotation
- HU/setPedCanBeKnockedOffBike
- HU/setPedControlState
- HU/setPedDoingGangDriveby
- HU/setPedFootBloodEnabled
- HU/setPedHeadless
- HU/setPedLookAt
- HU/setPedOnFire
- HU/setPedOxygenLevel
- HU/setPedStat
- HU/setPedTargetingMarkerEnabled
- HU/setPedVoice
- HU/setPedWalkingStyle
- HU/setPedWeaponSlot
- HU/warpPedIntoVehicle