diff --git a/bridge/ox/client.lua b/bridge/ox/client.lua new file mode 100644 index 0000000..8ddca70 --- /dev/null +++ b/bridge/ox/client.lua @@ -0,0 +1,32 @@ +local bridge = {} +local Ox = require '@ox_core/lib/init' + +function bridge.notify(...) + lib.notify(...) +end + +function bridge.hasGroup(groups) + if not groups then return end + + local player = Ox.GetPlayer() + for i=1, #groups do + if player.getGroup(groups[i]) then + return true + end + end +end + +function bridge.getPlayer() + return Ox.GetPlayer() +end + +function bridge.doesPlayerHaveJob(player, job) + return player.getGroup[job] +end + + +AddEventHandler("ox:playerLogout", function() + TriggerEvent("ND_Police:playerUnloaded") +end) + +return bridge diff --git a/bridge/ox/server.lua b/bridge/ox/server.lua new file mode 100644 index 0000000..30f0896 --- /dev/null +++ b/bridge/ox/server.lua @@ -0,0 +1,39 @@ +local bridge = {} +local Ox = require '@ox_core/lib/init' + +function bridge.notify(src, info) + local player = Ox.GetPlayer(src) + if not player then return end + TriggerClientEvent('ox_lib:notify', src, info) + -- player.notify(info) +end + +function bridge.shotSpotter(src, location, coords) + if GetResourceState("ND_MDT") ~= "started" then return end + + exports["ND_MDT"]:createDispatch({ + location = location, + callDescription = "Shotspotter detected gunshot", + coords = coords + }) +end + +function bridge.hasJobs(src, groups) + local player = Ox.GetPlayer(src) + if not player then return end + + for i=1, #groups do + if player.getGroup(groups[i]) then + return true + end + end +end + +function bridge.impoundVehicle(netId, entity, impoundReclaimPrice) + local vehicle = Ox.GetVehicle(entity) + if not vehicle then return end + vehicle.set("impoundReclaimPrice", impoundReclaimPrice) + vehicle.setStored("impound", true) +end + +return bridge diff --git a/data/config.lua b/data/config.lua index 303e78b..e8a3fc0 100644 --- a/data/config.lua +++ b/data/config.lua @@ -2,7 +2,8 @@ return { policeGroups = { "lspd", "sahp", - "bcso" + "bcso", + "police" -- police > lspd }, clearGSR = 15, -- time in minutes diff --git a/data/locker_rooms.lua b/data/locker_rooms.lua index 0164842..a4dc43c 100644 --- a/data/locker_rooms.lua +++ b/data/locker_rooms.lua @@ -4,29 +4,29 @@ local menus = {} menus["lspd"] = { title = "Locker room", - groups = {"lspd"}, + groups = {"lspd", "police"}, locations = { vec3(458.14, -990.82, 30.69) }, options = { { title = "Patrol uniform (long sleeve)", - groups = {"lspd"}, + groups = {"lspd", "police"}, clothing = options.lspd_patrol }, { title = "Patrol uniform (short sleeve)", - groups = {"lspd"}, + groups = {"lspd", "police"}, clothing = options.lspd_patrol2 }, { title = "Patrol uniform (vest) (long sleeve)", - groups = {"lspd"}, + groups = {"lspd", "police"}, clothing = options.lspd_patrol3 }, { title = "Patrol uniform (vest) (short sleeve)", - groups = {"lspd"}, + groups = {"lspd", "police"}, clothing = options.lspd_patrol4 }, {