Jump to content

[HELP] Make second exhaust give out smoke as well


koragg

Recommended Posts

Hey guys,

Been almost a year since I did something with MTA's Lua but now got interested and made a race map using this Chevrolet Impala 1967 model to replace the Clover. As you can probably guess I'm a huge fan of Supernatural and want to have every detail like it is on the show. So here's my question: How to make the right exhaust of the car emmit smoke as does the left one? I've seen double exhaust cars in GTA:SA (I think one was the Banshee but I can be wrong) but I want to use the Clover in this map as its handling is perfect. Any ideas?
The only thing I could find was this topic but I am not familiar at all with .dff editing etc and the guy who suggested that hasn't been active for 2-3 years now: 

 

Link to comment

So I should use

setVehicleHandling

but it needs Hexadecimal/Decimal value for the modelFlags according to the Wiki. How exactly should this be done as there are none such given where DBL_EXHAUST is? I opened the handling.cfg of GTA:SA and there it says this:

; (af) modelFlags!!!  WARNING - Now written HEX for easier reading of flags
;
;	1st digit	1: IS_VAN			2: IS_BUS			4: IS_LOW				8: IS_BIG
;	2nd digit	1: REVERSE_BONNET	2: HANGING_BOOT		4: TAILGATE_BOOT		8: NOSWING_BOOT
;	3rd digit	1: NO_DOORS			2: TANDEM_SEATS		4: SIT_IN_BOAT			8: CONVERTIBLE
;	4th digit	1: NO_EXHAUST		2: DOUBLE_EXHAUST	4: NO1FPS_LOOK_BEHIND	8: FORCE_DOOR_CHECK
;	5th digit	1: AXLE_F_NOTILT	2: AXLE_F_SOLID		4: AXLE_F_MCPHERSON		8: AXLE_F_REVERSE
;	6th digit	1: AXLE_R_NOTILT	2: AXLE_R_SOLID		4: AXLE_R_MCPHERSON		8: AXLE_R_REVERSE
;	7th digit	1: IS_BIKE			2: IS_HELI			4: IS_PLANE				8: IS_BOAT
;	8th digit	1: BOUNCE_PANELS	2: DOUBLE_RWHEELS	4: FORCE_GROUND_CLEARANCE	8: IS_HATCHBACK

 

Edited by koragg
Link to comment
  • Administrators
1 minute ago, koragg said:

So I should use


setVehicleHandling

but it needs Hexadecimal/Decimal value for the modelFlags according to the Wiki. How exactly should this be done as there are none such given where DBL_EXHAUST is?

That's correct.

I use CFG Studio by the same author as the initial article I sent, it's incredibly useful to generate decimal values (or however they're called) by simply clicking the checkboxes which then adds to the value, from there you can copy it and add "0x" behind it, for instance "0x00002000" is the flag for DBL_EXHAUST only. You can opt to enable more flags for modelFlags if you so desire.

unknown.png

 

You open the file "handling" in GTA SA directory\data\ and can reference what default GTA vehicles use for their modelFlags etcetera. It helped me a bunch. :)

 

http://projectcerbera.com/tools/cfgstudio2/

  • Thanks 1
Link to comment
  • Administrators
10 minutes ago, koragg said:

It doesn't seem to work. Should the default GTA:SA car have two exhausts or this would work even if it doesn't? The Clover has only one exhaust, but my custom model has two.

I believe it mirrors the exhaust from one side another, regardless of which side the exhaust is placed on the model.

Can you please try adding Hedit to your server, add the flag to the vehicle and see if it works. It might be a scripting related issue on your end if so. Unfortunately I don't do coding so I'd leave that to the coding community to help you with. (I get to mess with scripts through my community :mrgreen:)

Hedit: https://community.multitheftauto.com/index.php?p=resources&s=details&id=3716

Edited by Tut
  • Like 1
Link to comment

It seems like it doesn't set the handling at all. I use this to set it:

for k, v in ipairs(getElementsByType("vehicle")) do
  local model = getElementModel(v)
  if model == 542 then
    setVehicleHandling(v, "modelFlags", 0x00002000)
  end
end

also tried with

setVehicleHandling(v, "modelFlags", tonumber("0x00002000"))

but nothing. I also made a command which gets my current vehicle's modelFlags value and it always seems to be the exact same one - doesn't matter if I set it to 0x00002000 or not. Here's that function:

function asdas()
	local handlingTable = getVehicleHandling(getPedOccupiedVehicle(localPlayer))
	local value = handlingTable["modelFlags"]
	outputChatBox(value)
end
addCommandHandler("go", asdas)

Will try with Hedit now.

@Tut indeed it does work when I set it with hedit :o

  • Like 1
Link to comment
--client-side code
addEventHandler ( "onClientVehicleEnter", root,
	function ()
		iprint(setVehicleHandling(source, "modelFlags", 0x00002000), "client-side")
	end
)

--server-side code
addEventHandler ( "onPlayerVehicleEnter", root,
	function(theVehicle)
		iprint(setVehicleHandling(theVehicle, "modelFlags", 0x00002000), "server-side")
	end
)

client side returns false for some reason, server side works great. Weird

  • Like 1
Link to comment
7 minutes ago, AleksCore said:

client side returns false for some reason, server side works great. Weird

Client-side variant of setVehicleHandling can only modify handling of vehicles which are local only, i.e. client-side vehicles that don't exist on the server side, which a player cannot enter.

  • Like 1
  • Thanks 2
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...