Added invalid command handler

This commit is contained in:
ElPumpo
2020-03-09 13:05:33 +01:00
parent 7efcf85abb
commit e0d561649b
9 changed files with 16 additions and 0 deletions
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+8
View File
@@ -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)