From f72972987b33e2a4a7e22467684af2974bfac4c4 Mon Sep 17 00:00:00 2001 From: Zerio Date: Sat, 25 May 2024 17:18:21 +0200 Subject: [PATCH 1/5] fix: `vendingMachineCoords` is undefined --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 508476e0d..41961ce85 100644 --- a/server/main.lua +++ b/server/main.lua @@ -132,14 +132,14 @@ end -- Events -RegisterNetEvent('qb-inventory:server:openVending', function() +RegisterNetEvent('qb-inventory:server:openVending', function(data) local src = source local Player = QBCore.Functions.GetPlayer(src) if not Player then return end CreateShop({ name = 'vending', label = 'Vending Machine', - coords = vendingMachineCoords, + coords = data.coords, slots = #Config.VendingItems, items = Config.VendingItems }) From f1de165ca5aaff1032f2f21b9cc77503a9c7fe2e Mon Sep 17 00:00:00 2001 From: your_username Date: Thu, 25 Jul 2024 16:02:22 -0500 Subject: [PATCH 2/5] Added Chat Message per ID --- server/main.lua | 52 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index c20b6365d..1c126a63f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -183,6 +183,54 @@ RegisterNetEvent('qb-inventory:server:useItem', function(item) if itemData.type == 'weapon' then TriggerClientEvent('qb-weapons:client:UseWeapon', src, itemData, itemData.info.quality and itemData.info.quality > 0) TriggerClientEvent('qb-inventory:client:ItemBox', src, itemInfo, 'use') + elseif itemData.name == 'id_card' then + UseItem(itemData.name, src, itemData) + TriggerClientEvent('qb-inventory:client:ItemBox', source, itemInfo, 'use') + local playerPed = GetPlayerPed(src) + local playerCoords = GetEntityCoords(playerPed) + local players = QBCore.Functions.GetPlayers() + local gender = item.info.gender == 0 and 'Male' or 'Female' + for _, v in pairs(players) do + local targetPed = GetPlayerPed(v) + local dist = #(playerCoords - GetEntityCoords(targetPed)) + if dist < 3.0 then + TriggerClientEvent('chat:addMessage', v, { + template = '', + args = { + 'ID Card', + item.info.citizenid, + item.info.firstname, + item.info.lastname, + item.info.birthdate, + gender, + item.info.nationality + } + }) + end + end + elseif itemData.name == 'driver_license' then + UseItem(itemData.name, src, itemData) + TriggerClientEvent('qb-inventory:client:ItemBox', src, itemInfo, 'use') + local playerPed = GetPlayerPed(src) + local playerCoords = GetEntityCoords(playerPed) + local players = QBCore.Functions.GetPlayers() + for _, v in pairs(players) do + local targetPed = GetPlayerPed(v) + local dist = #(playerCoords - GetEntityCoords(targetPed)) + if dist < 3.0 then + TriggerClientEvent('chat:addMessage', v, { + template = '', + args = { + 'Drivers License', + item.info.firstname, + item.info.lastname, + item.info.birthdate, + item.info.type + } + } + ) + end + end else UseItem(itemData.name, src, itemData) TriggerClientEvent('qb-inventory:client:ItemBox', src, itemInfo, 'use') @@ -357,13 +405,13 @@ QBCore.Functions.CreateCallback('qb-inventory:server:giveItem', function(source, return end - local removeItem = RemoveItem(source, item, giveAmount, slot, 'Item given to ID #'..target) + local removeItem = RemoveItem(source, item, giveAmount, slot, 'Item given to ID #' .. target) if not removeItem then cb(false) return end - local giveItem = AddItem(target, item, giveAmount, false, info, 'Item given from ID #'..source) + local giveItem = AddItem(target, item, giveAmount, false, info, 'Item given from ID #' .. source) if not giveItem then cb(false) return From 30828cc80abd8ef33932a5fb3da5fca9b3aaf167 Mon Sep 17 00:00:00 2001 From: JsemMarney <110119722+JsemMarney@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:14:05 +0200 Subject: [PATCH 3/5] Adde cs.lua --- locales/cs.lua | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 locales/cs.lua diff --git a/locales/cs.lua b/locales/cs.lua new file mode 100644 index 000000000..e975e5c3b --- /dev/null +++ b/locales/cs.lua @@ -0,0 +1,57 @@ +local Translations = { + progress = { + ['snowballs'] = 'Sbíráš sněhové koule..', + }, + notify = { + ['failed'] = 'Nepovedlo se', + ['canceled'] = 'Zrušeno', + ['vlocked'] = 'Vozidlo uzamčeno', + ['notowned'] = 'Tento předmět nevlastníš!', + ['missitem'] = 'Nemáš tento předmět!', + ['nonb'] = 'Nikdo v okolí není!', + ['noaccess'] = 'Nepřístupné', + ['nosell'] = 'Tento předmět nemůžeš prodat.', + ['itemexist'] = 'Předmět neexistuje', + ['notencash'] = 'Nemáš dost hotovosti..', + ['noitem'] = 'Nemáš správné předměty..', + ['gsitem'] = 'Nemůžeš si dát předmět sám sobě?', + ['tftgitem'] = 'Jsi příliš daleko na to, aby sis dal předmět!', + ['infound'] = 'Předmět, který se snažíš dát, nebyl nalezen!', + ['iifound'] = 'Nalezen nesprávný předmět, zkus to znovu!', + ['gitemrec'] = 'Dostal jsi ', + ['gitemfrom'] = ' Od ', + ['gitemyg'] = 'Dal jsi ', + ['gitinvfull'] = 'Inventář druhého hráče je plný!', + ['giymif'] = 'Tvůj inventář je plný!', + ['gitydhei'] = 'Nemáš dost tohoto předmětu', + ['gitydhitt'] = 'Nemáš dost předmětů na přenos', + ['navt'] = 'Neplatný typ..', + ['anfoc'] = 'Argumenty nejsou správně vyplněny..', + ['yhg'] = 'Dal jsi ', + ['cgitem'] = 'Nelze dát předmět!', + ['idne'] = 'Předmět neexistuje', + ['pdne'] = 'Hráč není online', + }, + inf_mapping = { + ['opn_inv'] = 'Otevři inventář', + ['tog_slots'] = 'Přepíná sloty klávesových zkratek', + ['use_item'] = 'Používá předmět ve slotu ', + }, + menu = { + ['vending'] = 'Automat', + ['bin'] = 'Otevři kontejner', + ['craft'] = 'Craft', + ['o_bag'] = 'Otevři tašku', + }, + interaction = { + ['craft'] = '~g~E~w~ - Craft', + }, +} + +if GetConvar('qb_locale', 'en') == 'cs' then + Lang = Locale:new({ + phrases = Translations, + warnOnMissing = true, + fallbackLang = Lang, + }) +end From 9acdda745bdf09b7299e44de28127cef419d1971 Mon Sep 17 00:00:00 2001 From: Hakos <76844995+hakos47@users.noreply.github.com> Date: Fri, 26 Jul 2024 21:43:46 +0200 Subject: [PATCH 4/5] Deprecated dependencies update dependencies qb-logs to qb-smallresources --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10ef4090b..94cb15086 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Dependencies - [qb-core](https://github.com/qbcore-framework/qb-core) -- [qb-logs](https://github.com/qbcore-framework/qb-logs) - For logging transfer and other history +- [qb-smallresources](https://github.com/qbcore-framework/qb-smallresources) - For logging transfer and other history ## Features - Stashes (Personal and/or Shared) From f70da43c4b11a47934e3989867f12616c8bfa07b Mon Sep 17 00:00:00 2001 From: Sanriku-Gaming <100663906+Sanriku-Gaming@users.noreply.github.com> Date: Sat, 27 Jul 2024 19:17:38 -0600 Subject: [PATCH 5/5] fix checkWeapon function Fixes issues where giving or dropping a currently equipped weapon does not remove it from your ped, so you can continue to shoot a weapon that you do not posses. Issues: https://github.com/qbcore-framework/qb-inventory/issues/556 --- server/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 1c126a63f..6aff6530f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -124,11 +124,13 @@ end) -- Functions local function checkWeapon(source, item) + local currentWeapon = type(item) == 'table' and item.name or item local ped = GetPlayerPed(source) local weapon = GetSelectedPedWeapon(ped) local weaponInfo = QBCore.Shared.Weapons[weapon] - if weaponInfo and weaponInfo.name == item.name then + if weaponInfo and weaponInfo.name == currentWeapon then RemoveWeaponFromPed(ped, weapon) + TriggerClientEvent('qb-weapons:client:UseWeapon', source, { name = currentWeapon }, false) end end