Skip to content

Commit

Permalink
feat: GetVehicleIdbyPlate export (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason authored Jul 1, 2024
1 parent e6f69ff commit 27e4105
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 27e4105

Please sign in to comment.