16 lines
476 B
Lua
16 lines
476 B
Lua
RegisterServerCallback("advancedgarages:server:GetStanceValues", function(sourcePlayer, cb, plate)
|
|
local results = MySQL.query.await(
|
|
"SELECT stance_value FROM " .. garageTable .. " WHERE plate = ?",
|
|
{ plate }
|
|
)
|
|
|
|
Debug("Result from the database:", json.encode(results), "Database plate:", plate)
|
|
|
|
local stanceValue = nil
|
|
if results[1] ~= nil then
|
|
stanceValue = json.decode(results[1].stance_value)
|
|
end
|
|
|
|
cb(stanceValue)
|
|
end)
|