Skip to content

Commit

Permalink
[qb-mdt] - New DB Callback
Browse files Browse the repository at this point in the history
- Add callback to DB to match citizenids to player license
  • Loading branch information
trapw0w authored May 4, 2022
1 parent f4ec5b4 commit 385ec45
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion server/dbm.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
local QBCore = exports['qb-core']:GetCoreObject()

-- Get CitizenIDs from Player License
function GetCitizenID(license)
local result = MySQL.query.await("SELECT citizenid FROM players WHERE license = ?", {license,})
if result ~= nil then
return result
else
print("Cannot find a CitizenID for License: "..license)
return nil
end
end

-- (Start) Opening the MDT and sending data
function AddLog(text)
--print(text)
Expand Down Expand Up @@ -155,4 +166,4 @@ function ManageLicenses(identifier, incomingLicenses)
end
MySQL.query.await('UPDATE `players` SET `metadata` = @metadata WHERE citizenid = @citizenid', {['@metadata'] = json.encode(result), ['@citizenid'] = identifier})
end
end
end

0 comments on commit 385ec45

Please sign in to comment.