[Release] Fire Script [OneSync]

do

TriggerServerEvent(‘fireDispatch:registerPlayer’, -1, subscribe)

and

TriggerServerEvent(‘fireDispatch:removePlayer’, -1, unsubscribe)

and make vRP.hasPermission

what I have made is (IT IS vRP2)

 function Functions:onDuty()
 TriggerServerEvent('fireDispatch:registerPlayer', -1, subscribe)
 end
function Functions:offDuty()
TriggerServerEvent('fireDispatch:removePlayer', -1, unsubscribe)
end

and add it in Groups
vRP.EXT.Functions.remote._onDuty(user.source)
vRP.EXT.Functions.remote._offDuty(user.source)

so for vrp

RegisterServerEvent('fd:checkjob')
AddEventHandler('fd:checkjob', function()
	local source = source
    local user_id = vRP.getUserId({source})
    local player = vRP.getUserSource({user_id})

    if vRP.hasPermission({user_id,"fire.fd"}) then --here check if you have permission
      TriggerEvent('fireDispatch:registerPlayer', -1, subscribe)
    else
      TriggerEvent('fireDispatch:removePlayer', -1, unsubscribe)
    end
end)

add it somewhere ???

TriggerServerEvent(fd:checkjob’)

I’ll look into implementing vRP in the future, won’t be any time soon though. In the meantime you can try to implement it yourself by using the above mentioned events when a user goes on/off duty. You could probably do that simply by editing your existing FD job script.

So I’ve download, added resource, gone into server.cfg and done
add_ace group.user “firescript.all” allow
add_ace group.superadmin “firescript.all” allow
add_ace group.admin “firescript.all” allow
add_ace group.moderator “firescript.all” allow

but still recieve insufficient permissions

As far as I can tell the “fireDispatch:registerPlayer” event handler is broken.

If I trigger it like this from a server script:

RegisterCommand('onfireduty', function(source, args)
	
	TriggerEvent('fireDispatch:registerPlayer', source, true)
end)

I get this:
image

If I add print(source) just above line 482 it prints a blank line to the console, so I’m not sure if it’s something wrong with your script or a bug in the server artifact.

The following method works just fine for me (note that I am using artifact 3539):

server.cfg

add_ace group.admin "firescript.all" allow
add_principal identifier.steam:1100001-------- group.admin

Check that you are assigning the users principals correctly.

@Drift_91

Thank you for your bug report. As for the error, I am not sure what has changed but the source now returns empty string. I added a check so that there are no problems with that whether it’s supposed to be that way or not. Update to version v1.7.1 for the fix.

No problem. However I suspect the empty string is likely unintended behaviour. Might want to report that to the Elements somehow.

If you’re using group.user for everyone on the server it might be easier to use builtin.everyone so you don’t have to add everyone’s identifier to it. Just a little tip to make things easier, if that is how you’re using it. If you’re still having trouble with ace permissions you can check out Vespura’s guide on aces & principals for information.

So i use add_ace builtin.everyone “firescript.all” allow, in server.cfg it still says insufficient permissions, i believe its because of VMenu also??

Your vMenu setup might affect it, but shouldn’t do anything which would block this in any way. Hit me a DM, I’ll send you a contact on which you can reach me and I’ll try to help you when I have the time to do so.

@GIMIcz Do you think I could edit this script and add an explosion command to it?

or if you have the time to do so?

Feel free to do that under the terms stated in the license :slight_smile:

Alright thanks!

I can push a pull request once I figure it out.

1 Like

If I create a fire with flames, I get a dispatch but the fire is invisible

Very nice script and working well

1 Like

Awesome Script! Please add an Option for Pre-Generated Fire Locations

I’ve had trouble putting out fires that are registered fires, spawned by the server. Do you know anything about this problem? This is my only error:


Hi!

Thank you for the bug report. As for the problem, I haven’t noticed anything last time I tested the script (just after releasing the last version). I will however have a look at it when I get back from my vacation. Until then, please send me these information in a DM:

  • more detailed description of what happens (does this happen every time, etc.)
  • what do you mean by putting out the fire (are you trying to do that using command / by extinguishing it in-game?)
  • when did this start to happen?
  • your fires.json and config.lua

Apart from that, you may also try placing the fires.json file elsewhere temporarily and setting the fires up again; perhaps that could help.

I will get back to you when I will have tried some things according to your description I await.

1 Like

Hey there! i think im to dump for this Script im trying to Spawn / Create random fires but i cant in the “fires.json” is no fire listed and sometimes say it Access denied. Please Help!

Somehow it blocks the HoseLS script…

it works fine with HoseLS

but trying to make a dispatch, it dont work

if Config.Dispatch.enabled == true then
	RegisterNetEvent('fd:dispatch')
	AddEventHandler(
		'fd:dispatch',
		function(coords)
			local streetName, crossingRoad = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
			local streetName = GetStreetNameFromHashKey(streetName)
			
			-- dispatch
			local dispatch4 = {
					code = "there is fire",
						streetName = GetStreetName(crossingRoad),
						id = 1,
						priority = 3,
						title = message,
						position = {
							x = coords.x,
							y = coords.y,
							z = coords.z
						},
						blipname = "Fire",
						color = 3,
						sprite = 61,
						fadeOut = 30,
						duration = 10000
			}
			
			--local text = ("Fire %s."):format((crossingRoad > 0) and streetName .. " / " .. GetStreetNameFromHashKey(crossingRoad) or streetName)
			--TriggerServerEvent('fireDispatch:create', text, coords)
			TriggerServerEvent("dispatch:svNotify", dispatch4)
		end
	)
end

sometimes i’m just stupid and can not figure it out :sweat_smile: