onClientPedVehicleEnter | Multi Theft Auto: Wiki Skip to content

onClientPedVehicleEnter

Client-side
Server-side
Shared

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

Parameters

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

Source

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

Code Examples

client

This example outputs a text when a ped enters a bike as a driver:

function detectVehicleEnterByPed (theVehicle, seat)
if (getVehicleType (theVehicle) == "Bike" and seat == 0) then
outputChatBox ("A ped has entered a bike as a driver!", 0, 255, 0)
end
end
addEventHandler ("onClientPedVehicleEnter", root, detectVehicleEnterByPed)

See Also