mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 02:08:55 +00:00
Buying weapon no longer removes it from the players inventory, fixes #74
This commit is contained in:
+2
-2
@@ -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
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user