OnClientPedVehicleEnter: Difference between revisions
Jump to navigation
Jump to search
Zangomangu (talk | contribs) (Created page with "{{Client event}} __NOTOC__ {{New feature/item|3.0160|1.5.8|20740|This event is fired when a ped has entered a vehicle.}} ==Parameters== <syntaxhighlight lang="lua"> v...") |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Client event}} | {{Client event}} | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Added feature/item|1.5.9|1.5.8|20740|This event is fired when a [[ped]] has entered a [[vehicle]].}} | ||
==Parameters== | ==Parameters== | ||
Line 7: | Line 7: | ||
vehicle theVehicle, int seat | vehicle theVehicle, int seat | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''theVehicle:''' | *'''theVehicle:''' The [[vehicle]] that the [[ped]] entered. | ||
*'''seat:''' | *'''seat:''' The seat that the ped now is on. Driver's seat = 0, higher numbers are passenger seats. | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the [[ped]] that entered the vehicle. | The [[event system#Event source|source]] of this event is the [[ped]] that entered the [[vehicle]]. | ||
==Example== | ==Example== | ||
This example outputs a text when a ped enters a bike as a driver: | |||
<syntaxhighlight lang="lua"> | |||
function detectVehicleEnterByPed (theVehicle, seat) | |||
if (getVehicleType (theVehicle) == "Bike" and seat == 0) then | |||
outputChatBox ("A ped has entered a bike as a driver!", 0, 255, 0) | |||
end | |||
end | |||
addEventHandler ("onClientPedVehicleEnter", root, detectVehicleEnterByPed) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
===Client ped events=== | ===Client ped events=== | ||
{{Client_ped_events}} | {{Client_ped_events}} | ||
===Client ped functions=== | ===Client ped functions=== | ||
{{Client_ped_functions}} | {{Client_ped_functions}} |
Latest revision as of 17:23, 7 November 2024
This event is fired when a ped has entered a vehicle.
Parameters
vehicle theVehicle, int seat
- theVehicle: The vehicle that the ped entered.
- seat: The seat that the ped now is on. Driver's seat = 0, higher numbers are passenger seats.
Source
The source of this event is the ped that entered the vehicle.
Example
This example outputs a text when a ped enters a bike as a driver:
function detectVehicleEnterByPed (theVehicle, seat) if (getVehicleType (theVehicle) == "Bike" and seat == 0) then outputChatBox ("A ped has entered a bike as a driver!", 0, 255, 0) end end addEventHandler ("onClientPedVehicleEnter", root, detectVehicleEnterByPed)
See Also
Client ped events
- onClientPedDamage
- onClientPedHeliKilled
- onClientPedHitByWaterCannon
- onClientPedVehicleEnter
- onClientPedVehicleExit
- onClientPedWasted
- onClientPedWeaponFire
- onClientPedStep
Client ped functions
- 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