getVehicleEngineState
Shared
Returns whether a vehicle's engine is on.
bool getVehicleEngineState(vehicle vehicle)
Parameters
| Name | Type | Description |
|---|---|---|
| vehicle | vehicle | The vehicle. |
Returns
true if the engine is on. false if it is off or the element is not a vehicle.
Example
addEventHandler("onVehicleEnter", root, function(ped, seat)
if seat == 0 and not getVehicleEngineState(source) then
setVehicleEngineState(source, true)
end
end)