From c13d39ca051e4dfd0392c0c399344c09745020c1 Mon Sep 17 00:00:00 2001 From: oosayeroo <98313914+oosayeroo@users.noreply.github.com> Date: Thu, 14 Aug 2025 16:33:02 +0100 Subject: [PATCH 1/4] Commit[wrapperfunctions.lua]: Fix oxlib command argument line 27 - changd the function option in oxlib from options[4] to options[3] --- shared/wrapperfunctions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/wrapperfunctions.lua b/shared/wrapperfunctions.lua index 314be1f..4dabb56 100644 --- a/shared/wrapperfunctions.lua +++ b/shared/wrapperfunctions.lua @@ -24,7 +24,7 @@ function registerCommand(command, options) local commandResource = "" if isStarted(OXLibExport) then commandResource = OXLibExport - lib.addCommand(command, { help = options[1], restricted = options[5] and "group."..options[5] or nil }, options[4]) + lib.addCommand(command, { help = options[1], restricted = options[5] and "group."..options[5] or nil }, options[3]) elseif isStarted(QBExport) and not isStarted(QBXExport) then commandResource = QBExport From 3b038fb700a6d07b67e8cc1414f2524273dcc318 Mon Sep 17 00:00:00 2001 From: desypher Date: Tue, 2 Sep 2025 14:38:17 +0200 Subject: [PATCH 2/4] Changed name to phone in phoneFunc array --- shared/phones.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/shared/phones.lua b/shared/phones.lua index bfbefbf..f77d315 100644 --- a/shared/phones.lua +++ b/shared/phones.lua @@ -42,19 +42,19 @@ local phoneFunc = { ) end, }, - { name = "yflip-phone", + { phone = "yflip-phone", sendMail = function(mailData) TriggerServerEvent(getScript()..":yflip:SendMail", mailData) end, }, - { name = "qs-smartphone", + { phone = "qs-smartphone", sendMail = function(mailData) TriggerServerEvent('qs-smartphone:server:sendNewMail', mailData) end, }, - { name = "qs-smartphone-pro", + { phone = "qs-smartphone-pro", sendMail = function(mailData) TriggerServerEvent('phone:sendNewMail', mailData) @@ -68,7 +68,7 @@ local phoneFunc = { exports["roadphone"]:sendMail(mailData) end, }, - { name = "lb-phone", + { phone = "lb-phone", sendMail = function(mailData) -- Convert HTML line breaks to newlines for lb-phone. @@ -76,7 +76,7 @@ local phoneFunc = { TriggerServerEvent(getScript()..":lbphone:SendMail", mailData) end, }, - { name = "qb-phone", + { phone = "qb-phone", sendMail = function(mailData) TriggerServerEvent('qb-phone:server:sendNewMail', mailData) @@ -111,19 +111,19 @@ local phoneFunc = { TriggerClientEvent('qb-phone:RefreshPhone', mailData.src) end, }, - { name = "npwd_qbx_mail", + { phone = "npwd_qbx_mail", sendMail = function(mailData) TriggerServerEvent('qb-phone:server:sendNewMail', mailData) end, }, - { name = "jpr-phonesystem", + { phone = "jpr-phonesystem", sendMail = function(mailData) TriggerServerEvent(getScript()..":jpr:SendMail", mailData) end, }, - { name = "ef-phone", + { phone = "ef-phone", sendMail = function(mailData) TriggerServerEvent('qb-phone:server:sendNewMail', mailData) @@ -247,4 +247,5 @@ RegisterNetEvent(getScript()..":jpr:SendMail", function(data) Destinatario = Player.PlayerData.citizenid, -- Recipient identifier Event = {}, -- Optional event details }) -end) \ No newline at end of file + +end) From 463358b53a86a9ffbe68a6bd4bcbd03c42aab459 Mon Sep 17 00:00:00 2001 From: desypher Date: Tue, 2 Sep 2025 14:43:39 +0200 Subject: [PATCH 3/4] Changed name to phone on roadphone functions --- shared/phones.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/phones.lua b/shared/phones.lua index f77d315..be60f92 100644 --- a/shared/phones.lua +++ b/shared/phones.lua @@ -60,7 +60,7 @@ local phoneFunc = { TriggerServerEvent('phone:sendNewMail', mailData) end, }, - { name = "roadphone", + { phone = "roadphone", sendMail = function(mailData) -- Convert HTML line breaks to newlines for roadphone. @@ -249,3 +249,4 @@ RegisterNetEvent(getScript()..":jpr:SendMail", function(data) }) end) + From 6e4d9bc1d7bb83741b8c55ef39a3b3f0edef9ef2 Mon Sep 17 00:00:00 2001 From: oosayeroo <98313914+oosayeroo@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:22:36 +0100 Subject: [PATCH 4/4] Update vehicles.lua --- shared/vehicles.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/shared/vehicles.lua b/shared/vehicles.lua index 98c5606..b6a2337 100644 --- a/shared/vehicles.lua +++ b/shared/vehicles.lua @@ -299,4 +299,34 @@ function getClosestVehicle(coords, src) end return closestVehicle, closestDistance +end + +--- Checks whether a vehicle is owned or not using the plate as reference +--- +--- @param plate string The plate of the vehicle to check +--- @return boolean whether vehicle is owned +--- +--- @usage +--- ```lua +--- local plate = "ABCD1234" +--- local isVehicleOwned = isVehicleOwned(plate) +--- ``` +local vehiclesOwned = {} + +function isVehicleOwned(plate) + vehDatabase = "player_vehicles" + if isStarted(ESXExport) then vehDatabase = "owned_vehicles" + elseif isStarted(OXCoreExport) then vehDatabase = "vehicles" end + + if vehiclesOwned[plate] == true then + return true + else + local result = MySQL.query.await("SELECT 1 from "..vehDatabase.." WHERE plate = ?", { plate }) + if json.encode(result) ~= "[]" then + vehiclesOwned[plate] = true + return true + else + return false + end + end end \ No newline at end of file