mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Added invalid command handler
This commit is contained in:
@@ -193,6 +193,14 @@ function loadESXPlayer(identifier, playerId)
|
||||
end)
|
||||
end
|
||||
|
||||
AddEventHandler('chatMessage', function(playerId, author, message)
|
||||
if message:sub(1, 1) == '/' and playerId > 0 then
|
||||
CancelEvent()
|
||||
local commandName = message:sub(1):gmatch("%w+")()
|
||||
TriggerClientEvent('chat:addMessage', playerId, {args = {'^1SYSTEM', _U('commanderror_invalidcommand', commandName)}})
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('playerDropped', function(reason)
|
||||
local playerId = source
|
||||
local xPlayer = ESX.GetPlayerFromId(playerId)
|
||||
|
||||
Reference in New Issue
Block a user