onClientVehicleStartEnter | Multi Theft Auto: Wiki Skip to content

onClientVehicleStartEnter

Client-side
Server-side
Shared

This event is triggered when a ped or player starts entering a vehicle. Once the entering animation completes, onClientVehicleEnter is triggered.

Parameters

ped thePed, int seat, int door
  • thePed: the ped that just started entering a vehicle.
  • seat: the number of the seat he is going to sit on.
  • door: An integer of which door the ped used (0-3). 0 is driver side door, 1 is front passenger, 2 is back left, 3 is back right.

Source

element: The source of this event is the vehicle the ped is entering.

Canceling

This event can be canceled, but only for the local player or peds synced by the client. If cancelled, they will not begin to the enter the vehicle.

Code Examples

client

This example outputs if the local player is about to enter the drivers seat.

addEventHandler("onClientVehicleStartEnter", root, function(player,seat,door)
if (player == localPlayer and seat == 0)then
outputChatBox("You are going to sit in the drivers seat.")
end
end)

See Also

Vehicle Functions