Regarding explosionEvent event handler

I’ve been making an explosion log recently, and I’ve been trying to improve the accuracy. For obvious reasons (modders reading this), I don’t want to give too much information on the data it collects, but I want to ask some questions in this thread.

The event handler returns 1 argument, containing a table with all the values of the explosion (Position, whether it was on a car, the offset if it was on a car, etc). I found a couple values in this table that stood out: f186, f104, f240, f242 and most other F codes.
I found out that f210 is a vehicle’s network ID, and f190 returns whether the car was caused by a bomb (if f210 is not 0).

I’ve been trying to figure out what all these other values mean, but I can’t find any patterns. Please post your own findings below!

Here’s a picture of how the explosion logger looks:

Here is the information it’ll output:

{"explosionType":0,"isAudible":true,"posX":742.84313964844,"cameraShake":1.0,"isInvisible":true,"ownerNetId":0,"posY":-1808.2889404297,"damageScale":1.0,"posZ":33.105224609375}

Here is more information regarding it:

Hi,
I am looking for people to help discover what these undocumented values do. I have searched far and wide- they are not documented anywhere.

You didn’t look hard enough, nor did you state what you really wanted. Here is the types of explosions if that’s what you’re looking for.
https://runtime.fivem.net/doc/natives/#_0xE3AD2BDBAEE269AC

As for these “unknown variables” the cookbook explains exactly what information is in the table, not sure what you’re confused about.

Hi,
I don’t really feel like arguing, but I did not state I needed explosion types. I stated I needed people to help me test what all the indexes of the first argument for the event handler “explosionEvent”. I explicitly stated that I am looking for explosion.f186, explosion.f104, explosion.f1240, and explosion.f242. If you’d like to help find these values and what their purpose is, please don’t assume that I need something completely different than I asked for. My explosion logger works perfectly. I’m just trying to find a reliable way to check how the explosion was caused (gun, melee, car ramming it, etc). I know that there are simpler ways to check this information, such as constantly recording info on vehicle velocities and objects that can explode, record every time a player shoots, etc.

If you want to be beneficial for this thread, you can help discover what these “f codes” do with this script:

AddEventHandler('explosionEvent', function(source, ev)
    	for i,v in pairs(ev) do
		print(i..": "..tostring(v))
	end
end)

The ones that are already documented:
explosionType: Pretty obvious.
isAudible: If a explosion is audible or not.
posX: X vector of the explosion or offset (if on a car)
posY: Y vector of the explosion or offset (if on a car)
posZ: Z vector of the explosion or offset (if on a car)
cameraShake: how much the explosion makes the camera shake.
isInvisible: Whether an explosion is invisible.
ownerNetId: The person who caused the explosion (spoofable)
damageScale: How large the blast radius is.

The values I’ve found are as follows:
f210: If an explosion was near or on a prop, this is the entity’s network ID. If not, it’s 0.
f190: If the explosion was a bomb type explosion (sticky bomb, etc), and was ON a prop (meaning f210 was not 0)

If you ever tried to do an explosion logger, you’ll notice that if you put a sticky bomb on a prop, the position won’t be correct. This is because gta sets the x,y, and z vectors to the offset of the prop. To get the correct coords, you have to add the offset to the props coords.

2 Likes