Jump to content

getVehicleEngineState


Recommended Posts

Well, I'll make this short and sweet. We've got a setVehicleEngineState, but no method of retrieving what a vehicle is currently set to. It would be nice for a getVehicleEngineState to be implemented, to coincide with the setting of an engine state.

getVehicleEngineState ( vehicle theVehicle )

Required Arguments

  • theVehicle: A handle to the vehicle that you wish to know the light state of.

Returns

Returns a boolean. 0 is engine state off ; 1 is engine state on.

Example:

function GetEngineState( source ) 
    if ( getPlayerOccupiedVehicleSeat ( source ) == 0 ) then 
        local veh = getPlayerOccupiedVehicle ( source ) 
        if ( getVehicleEngineState( veh ) == 1 ) then 
            setVehicleEngineState( veh, 0 ) 
        else 
            setVehicleEngineState( veh, 1 ) 
        end 
    end 
end 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...