M MY Multiplayer: Wiki
Side
Kind

getVehicleController

Shared

Returns who is driving a vehicle, that is the occupant of seat 0.

ped|false getVehicleController(vehicle vehicle)

Parameters

NameTypeDescription
vehiclevehicleThe vehicle.

Returns

The ped or player in the driver's seat, or false if nobody is there or the element is not a vehicle.

Example

addEventHandler("onVehicleExit", root, function()
    if not getVehicleController(source) then
        setVehicleEngineState(source, false)
    end
end)

See also