From 24a9defca418492b25a91e32efedec8c855746f2 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 25 Feb 2020 15:54:38 +0100 Subject: [PATCH] Removed xPlayer.removeWeapon() second argument --- client/main.lua | 11 ++--------- fxmanifest.lua | 2 +- server/classes/player.lua | 4 ++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/client/main.lua b/client/main.lua index fd2fc759..106e0032 100644 --- a/client/main.lua +++ b/client/main.lua @@ -190,19 +190,12 @@ AddEventHandler('esx:setWeaponTint', function(weaponName, weaponTintIndex) end) RegisterNetEvent('esx:removeWeapon') -AddEventHandler('esx:removeWeapon', function(weaponName, ammo) +AddEventHandler('esx:removeWeapon', function(weaponName) local playerPed = PlayerPedId() local weaponHash = GetHashKey(weaponName) RemoveWeaponFromPed(playerPed, weaponHash) - - if ammo then - local pedAmmo = GetAmmoInPedWeapon(playerPed, weaponHash) - local finalAmmo = math.floor(pedAmmo - ammo) - SetPedAmmo(playerPed, weaponHash, finalAmmo) - else - SetPedAmmo(playerPed, weaponHash, 0) -- remove leftover ammo - end + SetPedAmmo(playerPed, weaponHash, 0) -- remove leftover ammo end) RegisterNetEvent('esx:removeWeaponComponent') diff --git a/fxmanifest.lua b/fxmanifest.lua index a9fe16ba..eb6e6f19 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -83,7 +83,7 @@ files { 'html/img/accounts/bank.png', 'html/img/accounts/black_money.png', - 'html/img/accounts/money.png', + 'html/img/accounts/money.png' } exports { diff --git a/server/classes/player.lua b/server/classes/player.lua index 4a41d30b..845b6f8d 100644 --- a/server/classes/player.lua +++ b/server/classes/player.lua @@ -403,7 +403,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, return 0 end - self.removeWeapon = function(weaponName, ammo) + self.removeWeapon = function(weaponName) local weaponLabel for k,v in ipairs(self.loadout) do @@ -420,7 +420,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end if weaponLabel then - self.triggerEvent('esx:removeWeapon', weaponName, ammo) + self.triggerEvent('esx:removeWeapon', weaponName) self.triggerEvent('esx:removeInventoryItem', weaponLabel, false, true) end end