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)
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)
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
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.
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.
I don’t think it belongs to server side by the way.
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.
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.
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.
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.
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.
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!
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
Glad you could make it working, I will certainly use this too!
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.