mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 17:23:31 +00:00
old compat
This commit is contained in:
+3
-2
@@ -4,8 +4,9 @@ QBCore.Commands.List = {}
|
|||||||
-- Register & Refresh Commands
|
-- Register & Refresh Commands
|
||||||
|
|
||||||
function QBCore.Commands.Add(name, help, arguments, argsrequired, callback, permission)
|
function QBCore.Commands.Add(name, help, arguments, argsrequired, callback, permission)
|
||||||
|
if not permission then permission = 'user' end
|
||||||
RegisterCommand(name, callback, permission)
|
RegisterCommand(name, callback, permission)
|
||||||
CommandList[name:lower()] = {
|
QBCore.Commands.List[name:lower()] = {
|
||||||
name = name:lower(),
|
name = name:lower(),
|
||||||
permission = tostring(permission:lower()),
|
permission = tostring(permission:lower()),
|
||||||
help = help,
|
help = help,
|
||||||
@@ -20,7 +21,7 @@ function QBCore.Commands.Refresh(source)
|
|||||||
local Player = GetPlayer(src)
|
local Player = GetPlayer(src)
|
||||||
local suggestions = {}
|
local suggestions = {}
|
||||||
if Player then
|
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)
|
local hasPerm = IsPlayerAceAllowed(tostring(src), info.permission)
|
||||||
if hasPerm then
|
if hasPerm then
|
||||||
suggestions[#suggestions + 1] = {
|
suggestions[#suggestions + 1] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user