OnClientPedVehicleExit: Difference between revisions
Jump to navigation
Jump to search
Dutchman101 (talk | contribs) m (This example (destroy, not blow up) is more practical.. some noob scripters really use examples without modification - the blast from a blow-up would kill the ped, and they will facepalm) |
|||
Line 16: | Line 16: | ||
This example will immediately delete any vehicle a ped exits if the vehicle's health is below 500. | This example will immediately delete any vehicle a ped exits if the vehicle's health is below 500. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function deleteVehicleOnExit(theVehicle, seat) | ||
local vehHealth = getElementHealth(theVehicle) | local vehHealth = getElementHealth(theVehicle) | ||
if (vehHealth < 500) then | if (vehHealth < 500) then | ||
Line 22: | Line 22: | ||
end | end | ||
end | end | ||
addEventHandler("onClientPedVehicleExit", root, | addEventHandler("onClientPedVehicleExit", root, deleteVehicleOnExit) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 11:55, 14 December 2020
This event is fired when a ped has exited a vehicle.
Parameters
vehicle theVehicle, int seat
- theVehicle: the vehicle that the ped exited.
- seat: the number of the seat that the ped was sitting on.
Source
The source of this event is the ped that exited the vehicle.
Example
This example will immediately delete any vehicle a ped exits if the vehicle's health is below 500.
function deleteVehicleOnExit(theVehicle, seat) local vehHealth = getElementHealth(theVehicle) if (vehHealth < 500) then destroyElement(theVehicle) end end addEventHandler("onClientPedVehicleExit", root, deleteVehicleOnExit)
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