From 6dcd6c626bb490e1ef6ec8377c2d6bde4ed1ed4c Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Tue, 28 May 2024 13:43:07 +0200 Subject: [PATCH 1/2] added check for when holding a bag --- client/drops.lua | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/client/drops.lua b/client/drops.lua index 10c8a3788..6b57ecb87 100644 --- a/client/drops.lua +++ b/client/drops.lua @@ -51,22 +51,26 @@ RegisterNetEvent('qb-inventory:client:setupDropTarget', function(dropId) icon = 'fas fa-hand-pointer', label = 'Pick up bag', action = function() - AttachEntityToEntity( - bag, - PlayerPedId(), - GetPedBoneIndex(PlayerPedId(), Config.ItemDropObjectBone), - Config.ItemDropObjectOffset[1].x, - Config.ItemDropObjectOffset[1].y, - Config.ItemDropObjectOffset[1].z, - Config.ItemDropObjectOffset[2].x, - Config.ItemDropObjectOffset[2].y, - Config.ItemDropObjectOffset[2].z, - true, true, false, true, 1, true - ) - bagObject = bag - holdingDrop = true - heldDrop = newDropId - exports['qb-core']:DrawText('Press [G] to drop the bag') + if not holdingDrop then + AttachEntityToEntity( + bag, + PlayerPedId(), + GetPedBoneIndex(PlayerPedId(), Config.ItemDropObjectBone), + Config.ItemDropObjectOffset[1].x, + Config.ItemDropObjectOffset[1].y, + Config.ItemDropObjectOffset[1].z, + Config.ItemDropObjectOffset[2].x, + Config.ItemDropObjectOffset[2].y, + Config.ItemDropObjectOffset[2].z, + true, true, false, true, 1, true + ) + bagObject = bag + holdingDrop = true + heldDrop = newDropId + exports['qb-core']:DrawText('Press [G] to drop the bag') + else + QBCore.Functions.Notify(Lang:t('notify.c_pu_bag'), 'error') + end end, } }, From 07a0d0147188d0147d1ba989db40244b5e4b9313 Mon Sep 17 00:00:00 2001 From: LeSiiN <103898231+LeSiiN@users.noreply.github.com> Date: Tue, 28 May 2024 13:43:38 +0200 Subject: [PATCH 2/2] added notify for ,,Cant Pickup the Bag'' --- locales/en.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/en.lua b/locales/en.lua index b3c61f829..a849583e6 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -31,6 +31,7 @@ local Translations = { ['cgitem'] = 'Can\'t give item!', ['idne'] = 'Item Does Not Exist', ['pdne'] = 'Player Is Not Online', + ['c_pu_bag'] = 'Cannot carry the bag.', }, inf_mapping = { ['opn_inv'] = 'Open Inventory',