M MY Multiplayer: Wiki
Side
Kind

onVehicleEnter

ServerEvent

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

addEventHandler("onVehicleEnter", root, function(ped ped, int seat, ped|false jacked) … end)

Handler parameters

NameTypeDescription
pedpedThe ped or player that got in.
seatintThe seat: 0 is the driver's, 1 onwards the passengers'.
jackedped|falseThe ped that was in the seat and was taken out, or false.

Source

The vehicle.

It also fires when warpPedIntoVehicle puts the ped in the vehicle. When the driver gets in, the engine starts.

Example

addEventHandler("onVehicleEnter", root, function(ped, seat)
    if seat == 0 and getElementType(ped) == "player" then
        setElementData(source, "dono", getPlayerName(ped))
    end
end)

See also