Cassandra Posted February 23, 2013 Share Posted February 23, 2013 Is there a way to disable the automated engine? If you enter a vehicle, the engine automatically starts and if you leave it stops. Link to comment
Vision Posted February 23, 2013 Share Posted February 23, 2013 setVehicleEngineState onVehicleEnter onVehicleExit Link to comment
Cassandra Posted February 23, 2013 Author Share Posted February 23, 2013 setVehicleEngineStateonVehicleEnter onVehicleExit Oooh thanks. Did knew that the setVehicleEngineState works with onVehicleEnter/Exit. Link to comment
Cassandra Posted February 23, 2013 Author Share Posted February 23, 2013 Didn't worked. Here's the code. for k, v in pairs(getElementsByType("vehicle")) do addEventHandler("onVehicleEnter", v, function(player) setVehicleEngineState(v, getElementData(vehicle, "vehicle.engine")) end ) addEventHandler("onVehicleExit", v, function(player) setVehicleEngineState(v, getElementData(vehicle, "vehicle.engine")) end ) end Link to comment
Castillo Posted February 23, 2013 Share Posted February 23, 2013 That's because "v" and "vehicle" is not defined, also, I don't see why you need to loop all vehicles, you can just attach it to "root". addEventHandler ( "onVehicleEnter", root, function ( player ) setVehicleEngineState ( source, getElementData ( source, "vehicle.engine" ) ) end ) addEventHandler ( "onVehicleExit", root, function ( player ) setVehicleEngineState ( source, getElementData ( source, "vehicle.engine" ) ) end ) Link to comment
Cassandra Posted February 23, 2013 Author Share Posted February 23, 2013 That's because "v" and "vehicle" is not defined, also, I don't see why you need to loop all vehicles, you can just attach it to "root". addEventHandler ( "onVehicleEnter", root, function ( player ) setVehicleEngineState ( source, getElementData ( source, "vehicle.engine" ) ) end ) addEventHandler ( "onVehicleExit", root, function ( player ) setVehicleEngineState ( source, getElementData ( source, "vehicle.engine" ) ) end ) Aaaahaaa. Silly mistake. Edit: Thanks it works now. Link to comment
Cassandra Posted February 23, 2013 Author Share Posted February 23, 2013 Sorry for bothering and asking questions repeatedly. Do you know how to disable a gta sound? Link to comment
Cassandra Posted February 23, 2013 Author Share Posted February 23, 2013 setWorldSoundEnabled Do you know how to play world sound 3d? Link to comment
Castillo Posted February 23, 2013 Share Posted February 23, 2013 playSound3D That's what you want? Link to comment
Cassandra Posted February 23, 2013 Author Share Posted February 23, 2013 playSound3D That's what you want? Similar. I want it to play gta world sound instead. Link to comment
iPrestege Posted February 23, 2013 Share Posted February 23, 2013 playSoundFrontEnd ?? Link to comment
Cassandra Posted February 23, 2013 Author Share Posted February 23, 2013 Thanks. That what I was looking for. Link to comment
iPrestege Posted February 23, 2013 Share Posted February 23, 2013 You're Welcome And if You Need Any Help Just Ask . 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