From 27e410580c6c94a0ac43823045ea7c85e6288f6b Mon Sep 17 00:00:00 2001 From: Manason Date: Mon, 1 Jul 2024 00:36:32 -0700 Subject: [PATCH] feat: GetVehicleIdbyPlate export (#16) --- server/main.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/main.lua b/server/main.lua index a0e7aef..4fc0330 100644 --- a/server/main.lua +++ b/server/main.lua @@ -199,3 +199,14 @@ local function deletePlayerVehicles(idType, idValue) end exports('DeletePlayerVehicles', deletePlayerVehicles) + +---Find the vehicleId with the given plate if it exists. +---@param plate string +---@return integer? vehicleId +local function getVehicleIdByPlate(plate) + return MySQL.scalar.await('SELECT id FROM player_vehicles WHERE plate = ?', { + qbx.string.trim(plate) + }) +end + +exports('GetVehicleIdByPlate', getVehicleIdByPlate)