baseevents:leftVehicle
Context: server-side client report. The four arguments are the sender’s local vehicle handle, reported seat, display name and network ID. The provider does not emit a matching local client event. Implicit source identifies the session reporting the exit.
Prefer invalidation over an unchecked broadcast
A server.lua listener can discard its own temporary observation:
local lastObservedVehicle = {}
AddEventHandler('baseevents:leftVehicle', function(clientHandle, seat, displayName, netId)
lastObservedVehicle[source] = nil
end)
AddEventHandler('playerDropped', function()
lastObservedVehicle[source] = nil
end)Use the same map as the actual feature’s entry observer. This example deliberately does not forward netId to every client or manipulate a vehicle named by the report. A vehicle may already have disappeared when the server receives the event. Clearing an observation does not need that entity to remain available.
For an operation such as saving a garage vehicle, validate the current entity, ownership, location, permission and transaction state server-side. A reported exit is not proof of any of them, and cancelling this notification is not a supported way to put the player back in the vehicle.
Test normal exits, death while seated, entity removal and disconnect. Keep timeout/disconnect cleanup even if the normal exit event usually arrives; polling and network delivery are not a transactional guarantee.
Source: reviewed stock vehicle checker . Related: enteredVehicle, secure events, stock contracts.