Jump to content

Turn on/off Engine in Car


monstergnom

Recommended Posts

Hey guys,

im trying to turn on/off the engine if im sitting in car - as driver...

here my code:

function EngineOff ( theVehicle, command )
setVehicleEngineState ( theVehicle , false )
outputChatBox("Engine is now off" , thePlayer)
end
addCommandHandler ( "engineoff", EngineOff )
 
function EngineOn ( theVehicle, command )
setVehicleEngineState ( theVehicle , true )
outputChatBox("Engine is now on" , thePlayer)
end
addCommandHandler ( "engineon", EngineOn )

wont work :/ need help

Link to comment

oh... okay now it works... tyvm

Heres the working script:

function EngineOff ( thePed )
local theVehicle = getPedOccupiedVehicle ( thePed )
 
setVehicleEngineState ( theVehicle , false )
 
outputChatBox("Engine is now off" , thePlayer)
end
addCommandHandler ( "engineoff", EngineOff )
 
function EngineOn ( thePed )
local theVehicle = getPedOccupiedVehicle ( thePed )
setVehicleEngineState ( theVehicle , true )
 
outputChatBox("Engine is now on" , thePlayer)
end
addCommandHandler ( "engineon", EngineOn )

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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