Stop Script Fire

Hey there!
We found this script for fire from @Deziel0495.
https://forum.cfx.re/t/release-meth-lab-fire/6821
So, now we’re looking for a script or help with a script that can STOP the script fires.
We’ve seen RemoveScriptFire(fireHandle), but what is the “fireHandle” part???
We’ve tried stopFireInRange(x, y, z, radius), but it doesn’t work.

Any help would be great!!
Thanks so much!

1 Like

RemoveScriptFire(fireHandle) ??? !!!

What is Firehandle though???

StartScriptFire is not return value ?

All we have for starting the fire is StartScriptFire (x, y, z, 25, true). Still learning scripting and have no idea what the “fireHandle” would be. The other you posted didn’t work either :-/ (Thanks for responding, btw!!!)

??? StartScriptFire return value number

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
        local Fire = nil
		if IsControlPressed(1, 38) then
		   Fire = StartScriptFire (-800.0, -3002.0, 13.0, 25, true)
           Citizen.Trace("value :" ..Fire)
		end
        if IsControlPressed(1, 28) then
		   RemoveScriptFire(Fire)
		end
	end
end)
1 Like

@lebreton thanks for your post!

im a little confused what this line is for “Citizen.Trace(“value :” …Fire)”

The script i am working on has a little over 40+
startScriptFire (x, y, z 25 true) lines

so are you stating that if i added "Fire = " before each “StartScriptFire” that RemoveScriptFire(Fire) would stop all 40+ fires?

Thanks in advance!

I’m not sure about testing,

You should save array and remove in loop

“Citizen.Trace (” value: “… Fire)”
Console Game F8

value:4
value:5
… etc.

Citizen.Trace is print Gta5 Lua

I attempted the script you posted with the “RemoveScriptFire(Fire)” but the fire still will not go away.

Here is what i got so far - for testing:

Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local Fire = nil
if (GetClockHours() == 20 and GetClockMinutes() == 0 and GetClockSeconds() > 5 and GetClockSeconds() < 7) then
Fire = StartScriptFire(1420.16, 3611.53, 38.0179, 25, true)
Citizen.Trace(“value :” …Fire)
end
if (GetClockHours() == 20 and GetClockMinutes() == 1 and GetClockSeconds() > 10 and GetClockSeconds() < 50) then
RemoveScriptFire(Fire)
end
end
end)

1 Like

You could try and use

StopFireInRange(float x, float y, float z, float radius)

Then set the position to the players position or the position of the fire and trigger it.

1 Like

It works if you want !

Fire = {}
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if IsControlPressed(1, 38) then
		   table.insert(Fire,StartScriptFire (1420.16, 3611.53, 38.0179, 25, true))
		end
        if IsControlPressed(1, 27) then
		   for i=1,#Fire do
		     Citizen.Trace("RemoveScriptFire ! " .. Fire[i])
		   	 RemoveScriptFire(Fire[i])
		   end
		   Fire = {}
		end
	end
end)

1 Like

But then that would stop all fires, if he just wanted to stop a certain portion of it I think the native I posted would be best.

Just Exemple code man :smile:
It is for him shown how to remove the fires

The StartScriptFire () adds more fires you presses more e ta of the fires that spawn

Oh no man ha I know! I was just saying so he had the other Native as well.

Should not put it in a while but in an event you call that when you want to add lights in a while its add loop with a key if no you will lose id of the fire

Success! Thanks for all your help!

@lebreton

Fire = {}
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlPressed(1, 38) then
table.insert(Fire,StartScriptFire (1420.16, 3611.53, 38.0179, 25, true))
end
if IsControlPressed(1, 27) then
for i=1,fire do
Citizen.Trace("RemoveScriptFire ! " … Fire[i])
RemoveScriptFire(Fire[i])
end
Fire = {}
end
end

is exactly what we needed!