Jump to content

getVehicleEngineState error


manuelhimmler

Recommended Posts

Why I get an "attempt to call global 'getVehicleEngineState' (a nil value)" - error, when I use this script. I press m to start my engine but I only get an error:

function engine(theplayer,key,keystate,car) 
  
if getVehicleController(car)==theplayer then 
  
    setVehicleEngineState(car, not getVehicleEngineState(car)) 
     
end 
  
end 
  
function keybindson(theplayer) 
  
bindKey(theplayer,"l","down",lights,source) 
setVehicleOverrideLights(source,1) 
outputChatBox("Drücke L um das Licht einzuschalten!",playerid) 
  
bindKey(theplayer,"m","down",engine,source) 
setVehicleEngineState(source,false) 
outputChatBox("Drücke M um den Motor zu starten!",playerid) 
  
  
end 
  
addEventHandler("onVehicleEnter",getRootElement(),keybindson) 

Link to comment
Thanks buffalo, but I've forgotten to search. I don't know why I can't use this function, it is on wiki.multitheftauto.com listed. Can anybody tell me what this "DP" means and where I can get a newer. I think I have 2.3 or 2.5, I don't know it yet.

DP mean Developer Preview, so it's not a full version yet, but just to show people what's coming.

Your version is probably 2.3, since 2.5 doesn't exist. This function is probably on the wiki because it'll be added in 1.0. Weird thing is that the function lists don't mention that...

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...