onPlayerVehicleEnter
ServerEvent
Fired on the server when a player has finished getting into a vehicle.
addEventHandler("onPlayerVehicleEnter", root, function(vehicle vehicle, int seat, ped|false jacked) … end)
Handler parameters
| Name | Type | Description |
|---|---|---|
| vehicle | vehicle | The vehicle. |
| 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 player.
It also fires when warpPedIntoVehicle puts the ped in the vehicle.
Example
addEventHandler("onPlayerVehicleEnter", root, function(vehicle, seat, jacked)
if seat == 0 then
outputDebugString(getPlayerName(source) .. " pegou o volante")
end
end)