onClientPlayerVehicleEnter | Multi Theft Auto: Wiki Skip to content

onClientPlayerVehicleEnter

Client-side
Server-side
Shared

This event is fired when a player has entered a vehicle.

Parameters

vehicle theVehicle, int seat
  • theVehicle: the vehicle that the player entered
  • seat: the seat that the player now is on. Driver's seat = 0, higher numbers are passenger seats.

Source

element: The source of this event is the player that entered the vehicle.

Code Examples

client

This example will tell you the name of the vehicle you enter.

function checkVehicles(theVehicle)
outputChatBox("You entered a "..getVehicleName(theVehicle).."!")
end
addEventHandler("onClientPlayerVehicleEnter", localPlayer, checkVehicles)

See Also