feat:(es_extended/commands.lua) - giveammo command

This commit is contained in:
Benzo
2022-10-02 20:00:13 +02:00
parent 2579864719
commit 68458c228c
14 changed files with 51 additions and 0 deletions
+3
View File
@@ -100,6 +100,9 @@ Locales['br'] = {
['commanderror_invalidcommand'] = '/%s is not an valid command!',
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
['commandgeneric_playerid'] = 'o ID do jogador',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
+3
View File
@@ -100,6 +100,9 @@ Locales['cs'] = {
['commanderror_invalidcommand'] = '/%s is not an valid command!',
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
['commandgeneric_playerid'] = 'player id',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
+3
View File
@@ -100,6 +100,9 @@ Locales['de'] = {
['commanderror_invalidcommand'] = '/%s ist kein verfügbarer command!',
['commanderror_invalidplayerid'] = 'kein spieler ist online mit dieser id',
['commandgeneric_playerid'] = 'spieler id',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
+3
View File
@@ -105,6 +105,9 @@ Locales['en'] = {
['commanderror_invalidcommand'] = 'Invalid Command - /%s',
['commanderror_invalidplayerid'] = 'Specified Player is not online',
['commandgeneric_playerid'] = 'Player`s Server Id',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
+3
View File
@@ -105,6 +105,9 @@ Locales['es'] = {
['commanderror_invalidcommand'] = '/%s ¡No es un comando válido!',
['commanderror_invalidplayerid'] = 'No hay ningún jugador en línea que coincida con la ID del servidor',
['commandgeneric_playerid'] = 'ID del jugador',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
+3
View File
@@ -100,6 +100,9 @@ Locales['fi'] = {
['commanderror_invalidcommand'] = '/%s is not an valid command!',
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
['commandgeneric_playerid'] = 'player id',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
+3
View File
@@ -100,6 +100,9 @@ Locales['fr'] = {
['commanderror_invalidcommand'] = '/%s n\'est pas une commande valide!',
['commanderror_invalidplayerid'] = 'il n\'ya aucun joueur avec cet ID en jeu',
['commandgeneric_playerid'] = 'id joueur',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
+3
View File
@@ -105,6 +105,9 @@ Locales["hu"] = {
["commanderror_invalidcommand"] = "Érvénytelen parancs - /%s",
["commanderror_invalidplayerid"] = "Megadott játékos nem online.",
["commandgeneric_playerid"] = "Játékos Szerver Id",
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
["locale_digit_grouping_symbol"] = ",",
+3
View File
@@ -105,6 +105,9 @@ Locales['nl'] = {
['commanderror_invalidcommand'] = 'Ongeldige opdracht - /%s',
['commanderror_invalidplayerid'] = 'Opgegeven speler is niet online',
['commandgeneric_playerid'] = 'Server-ID van de speler',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
+3
View File
@@ -99,6 +99,9 @@ Locales['pl'] = {
['commanderror_invalidcommand'] = '/%s nie jest poprawną komendą!',
['commanderror_invalidplayerid'] = 'brak dostepnego gracza pasującego do podanego id serwerowego',
['commandgeneric_playerid'] = 'id gracza',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
+3
View File
@@ -100,6 +100,9 @@ Locales['sc'] = {
['commanderror_invalidcommand'] = '/%s 不是有效的命令!',
['commanderror_invalidplayerid'] = '没有在线玩家匹配到该服务id',
['commandgeneric_playerid'] = '玩家id',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
+3
View File
@@ -100,6 +100,9 @@ Locales['sv'] = {
['commanderror_invalidcommand'] = 'Ogiltigt kommando - /%s',
['commanderror_invalidplayerid'] = 'Angiven spelare är inte online',
['commandgeneric_playerid'] = 'Spelarens server-id',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
+3
View File
@@ -100,6 +100,9 @@ Locales['tc'] = {
['commanderror_invalidcommand'] = '/%s 不是有效的指令!',
['commanderror_invalidplayerid'] = '無效的玩家ID',
['commandgeneric_playerid'] = '玩家id',
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
+12
View File
@@ -93,6 +93,18 @@ if not Config.OxInventory then
{name = 'ammo', help = _U('command_giveweapon_ammo'), type = 'number'}
}})
ESX.RegisterCommand('giveammo', 'admin', function(xPlayer, args, showError)
if args.playerId.hasWeapon(args.weapon) then
args.playerId.addWeaponAmmo(args.weapon, args.ammo)
else
showError(_U("command_giveammo_noweapon_found"))
end
end, true, {help = _U('command_giveweapon'), validate = false, arguments = {
{name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'},
{name = 'weapon', help = _U('command_giveammo_weapon'), type = 'weapon'},
{name = 'ammo', help = _U('command_giveammo_ammo'), type = 'number'}
}})
ESX.RegisterCommand('giveweaponcomponent', 'admin', function(xPlayer, args, showError)
if args.playerId.hasWeapon(args.weaponName) then
local component = ESX.GetWeaponComponent(args.weaponName, args.componentName)