setPedEnterVehicle
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function makes a ped enter a vehicle, similar to the enter_exit control state.
This function only works on synced peds and vehicles (ie. created serverside).
This function only works within the following limits: If forced to enter as a passenger, it doesn't work if all passenger seats are occupied. Only the driver seat can be jacked. If forced to enter as a driver, the ped can carjack the current driver. If the driver's door is blocked by something, the ped can use the opposite front door to reach the driver's seat, jacking the passenger in the process. If a vehicle is not specified: The ped will search for a vehicle door within 20 m. If the vehicle has a driver, the limit becomes 10 m. If a vehicle is specified: The vehicle has to be within 50 m. The doors aren't taken into account. It means that it doesn't work if the vehicle's door is in range but the vehicle itself is not. If the vehicle has a driver, the limit becomes 10 m. When entering, the ped will run toward a vehicle if it is less than 50 m away. The ped reserves the seat he is trying to use. It means nobody can enter the respective seat while the ped is running toward it. Exception: If the ped is forced to enter as a passenger and is going to use the front door, the ped can wait if someone is using it to go the driver seat.
Syntax
setPedEnterVehicle ( )Code Examples
local sweet = createPed (270, 0, 0, 3)setElementID (sweet, "sweet")
local sweetscar = createVehicle (492, 3, 0, 3)setElementID (sweetscar, "sweetscar")See Also
Ped Functions
- addPedClothes
- canPedBeKnockedOffBike
- createPed
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedGravity
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedBleeding
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- IsPedFootBloodEnabled
- isPedHeadless
- isPedInVehicle
- isPedOnGround
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- isPedWearingJetpack
- killPed
- playPedVoiceLine
- reloadPedWeapon
- removePedClothes
- removePedFromVehicle
- resetPedVoice
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedChoking
- setPedControlState
- setPedDoingGangDriveby
- setPedEnterVehicle
- setPedExitVehicle
- setPedFightingStyle
- setPedFootBloodEnabled
- setPedGravity
- setPedHeadless
- setPedLookAt
- setPedOxygenLevel
- setPedStat
- setPedTargetingMarkerEnabled
- setPedVoice
- setPedWalkingStyle
- setPedWeaponSlot
- setPedWearingJetpack
- warpPedIntoVehicle