Improved i18 formatting, see desc

- /giveweapon now takes ammo as an argument
- improved Swedish translation
- hide actions in the inventory menu if they cannot be done.
- general code improvements, cleanup
This commit is contained in:
ElPumpo
2018-04-15 22:52:03 +02:00
parent 8b648c5d7f
commit 5f93c0a129
5 changed files with 67 additions and 61 deletions
+8 -7
View File
@@ -309,7 +309,7 @@ end)
RegisterServerEvent('esx:giveInventoryItem')
AddEventHandler('esx:giveInventoryItem', function(target, type, itemName, itemCount,ammotogive)
AddEventHandler('esx:giveInventoryItem', function(target, type, itemName, itemCount)
local _source = source
@@ -379,8 +379,8 @@ AddEventHandler('esx:giveInventoryItem', function(target, type, itemName, itemCo
end
end
TriggerClientEvent('esx:showNotification', _source, _U('yougave') .. ' x1 ~g~' .. weaponLabel .. _U('to') .. targetXPlayer.name)
TriggerClientEvent('esx:showNotification', target, _U('youreceived') .. ' x1 ~g~' .. weaponLabel .. _U('by') .. sourceXPlayer.name)
TriggerClientEvent('esx:showNotification', _source, _U('gave_weapon', weaponLabel, itemCount, targetXPlayer.name))
TriggerClientEvent('esx:showNotification', target, _U('recived_weapon', weaponLabel, itemCount, sourceXPlayer.name))
end
end)
@@ -517,16 +517,17 @@ AddEventHandler('esx:removeInventoryItem', function(type, itemName, itemCount)
break
end
end
TriggerClientEvent('esx:showNotification', _source, _U('delete_five_min'))
SetTimeout(Config.RemoveInventoryItemDelay, function()
xPlayer.removeWeapon(itemName)
if Config.EnableWeaponPickup then
TriggerClientEvent('esx:pickupWeapon', _source, weaponPickup, weaponName,itemCount)
TriggerClientEvent('esx:pickupWeapon', _source, weaponPickup, weaponName, itemCount)
end
TriggerClientEvent('esx:showNotification', _source, _U('threw') .. ' x1 ~g~' .. weaponLabel .. _U('withammo').. '~r~' .. itemCount .. _U('ammogiven'))
TriggerClientEvent('esx:showNotification', _source, _U('threw_weapon', weaponLabel, itemCount))
end)