OnClientPedVehicleEnter

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

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

Example

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)

Requirements

Minimum server version n/a
Minimum client version 1.5.8-9.20740

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.8-9.20740" />

See Also

Client ped events


Client ped functions