Tony Brand Posted November 7, 2018 Share Posted November 7, 2018 hi, i want to make a system that when player leaves a vehicle, engine turns off and if Vehicle was locked, it gets Unlocked! so i made this in Server Side: addEventHandler ("onPlayerVehicleExit", getRootElement(), function(theVehicle, leftSeat, jackerPlayer) if leftSeat == 0 and not jackerPlayer then setVehicleEngineState(theVehicle, false ) setVehicleLocked(theVehicle, false) end end) but it doesn't work(without any warning or error) and Vehicle is still locked and Engine is on when you enter the vehicle! do you know what i must do? tnx Link to comment
Dimos7 Posted November 7, 2018 Share Posted November 7, 2018 addEventHandler("onVehicleExit", root, function (thePlayer, seat, jacked) if seat ==0 and not jacked then setVehicleEngineState(source, false) setVehicleLocked(source, false) end end ) Link to comment
Tony Brand Posted November 7, 2018 Author Share Posted November 7, 2018 3 minutes ago, Dimos7 said: addEventHandler("onVehicleExit", root, function (thePlayer, seat, jacked) if seat ==0 and not jacked then setVehicleEngineState(source, false) setVehicleLocked(source, false) end end ) it is client side then? Link to comment
Tony Brand Posted November 14, 2018 Author Share Posted November 14, 2018 doesn't work! Link to comment
Dimos7 Posted November 14, 2018 Share Posted November 14, 2018 Any errors or warnings in /debugscipt 3? Link to comment
mazarati21 Posted November 14, 2018 Share Posted November 14, 2018 This code works fine here. function engineoff (thePlayer, seat, jacked) if seat ==0 and not jacked then setVehicleEngineState(source, false) setVehicleLocked(source, false) end end addEventHandler("onVehicleExit", root, engineoff) Server side. Link to comment
Tony Brand Posted November 15, 2018 Author Share Posted November 15, 2018 12 hours ago, Dimos7 said: Any errors or warnings in /debugscipt 3? nothing Link to comment
Tony Brand Posted November 16, 2018 Author Share Posted November 16, 2018 On 15/11/2018 at 01:40, mazarati21 said: This code works fine here. function engineoff (thePlayer, seat, jacked) if seat ==0 and not jacked then setVehicleEngineState(source, false) setVehicleLocked(source, false) end end addEventHandler("onVehicleExit", root, engineoff) Server side. not working!without any error or warning Link to comment
Dimos7 Posted November 16, 2018 Share Posted November 16, 2018 are you sure put it on server side? Link to comment
mazarati21 Posted November 16, 2018 Share Posted November 16, 2018 Yes i put it on server side and it worked Link to comment
Tony Brand Posted November 16, 2018 Author Share Posted November 16, 2018 6 hours ago, Dimos7 said: are you sure put it on server side? yes Link to comment
mazarati21 Posted November 16, 2018 Share Posted November 16, 2018 Create a folder. Then create a meta.xml <meta> <info author="Name" description="Engineoff" version="1.0" type="script" /> <script src="server.lua" type="server" /> </meta> and create another file server.lua function engineoff (thePlayer, seat, jacked) if seat ==0 and not jacked then setVehicleEngineState(source, false) setVehicleLocked(source, false) end end addEventHandler("onVehicleExit", root, engineoff) Link to comment
Tony Brand Posted November 17, 2018 Author Share Posted November 17, 2018 22 hours ago, mazarati21 said: Create a folder. Then create a meta.xml <meta> <info author="Name" description="Engineoff" version="1.0" type="script" /> <script src="server.lua" type="server" /> </meta> and create another file server.lua function engineoff (thePlayer, seat, jacked) if seat ==0 and not jacked then setVehicleEngineState(source, false) setVehicleLocked(source, false) end end addEventHandler("onVehicleExit", root, engineoff) not working!! i solved Engine problem with this code: function engine(player) local veh = getPedOccupiedVehicle (player) setVehicleEngineState ( veh, false ) end addEventHandler("onVehicleEnter", getRootElement(), engine) but i don't have any idea about car locks!it is so crazy that a player can leave a vehicle while it is locked and it doesn't get unlocked! 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