Buying weapon no longer removes it from the players inventory, fixes #74

This commit is contained in:
ElPumpo
2018-05-19 10:45:39 +02:00
parent a81866bce8
commit c1c4b585aa
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -1048,7 +1048,7 @@ function OpenPutWeaponMenu()
ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function()
OpenPutWeaponMenu()
end, data.current.value)
end, data.current.value, true)
end,
function(data, menu)
@@ -1094,7 +1094,7 @@ function OpenBuyWeaponsMenu(station)
if hasEnoughMoney then
ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function()
OpenBuyWeaponsMenu(station)
end, data.current.value)
end, data.current.value, false)
else
ESX.ShowNotification(_U('not_enough_money'))
end
+4 -2
View File
@@ -362,11 +362,13 @@ ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb
end)
ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName)
ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName, removeWeapon)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeWeapon(weaponName)
if removeWeapon then
xPlayer.removeWeapon(weaponName)
end
TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store)