onClientPlayerVehicleExit | Multi Theft Auto: Wiki Skip to content

onClientPlayerVehicleExit

Client-side
Server-side
Shared

This event is triggered when a player has exited a vehicle.

Parameters

vehicle theVehicle, int seat
  • theVehicle: the vehicle that the player exited.
  • seat: the number of the seat that the player was sitting on.

Source

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

Code Examples

client

This example outputs a chat box message with player's name and vehicle name when someone leave vehicle.

addEventHandler("onClientPlayerVehicleExit", getRootElement(),
function (vehicle, seat)
local vehicleName = getVehicleName(vehicle)
outputChatBox("Player " .. getPlayerName(source) .. " has left the " .. vehicleName)
end)

See Also