gimicze / firescript

OneSync Infinity compatible fire script for FiveM.
https://forum.cfx.re/t/release-fire-script-onesync/1751606
GNU General Public License v3.0
93 stars 37 forks source link

QBCore #17

Closed BlackDahlia313 closed 5 months ago

BlackDahlia313 commented 3 years ago

I see you have the ability to tie it to a ESX job. Could you please add qbcore support?

Zy0exe commented 3 years ago

@scarecrow313 What do you exactly mean tie to a job, QBCore doesn't really have a "FireFighter" Job or anything related. If you mean just that, there is plenty of examples tru scripts like the police or hospital script.

But if you need help regarding that just reply here

BlackDahlia313 commented 3 years ago

Thanks for the reply!

In the config there is a spot for automatic whitelisting of fire dispatch for a custom job name in ESX.

I'm just wondering if we could do the same thing for qb.

firefighterJobs = { -- If using ESX (Config.Dispatch.enableESX), you can specify which players will count as firefighters in Config.Fire.spawner.players above; If not using ESX you can set this to nil ["fd"] = true -- Always set the job name in the key, value has to be true

enableESX = "fd" -- Set to a ESX job / jobs you want to be automatically subscribed to dispatch; Set to nil or false if you don't want to use this

Looking at the servers main.lua looks like it should be simple enough. Ill let you know what I find in my testing

Zy0exe commented 3 years ago

It is actually just as easy as you think you should be looking forward into rewriting


-- Job --
RegisterNetEvent("esx:setJob")

--Setjob would be:
RegisterNetEvent("QBCore:Client:OnJobUpdate")

--------
RegisterNetEvent("esx:playerLoaded")

--PlayerLoaded would be:
RegisterNetEvent("QBCore:Client:OnPlayerLoaded")

And ofc you need to change the core obj (You can always import the file in the core if you have it and remove this bit of code)

QBCore = nil

TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)

What i meant by "there is plenty of examples throughout the scripts" is there are plenty of pieces of code related to what i just pointed out you need to modify in order to achieve what you want, I won't spoonfeed you with code unless you really can't do it.

P4R4NORM4L commented 2 years ago

I would have to bump this... If you could write a QBcore version of it, that would be awesome!

Zy0exe commented 2 years ago

I would have to bump this... If you could write a QBcore version of it, that would be awesome!

Check the PR'S

P4R4NORM4L commented 2 years ago

Ok Cool I copied the 4 files into my firescript everything works, except for the notification aspect of it, I don't get any notifications at all when a scenario is started. Could you please look into that ?

NVM: I thought the dispatch was automatic, all I needed to do was add myself to the dispatch

Maybe if somehow we could make it so when someone goes on duty they're added directly to the list and vice versa when they go off duty remove them for the list ?

FrequencyRoleplay commented 2 years ago

bump. qbcore looking to implement dispatch.

Zy0exe commented 2 years ago

bump. qbcore looking to implement dispatch.

Can you elaborate?

FrequencyRoleplay commented 2 years ago

bump. qbcore looking to implement dispatch.

Can you elaborate?

Yes, looking to use this on my QBcore server. I could not get any kind of notifications.

Please make away to notify "firefighter" or whatever job role someone configs

Zy0exe commented 2 years ago

bump. qbcore looking to implement dispatch.

Can you elaborate?

Yes, looking to use this on my QBcore server. I could not get any kind of notifications.

Please make away to notify "firefighter" or whatever job role someone configs

The chat gets a red notification, saying the fire has started.

FrequencyRoleplay commented 2 years ago

how would firefighter know where fires are????? need to notify the job and put blip on map for the fire

Zy0exe commented 2 years ago

how would firefighter know where fires are????? need to notify the job and put blip on map for the fire

it does that it's a red blip of a flame

gimicze commented 5 months ago

I see you have the ability to tie it to a ESX job. Could you please add qbcore support?

See #37