Skip to content

Commit

Permalink
Merge pull request #13 from Maximus7474/qb-support
Browse files Browse the repository at this point in the history
feat: support for qb core
  • Loading branch information
Maximus7474 authored Jul 25, 2024
2 parents c8ab085 + 5a85ad2 commit 1f2aa2e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions client/modules/frameworks/qb.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local Framework = {}

local QB = exports["qb-core"]:GetCoreObject()

---Checks if the user has the adequate group
---@param restrictions table
---@return boolean HasGroup
function Framework:HasGroup(restrictions)
local PlayerData = QB.Functions.GetPlayerData()
local playerJob, playerRank = PlayerData.job.name, PlayerData.job.grade.level

for job, grade in pairs(restrictions) do
if job == playerJob and grade <= playerRank then
return true
end
end
return false
end

return Framework
1 change: 1 addition & 0 deletions shared/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ end

function GetFrameworkRequirePath()
if IsResourceStarting('es_extended') then return 'esx' end
if IsResourceStarting('qb-core') then return 'qb' end
return 'standalone'
end

0 comments on commit 1f2aa2e

Please sign in to comment.