onClientPedVehicleExit | Multi Theft Auto: Wiki Skip to content

onClientPedVehicleExit

Client-side
Server-side
Shared

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

element: The source of this event is the ped that exited the vehicle.

Code Examples

client

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