monstergnom Posted February 13, 2010 Share Posted February 13, 2010 Hello all, I want to shutdown the engine of the car when I'm going out. I used this script: function turnEngineOff ( theVehicle, leftSeat, jackerPlayer ) -- if it's the driver who got out, and he was not jacked, if leftSeat == 0 and not jackerPlayer then -- turn off the engine setVehicleEngineState ( theVehicle, false ) end end -- add 'turnEngineOff' as a handler for "onPlayerExitVehicle" addEventHandler ( "onPlayerExitVehicle", getRootElement ( ), turnEngineOff ) But it didn't work for me. I just searched the forum but didn't find anything... Greets Link to comment
DakiLLa Posted February 13, 2010 Share Posted February 13, 2010 there is a mistake in the example, use the onPlayerVehicleExit event instead of onPlayerExitVehicle Link to comment
Dark Dragon Posted February 13, 2010 Share Posted February 13, 2010 there is a mistake in the example, use the onPlayerVehicleExit event instead of onPlayerExitVehicle if you find mistakes/wrong statements in examples/on wiki pages you should edit them. Link to comment
monstergnom Posted February 13, 2010 Author Share Posted February 13, 2010 ah okay thx =) now it works as well. BTW: Why doesnt slrfuel work for me? Server gets the error: error: .../mods/deathmatch/resources/slrfuel/Server_Petrol.lua:154 attempt to index field '?' What should i do? The Slrfuel thing isnt even shown on my interface Link to comment
robhol Posted February 13, 2010 Share Posted February 13, 2010 We can't really help you unless we can see the script that's throwing off that error - but basically you're trying to use a variable that doesn't exist. Check spelling, capitalization (that CAPITAL letters are being used correctly), etc. (Btw, are you Norwegian? ) Link to comment
monstergnom Posted February 13, 2010 Author Share Posted February 13, 2010 We can't really help you unless we can see the script that's throwing off that error - but basically you're trying to use a variable that doesn't exist. Check spelling, capitalization (that CAPITAL letters are being used correctly), etc.(Btw, are you Norwegian? ) Ok, sorry =) Nah im not norwegian Im talking about this script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=190, i just downloaded it and inserted it into the resources folder, but it wont work just this error i posted in the post above. Link to comment
DakiLLa Posted February 13, 2010 Share Posted February 13, 2010 there is a mistake in the example, use the onPlayerVehicleExit event instead of onPlayerExitVehicle if you find mistakes/wrong statements in examples/on wiki pages you should edit them. already fixed that page after ive posted my first reply in this topic Link to comment
monstergnom Posted February 13, 2010 Author Share Posted February 13, 2010 and how can i shutdown helicopters? setHelicopterRotorSpeed (theVehicle, 0) doenst work, it gets this error: attempt to call global 'setHelicopterRotorSpeed' Link to comment
50p Posted February 13, 2010 Share Posted February 13, 2010 and how can i shutdown helicopters?setHelicopterRotorSpeed (theVehicle, 0) doenst work, it gets this error: attempt to call global 'setHelicopterRotorSpeed' Read wiki PLEASE! This function is available client-side only. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now