Frameworks & permissions
Impact Dynamics only needs a framework for two things: who may force a jammed door and who may sweep debris. Everything else works without one.
Supported
Config.Framework |
Job check |
|---|---|
'auto' (default) |
The first running of the three below, else standalone. |
'qbx_core' |
Job name, grade level, on duty. Items through ox_inventory. |
'qb-core' |
Job name, grade level, on duty. Items through ox_inventory or qb's own. |
'es_extended' |
Job name and grade (ESX has no duty flag - everyone counts as on duty). Items through ox_inventory or ESX's own. |
'standalone' |
Ace permissions. |
The server prints which one it uses on start: [ryan-impactdynamics] framework: qbx_core.
Jobs
Config.DoorJam.Force.Jobs = { police = 0, ambulance = 0, fire = 0 }
Config.Debris.Sweep.Groups = { police = 0, ambulance = 0, fire = 0, mechanic = 0, tow = 0 }
job name = minimum grade. The player must be on that job, at that grade or higher, and on duty. On qbx_core and qb-core a job without an onduty field counts as on duty.
Sweeping is allowed for those jobs or for anyone carrying Config.Debris.Sweep.Item (see Sweeping).
Standalone (ace permissions)
# server.cfg
add_ace group.police impactdynamics.force allow
add_ace group.police impactdynamics.sweep allow
add_principal identifier.license:xxxxxxxx group.police
| Ace | Allows |
|---|---|
impactdynamics.force |
Force a jammed door (with a pry tool in hand). |
impactdynamics.sweep |
Sweep debris. |
Admin commands are for players in the principal group.admin (add_principal identifier.license:xxxxxxxx group.admin) on every framework.
In standalone the "Force the door" option shows for anyone holding a pry tool; the server's ace check decides whether it works.
Inventory
Config.Inventory is 'auto' (default), 'ox_inventory' or 'framework'. 'auto' uses ox_inventory when it runs, else the framework's own inventory. With qbx_core or standalone, items are only counted through ox_inventory. It is only used for Config.Debris.Sweep.Item.
Adding another framework
Open bridge/framework/server.lua and bridge/framework/client.lua (both stay open when escrowed) and add an entry to FRAMEWORKS:
-- bridge/framework/server.lua
FRAMEWORKS.my_framework = {
job = function(src)
local player = exports.my_framework:GetPlayer(src)
if not player then return nil end
return player.job.name, player.job.grade, player.job.onDuty -- name, grade, onduty
end,
items = function(src, item) -- optional
return exports.my_framework:GetItemCount(src, item)
end,
}
-- bridge/framework/client.lua
FRAMEWORKS.my_framework = {
job = function()
local data = exports.my_framework:GetPlayerData()
return data.job.name, data.job.grade, data.job.onDuty
end,
}
Then set Config.Framework = 'my_framework' (or add it to the auto list in both files). A Config.Framework name with no FRAMEWORKS entry falls back to standalone (aces).
The "Force the door" option is an ox_target vehicle option named ryan_impact_forcedoor, if you want to remove or replace it from another script.
The client side only shows or hides the ox_target options. The server always checks again before anything happens.