Improved ammo label handling, extended weapon configuration file with ammo hash and label

This commit is contained in:
ElPumpo
2020-02-11 11:50:59 +01:00
parent e25f5dee2e
commit f11e97e0a5
12 changed files with 345 additions and 191 deletions
+5 -1
View File
@@ -134,7 +134,11 @@ TriggerEvent('es:addGroupCommand', 'giveweapon', 'admin', function(source, args,
if xPlayer.hasWeapon(weaponName) then
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player already has that weapon.' } })
else
xPlayer.addWeapon(weaponName, tonumber(args[3]))
if tonumber(args[3]) then
xPlayer.addWeapon(weaponName, tonumber(args[3]))
else
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Invalid ammo amount.' } })
end
end
else
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Invalid weapon.' } })