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
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player that got in. |
| seat | int | The seat: 0 is the driver's, 1 onwards the passengers'. |
| jacked | ped|false | The 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)