Skip to content

Commit

Permalink
refactor: add an esx:onCommand event
Browse files Browse the repository at this point in the history
  • Loading branch information
MoskalykA committed Dec 8, 2023
1 parent 4240253 commit 74c5ba0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion [core]/es_extended/server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
Core.RegisteredCommands[name] = { group = group, cb = cb, allowConsole = allowConsole, suggestion = suggestion }

RegisterCommand(name, function(playerId, args)
local command = Core.RegisteredCommands[name]
TriggerEvent('esx:onCommand', playerId, name, args)

local command = Core.RegisteredCommands[name]
if not command.allowConsole and playerId == 0 then
print(('[^3WARNING^7] ^5%s'):format(TranslateCap('commanderror_console')))
else
Expand Down

0 comments on commit 74c5ba0

Please sign in to comment.