onPlayerVehicleExit
ServerEvent
Fired on the server when a player leaves a vehicle.
addEventHandler("onPlayerVehicleExit", root, function(vehicle vehicle, int seat, ped|false jacker, bool forcedByScript) … end)
Handler parameters
| Name | Type | Description |
|---|---|---|
| vehicle | vehicle | The vehicle. |
| seat | int | The seat: 0 is the driver's, 1 onwards the passengers'. |
| jacker | ped|false | The ped that pulled it out, or false. |
| forcedByScript | bool | true when it was removePedFromVehicle. |
Source
The player.
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("onPlayerVehicleExit", root, function(vehicle, seat, jacker)
if jacker then
outputDebugString(getPlayerName(source) .. " was carjacked")
end
end)