Cassandra Posted February 23, 2013 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.
Vision Posted February 23, 2013 Posted February 23, 2013 setVehicleEngineState onVehicleEnter onVehicleExit
Cassandra Posted February 23, 2013 Author Posted February 23, 2013 setVehicleEngineStateonVehicleEnter onVehicleExit Oooh thanks. Did knew that the setVehicleEngineState works with onVehicleEnter/Exit.
Cassandra Posted February 23, 2013 Author 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
Castillo Posted February 23, 2013 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 )
Cassandra Posted February 23, 2013 Author 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.
Cassandra Posted February 23, 2013 Author Posted February 23, 2013 Sorry for bothering and asking questions repeatedly. Do you know how to disable a gta sound?
Cassandra Posted February 23, 2013 Author Posted February 23, 2013 setWorldSoundEnabled Do you know how to play world sound 3d?
Cassandra Posted February 23, 2013 Author Posted February 23, 2013 playSound3D That's what you want? Similar. I want it to play gta world sound instead.
Cassandra Posted February 23, 2013 Author Posted February 23, 2013 Thanks. That what I was looking for.
iPrestege Posted February 23, 2013 Posted February 23, 2013 You're Welcome And if You Need Any Help Just Ask .
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