[HELP] Need to know how to make particles sync with other players


#1

Absolutely everything works great now. just finishing up syncing the fires properly and then ill be good to go.

for anyone needing help with particles do

if not HasNamedPtfxAssetLoaded("core") then
						RequestNamedPtfxAsset("core")
						while not HasNamedPtfxAssetLoaded("core") do
							Wait(1)
						end
					end
					SetPtfxAssetNextCall("core")
                               StartParticleFxLoopedAtCoord("enter fx name here", x, y, z-0.7, 0.0, 0.0, 0.0, 1.0, false, false, false, false)

Adding Smoke FX
Fire Script [REQUEST]
Inbuilt Fire Start Command
Fire is only client side. How would I make server sided fire?
[HELP] Problem with particle/sound
#2

Maybe this can help you :slight_smile:

http://runtime.fivem.net/doc/reference.html
(search particle stuff like START_PARTICLE_FX_LOOPED_AT_COORD // 0xE184F4F0DC5910E7 0xD348E3E6)

https://pastebin.com/N9unUFWY
(list of Particle FX’s)


#3

Yea i tried making a particle effect but it just simply didnt work… i mean i think i did it correctly but im not sure. this is what i tried StartParticleFxLoopedAtCoord(“ambient_fire_flames”, x, y, z, 10, 10, 0, 7.0, true, true, true, true)


#4

There’s also http://runtime.fivem.net/doc/reference.html#_0x6B83617E04503888
or
http://runtime.fivem.net/doc/reference.html#_0xF6A9D9708F6F23DF

(idk if it’s working, never test theses natives)


#5

I wonder if it is supposed to be in server file because i cannot get this to work in the client file `RequestNamedPtfxAsset(“fire_wrecked_tank_cockpit”);
while not HasNamedPtfxAssetLoaded(“fire_wrecked_tank_cockpit”) do
RequestNamedPtfxAsset(“fire_wrecked_tank_cockpit”);
Wait(1);
end

local particles = StartParticleFxLoopedAtCoord(“fire_wrecked_tank_cockpit”, x+8, y+3, z, 0, 0, 0, 2.0, false, false, false, false)`

and thanks for your help so far, I really hope i can get this working! Oh and I will be crediting everyone who helps me with this specific problem as co-developers.


#6

If I’m not mistaken, you shouldn’t call RequestNamedPtfxAsset inside of the loop since you’ve already called it before and you’re just waiting for the FX to be loaded. :wink:

I don’t think it belongs to server side by the way.


#7

Yea I have tried with it there, without it there, in a called function, serverside, clientside, within a keybind that calls it and the spawn script every time you press it (got pissed and spammed it a lot) and for proof of consept just to make sure something wasnt wrong with the server i configured it to spawn cars and props on command just to test and that worked fine.

I am really baffled here…


#8

The problem seems to be that the RequestNamedPtfxAsset and/or HasNamedPtfxAssetLoaded is completely breaking the script. so there is something wrong here because i know these are proper functions and they are being used correctly as i see it… Anyone have any ideas?

I tested this by trying to output something simple in chat before and after that code is ran, and the first one sent but the second did not.


#9

I’ve just tried and actually HasNamedPtfxAssetLoaded("fire_wrecked_tank_cockpit") is never true so you’re stuck in the loop.
But there is something else preventing to spawn the fire.


#10

everything should be correct, but if that is never becoming true then it probably wont spawn, and yea i have tried other effects, like 10-20 now i think. The 2 questions im having right now is why that is never true, and why doesnt the fx spawn properly… It makes no sense unless im doing something wrong in the StartParticleFxLoopedAtCoord(“fire_wrecked_tank_cockpit”, x+8, y+3, z, 0, 0, 0, 2.0, false, false, false, false) but i dont know what that would be. Any ideas?

And to be honest im glad its not just me being an idiot. I have been at this for a good 6-7 hours stuck on this one part lol.


#11

:grinning:
All rights, so I figured it out:

if not HasNamedPtfxAssetLoaded("core") then
	RequestNamedPtfxAsset("core")
	while not HasNamedPtfxAssetLoaded("core") do
		Wait(1)
	end
end

UseParticleFxAssetNextCall("core")
local part = StartParticleFxLoopedAtCoord("fire_wrecked_tank_cockpit", playerCoords.x, playerCoords.y, playerCoords.z, 0.0, 0.0, 0.0, 1.0, false, false, false, false)

So, we were both misunderstanding how particle assets works. Actually particle assets is a container for many particles.
You need to load an asset and then call one of its particles.

Also, you need to call UseParticleFxAssetNextCall so the game will know where to find the particle you’re calling.

Thank to this guy in particular: http://gtaforums.com/topic/801286-gta-v-particle-effects/?p=1067603072

Tell me if my code works for you :wink:

I used @Kyominii pastebin to find the asset name (core)


#12

it seems as though UseParticleFxAssetNextCall(“core”) is breaking the script for some reason… I dont know why though, im gonna tinking with it a little and look everything up but in the mean time feel free to throw some ideas at me! and thank you so much for the help so far!


#13

Ok i think i may have found out why, its actually SetPtfxAssetNextCall(name) instead. im testing now.


#14

OMG WE GOT IT TO WORK LOL!!! Thank you so much for your help in this script! Ill be crediting you on release as a co-developer Bob_74 thank you!


#15

It depends of the Native version you’re using (in FiveM client), you define it in your resource with the resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' line.

I use the last version and it is declared as:

function Global.UseParticleFxAssetNextCall(name)
	return _in(0x6C38AF3693A69A91, _ts(name))
end
Global.SetPtfxAssetNextCall = Global.UseParticleFxAssetNextCall

So I’ve prefered to use the fully declared function instead of its copy :yum:

Glad you could make it working, I will certainly use this too!


#16

Now I just need to figure out how to make this fx remove when fire hose or extinguisher hits it… any ideas with that one lol…


#17

http://runtime.fivem.net/doc/reference.html#_0x8F75998877616996


#18

Start a “START_SCRIPT_FIRE” on your fire fx coords, then use “GET_NUMBER_OF_FIRES_IN_RANGE” to know if the fire is still here or not. If not (that mean you’ve extinguished it with your fire extinguisher) you do “STOP_PARTICLE_FX_LOOPED” to stop the fx.


#19

#20