From 820c738e2d587c197aa4e496ce40a677ce88267a Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 12 Jul 2023 22:44:05 +0100 Subject: [PATCH 1/3] Update vehicles.lua add support for b2944 new vehicles --- shared/vehicles.lua | 150 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/shared/vehicles.lua b/shared/vehicles.lua index aac741a..0756b78 100644 --- a/shared/vehicles.lua +++ b/shared/vehicles.lua @@ -5546,5 +5546,155 @@ QBShared.Vehicles = { ['categoryLabel'] = 'Super', ['hash'] = `virtue`, ['shop'] = 'luxury', + },--- Game build 2944 San Andreas Mercenaries + ['buffalo5'] = { + ['name'] = 'Buffalo EVX', + ['brand'] = 'Bravado', + ['model'] = 'buffalo5', + ['price'] = 214000, + ['category'] = 'muscle', + ['categoryLabel'] = 'Muscle', + ['hash'] = `buffalo5`, + ['shop'] = 'pdm', + }, + ['gauntlet6'] = { + ['name'] = 'Hotring Hellfire', + ['brand'] = 'Bravado', + ['model'] = 'gauntlet6', + ['price'] = 181000, + ['category'] = 'sports', + ['categoryLabel'] = 'Sports', + ['hash'] = `gauntlet6`, + ['shop'] = 'pdm', + }, + ['coureur'] = { + ['name'] = 'La Coureuse', + ['brand'] = 'Penaud', + ['model'] = 'coureur', + ['price'] = 199000, + ['category'] = 'sports', + ['categoryLabel'] = 'Sports', + ['hash'] = `coureur`, + ['shop'] = 'pdm', + }, + ['ratel'] = { + ['name'] = 'Ratel', + ['brand'] = 'Vapid', + ['model'] = 'ratel', + ['price'] = 199000, + ['category'] = 'offroad', + ['categoryLabel'] = 'Off Road', + ['hash'] = `ratel`, + ['shop'] = 'pdm', + }, + ['l35'] = { + ['name'] = 'Walton L35', + ['brand'] = 'Declasse', + ['model'] = 'l35', + ['price'] = 167000, + ['category'] = 'offroad', + ['categoryLabel'] = 'Off Road', + ['hash'] = `l35`, + ['shop'] = 'pdm', + }, + ['monstrociti'] = { + ['name'] = 'MonstroCiti', + ['brand'] = 'Maibatsu', + ['model'] = 'monstrociti', + ['price'] = 48000, + ['category'] = 'offroad', + ['categoryLabel'] = 'Off Road', + ['hash'] = `monstrociti`, + ['shop'] = 'pdm', + }, + ['stingertt'] = { + ['name'] = 'Itali GTO Stinger TT', + ['brand'] = 'Maibatsu', + ['model'] = 'stingertt', + ['price'] = 238000, + ['category'] = 'sports', + ['categoryLabel'] = 'Sports', + ['hash'] = `stingertt`, + ['shop'] = 'pdm', + }, + ['speedo5'] = { + ['name'] = 'Speedo Custom', + ['brand'] = 'Vapid', + ['model'] = 'speedo5', + ['price'] = 238000, + ['category'] = 'vans', + ['categoryLabel'] = 'Vans', + ['hash'] = `speedo5`, + ['shop'] = 'pdm', + }, + ['clique2'] = { + ['name'] = 'Clique Wagon', + ['brand'] = 'Vapid', + ['model'] = 'clique2', + ['price'] = 102500, + ['category'] = 'muscle', + ['categoryLabel'] = 'Muscle', + ['hash'] = `clique2`, + ['shop'] = 'pdm', + }, + ['brigham'] = { + ['name'] = 'Brigham', + ['brand'] = 'Albany', + ['model'] = 'brigham', + ['price'] = 149900, + ['category'] = 'muscle', + ['categoryLabel'] = 'Muscle', + ['hash'] = `brigham`, + ['shop'] = 'pdm', + }, + ['inductor'] = { + ['name'] = 'Inductor', + ['brand'] = 'Unknown', + ['model'] = 'inductor', + ['price'] = 5000, + ['category'] = 'cycles', + ['categoryLabel'] = 'Cycles', + ['hash'] = `inductor`, + ['shop'] = 'pdm', + }, + ['inductor2'] = { + ['name'] = 'Junk Energy Inductor', + ['brand'] = 'Unknown', + ['model'] = 'inductor2', + ['price'] = 5000, + ['category'] = 'cycles', + ['categoryLabel'] = 'Cycles', + ['hash'] = `inductor2`, + ['shop'] = 'pdm', + }, + ['raiju'] = { + ['name'] = 'F-160 Raiju', + ['brand'] = 'Mammoth', + ['model'] = 'raiju', + ['price'] = 6855000, + ['category'] = 'planes', + ['categoryLabel'] = 'Planes', + ['hash'] = `raiju`, + ['shop'] = 'air', + }, + ['streamer216'] = { + ['name'] = 'Streamer216', + ['brand'] = 'Mammoth', + ['model'] = 'streamer216', + ['price'] = 2238000, + ['category'] = 'planes', + ['categoryLabel'] = 'Planes', + ['hash'] = `streamer216`, + ['shop'] = 'air', + }, + ['conada2'] = { + ['name'] = 'Weaponized Conada', + ['brand'] = 'Buckingham', + ['model'] = 'conada2', + ['price'] = 3385000, + ['category'] = 'planes', + ['categoryLabel'] = 'Planes', + ['hash'] = `conada2`, + ['shop'] = 'air', }, } From a9c55183f5e2d7889da4e327dfc5c4655259cdf9 Mon Sep 17 00:00:00 2001 From: Gnavling <69698024+Gnavling@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:13:59 +0200 Subject: [PATCH 2/3] Fixed typo Fixed "Revovler" type to "Revolver" --- shared/items.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/items.lua b/shared/items.lua index ba27953..8714efe 100644 --- a/shared/items.lua +++ b/shared/items.lua @@ -142,9 +142,9 @@ QBShared.Items = { ['pistol50_defaultclip'] = {['name'] = 'pistol50_defaultclip', ['label'] = 'Pistol Clip', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '.50 Pistol Default Clip'}, ['pistol50_extendedclip'] = {['name'] = 'pistol50_extendedclip', ['label'] = 'Pistol EXT Clip', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '.50 Pistol Extended Clip'}, ['pistol50_luxuryfinish'] = {['name'] = 'pistol50_luxuryfinish', ['label'] = 'Pistol Finish', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_suppressor.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '.50 Pistol Luxury Finish'}, - ['revolver_defaultclip'] = {['name'] = 'revolver_defaultclip', ['label'] = 'Pistol Clip', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Revovler Default Clip'}, - ['revolver_vipvariant'] = {['name'] = 'revolver_vipvariant', ['label'] = 'Pistol Variant', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Revovler Variant'}, - ['revolver_bodyguardvariant'] = {['name'] = 'revolver_bodyguardvariant', ['label'] = 'Pistol Variant', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_suppressor.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Revovler Variant'}, + ['revolver_defaultclip'] = {['name'] = 'revolver_defaultclip', ['label'] = 'Pistol Clip', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Revolver Default Clip'}, + ['revolver_vipvariant'] = {['name'] = 'revolver_vipvariant', ['label'] = 'Pistol Variant', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Revolver Variant'}, + ['revolver_bodyguardvariant'] = {['name'] = 'revolver_bodyguardvariant', ['label'] = 'Pistol Variant', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_suppressor.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Revolver Variant'}, ['snspistol_defaultclip'] = {['name'] = 'snspistol_defaultclip', ['label'] = 'Pistol Clip', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'SNS Pistol Default Clip'}, ['snspistol_extendedclip'] = {['name'] = 'snspistol_extendedclip', ['label'] = 'Pistol EXT Clip', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_extendedclip.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'SNS Pistol Extended Clip'}, ['snspistol_grip'] = {['name'] = 'snspistol_grip', ['label'] = 'Pistol Grip', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'pistol_suppressor.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'SNS Pistol Grip Attachment'}, From f93c31fa54d9658e82c01c3e69647ae901af46b2 Mon Sep 17 00:00:00 2001 From: Swellington Soares <138418902+xSwellington@users.noreply.github.com> Date: Wed, 20 Sep 2023 17:02:43 -0300 Subject: [PATCH 3/3] Update functions.lua Added functions to Get players by account and added functions by char info passing the key property and value to check if exists. --- server/functions.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/server/functions.lua b/server/functions.lua index 8b9e106..da20289 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -88,6 +88,33 @@ function QBCore.Functions.GetPlayerByPhone(number) return nil end +---Get player by account id +---@param account string +---@return table? +function QBCore.Functions.GetPlayerByAccount(account) + for src in pairs(QBCore.Players) do + if QBCore.Players[src].PlayerData.charinfo.account == account then + return QBCore.Players[src] + end + end + return nil +end + +---Get player passing property and value to check exists +---@param property string +---@param value string +---@return table? +function QBCore.Functions.GetPlayerByCharInfo(property, value) + for src in pairs(QBCore.Players) do + local charinfo = QBCore.Players[src].PlayerData.charinfo + if charinfo[property] ~= nil and charinfo[property] == value then + return QBCore.Players[src] + end + end + return nil +end + + ---Get all players. Returns the server ids of all players. ---@return table function QBCore.Functions.GetPlayers()