M MY Multiplayer: Wiki
Side
Kind

onPedVehicleExit

ServerEvent

Fired on the server when a ped (not a player) leaves a vehicle.

addEventHandler("onPedVehicleExit", root, function(vehicle vehicle, int seat, ped|false jacker, bool forcedByScript) … end)

Handler parameters

NameTypeDescription
vehiclevehicleThe vehicle.
seatintThe seat: 0 is the driver's, 1 onwards the passengers'.
jackerped|falseThe ped that pulled it out, or false.
forcedByScriptbooltrue when it was removePedFromVehicle.

Source

The ped.

It also fires when the ped falls off a bike, is pulled out, dies, leaves the server, moves to another dimension or is taken out by removePedFromVehicle.

Example

addEventHandler("onPedVehicleExit", root, function(vehicle, seat)
    if seat == 0 then
        setVehicleEngineState(vehicle, false)
    end
end)

See also