mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Added invalid command handler
This commit is contained in:
@@ -93,6 +93,7 @@ Locales['br'] = {
|
||||
['commanderror_invaliditem'] = 'item invalido',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'o ID do jogador',
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ Locales['cs'] = {
|
||||
['commanderror_invaliditem'] = 'invalid item name',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'player id',
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ Locales['de'] = {
|
||||
['commanderror_invaliditem'] = 'invalid item name',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'player id',
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ Locales['en'] = {
|
||||
['commanderror_invaliditem'] = 'invalid item name',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'player id',
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ Locales['fi'] = {
|
||||
['commanderror_invaliditem'] = 'invalid item name',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'player id',
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ Locales['fr'] = {
|
||||
['commanderror_invaliditem'] = 'nom de l\'objet invalide',
|
||||
['commanderror_invalidweapon'] = 'arme invalide',
|
||||
['commanderror_console'] = 'cette commande ne peut pas être utilisée dans la console',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'il n\'ya aucun joueur avec cet ID en jeu',
|
||||
['commandgeneric_playerid'] = 'id joueur',
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ Locales['pl'] = {
|
||||
['commanderror_invaliditem'] = 'invalid item name',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'player id',
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ Locales['sv'] = {
|
||||
['commanderror_invaliditem'] = 'ej giltigt item',
|
||||
['commanderror_invalidweapon'] = 'ej giltigt vapen',
|
||||
['commanderror_console'] = 'detta kommando kan ej executas i konsol',
|
||||
['commanderror_invalidcommand'] = '^3%s^0 är inte ett giltigt kommando!',
|
||||
['commanderror_invalidplayerid'] = 'det finns ingen spelare som matchar det angivna server id',
|
||||
['commandgeneric_playerid'] = 'spelarid',
|
||||
|
||||
|
||||
@@ -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