old compat

This commit is contained in:
Kakarot
2022-03-28 22:00:56 -05:00
parent cc44840df4
commit 94476fee2e
+3 -2
View File
@@ -4,8 +4,9 @@ QBCore.Commands.List = {}
-- Register & Refresh Commands
function QBCore.Commands.Add(name, help, arguments, argsrequired, callback, permission)
if not permission then permission = 'user' end
RegisterCommand(name, callback, permission)
CommandList[name:lower()] = {
QBCore.Commands.List[name:lower()] = {
name = name:lower(),
permission = tostring(permission:lower()),
help = help,
@@ -20,7 +21,7 @@ function QBCore.Commands.Refresh(source)
local Player = GetPlayer(src)
local suggestions = {}
if Player then
for command, info in pairs(CommandList) do
for command, info in pairs(QBCore.Commands.List) do
local hasPerm = IsPlayerAceAllowed(tostring(src), info.permission)
if hasPerm then
suggestions[#suggestions + 1] = {