noOx Posted July 18, 2009 Share Posted July 18, 2009 Hi, i have scripted a Engine-Toggle. But the Engine will not turned off. The Source function vehicleEngineToggle(source) playerVehicle = getPedOccupiedVehicle(source) playerSeat = getPedOccupiedVehicleSeat(source) engineState = getVehicleEngineState(playerVehicle) if (playerVehicle) then if (playerSeat == 0) then if (engineState == true) then setVehicleEngineState(playerVehicle, false) outputChatBox("Motor ausgeschaltet", source, 0, 200, 0, true) return else setVehicleEngineState(playerVehicle, true) outputChatBox("Motor eingeschaltet", source, 0, 200, 0, true) end else outputChatBox("Du bist nicht der Fahrer des Fahrzeugs", source, 200, 0, 0, true) end else outputChatBox("Du sitzt in keinem Fahrzeug", source, 200, 0, 0, true) end end addCommandHandler("motor", vehicleEngineToggle, false, false) I dont get a error or something. Link to comment
50p Posted July 18, 2009 Share Posted July 18, 2009 Which message do you see in your chatbox when you try to stop the engine? Link to comment
noOx Posted July 19, 2009 Author Share Posted July 19, 2009 When the Engine is on, and i want to turn off the engine then i see "Motor eingeschaltet = Engine turned on" Link to comment
50p Posted July 19, 2009 Share Posted July 19, 2009 Debug the script by showing some messages, eg. outputChatBox( tostring( engineState ) ) to see what getVehicleEngineState returned. Link to comment
noOx Posted July 19, 2009 Author Share Posted July 19, 2009 I think it gives any problem with getVehicleEngineState, because when the engine turned on i get in the ChatBox a "false" 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