Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
fix(init): QB gang and job check
Browse files Browse the repository at this point in the history
  • Loading branch information
BerkieBb committed Apr 25, 2022
1 parent f47368e commit f560106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -12,7 +12,7 @@
- Define distance on a per-option or overall basis when triggering qtarget function exports
- Ability to redefine or remove options and add new options without replacing old ones
- Update the option list when moving towards or away from a target with variable distances on their options
- Support for entity bones with built-in tables for opening vehicle doors
- Support for entity bones, with built-in tables for opening vehicle doors
- Support checking for job, items, or specific entities
- Utilise the `canInteract` function for advanced checks to show or hide an option based on any trigger
- Improved support when using `ox_inventory`
Expand Down
6 changes: 3 additions & 3 deletions init.lua
Expand Up @@ -146,7 +146,7 @@ CreateThread(function()
JobCheck = function(job)
if type(job) == 'table' then
job = job[PlayerData.job.name]
if PlayerData.job.grade.level >= job then
if job and PlayerData.job.grade.level >= job then
return true
end
elseif job == 'all' or job == PlayerData.job.name then
Expand All @@ -158,10 +158,10 @@ CreateThread(function()
GangCheck = function(gang)
if type(gang) == 'table' then
gang = gang[PlayerData.gang.name]
if PlayerData.gang.grade.level >= gang then
if gang and PlayerData.gang.grade.level >= gang then
return true
end
elseif job == 'all' or gang == PlayerData.gang.name then
elseif gang == 'all' or gang == PlayerData.gang.name then
return true
end
return false
Expand Down

0 comments on commit f560106

Please sign in to comment.