getVehicleController
Shared
Returns who is driving a vehicle, that is the occupant of seat 0.
ped|false getVehicleController(vehicle vehicle)
Parameters
| Name | Type | Description |
|---|---|---|
| vehicle | vehicle | The 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)