IsVehicleOwnedByPlayer method
This commit is contained in:
1 parent
24061d8343
commit
0f2e41d72f
3 files changed
+43
No files matched your search
@@ -633,6 +633,20 @@ Framework.GetOwnedVehicles = function(src)
|
||||
return vehicles
|
||||
end
|
||||
|
||||
---@description Returns a table of owned vehicles for the player. format is {id = id, vehicle = model, plate = plate}
|
||||
---@param src number
|
||||
---@param plate string
|
||||
---@return table
|
||||
Framework.IsVehicleOwnedByPlayer = function(src, plate)
|
||||
local citizenId = Framework.GetPlayerIdentifier(src)
|
||||
local result = MySQL.Sync.fetchAll("SELECT id, vehicle, plate FROM player_vehicles WHERE citizenid = '" .. citizenId .. "' AND plate = '" .. plate .. "'")
|
||||
if not result[1] then return false end
|
||||
|
||||
local id = result[1].id
|
||||
local vehicle = result[1].vehicle
|
||||
return { id = id, vehicle = vehicle, plate = plate }
|
||||
end
|
||||
|
||||
---@description Registers a usable item with a callback function.
|
||||
---@param itemName string
|
||||
---@param cb function
|
||||
|
||||
Reference in new issue
Block a user