OnClientPedVehicleExit

From Multi Theft Auto: Wiki
Revision as of 11:55, 14 December 2020 by Remaked (talk | contribs) (→‎Example)
Jump to navigation Jump to search

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


Client ped functions