M MY Multiplayer: Wiki
Side
Kind

onClientVehicleEnter

ClientEventCancellable

Fired on the client when a ped has finished getting into a vehicle.

addEventHandler("onClientVehicleEnter", root, function(ped ped, int seat) … end)

Handler parameters

NameTypeDescription
pedpedThe ped or player that got in.
seatintThe seat: 0 is the driver's, 1 onwards the passengers'.

Source

The vehicle.

Cancelling only works when a ped created on this client gets into a vehicle created on this client: the ped is put back out. Otherwise cancelling changes nothing.

Example

addEventHandler("onClientVehicleEnter", root, function(ped, seat)
    if ped == localPlayer and seat == 0 then
        outputDebugString("You are driving")
    end
end)

See also