Skip to content

Commit

Permalink
Fix for calls time, EMS profile pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSzymkowicz committed Apr 28, 2022
1 parent 50e6e17 commit 794df3d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ RegisterNetEvent('mdt:client:deleteBulletin', function(ignoreId, sentData, job)
end
end)

RegisterNetEvent('mdt:client:open', function(bulletin, activeUnits)
RegisterNetEvent('mdt:client:open', function(bulletin, activeUnits, calls)
EnableGUI(true)
local x, y, z = table.unpack(GetEntityCoords(PlayerPedId()))

Expand All @@ -212,6 +212,7 @@ RegisterNetEvent('mdt:client:open', function(bulletin, activeUnits)
-- local grade = PlayerData.job.grade.name

SendNUIMessage({ type = "data", activeUnits = activeUnits, name = "Welcome, " ..PlayerData.job.grade.name..' '..PlayerData.charinfo.lastname:sub(1,1):upper()..PlayerData.charinfo.lastname:sub(2), location = playerStreetsLocation, fullname = PlayerData.charinfo.firstname..' '..PlayerData.charinfo.lastname, bulletin = bulletin })
SendNUIMessage({ type = "calls", data = calls })
TriggerEvent("mdt:client:dashboardWarrants")
end)

Expand Down
5 changes: 5 additions & 0 deletions server/dbm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ function GetPersonInformation(cid, jobtype)
-- return exports.oxmysql:executeSync('SELECT information, tags, gallery FROM mdt WHERE cid= ? and type = ?', { cid, jobtype })
end

function GetPfpFingerPrintInformation(cid)
local result = MySQL.query.await('SELECT pfp, fingerprint FROM mdt_data WHERE cid = ?', { cid })
return result[1]
end

-- idk but I guess sure?
function GetIncidentName(id)
-- Should also be a scalar
Expand Down
10 changes: 9 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ RegisterNetEvent('mdt:server:openMDT', function()
local JobType = GetJobType(PlayerData.job.name)
local bulletin = GetBulletins(JobType)

local calls = exports['qb-dispatch']:GetDispatchCalls()

--TriggerClientEvent('mdt:client:dashboardbulletin', src, bulletin)
TriggerClientEvent('mdt:client:open', src, bulletin, activeUnits)
TriggerClientEvent('mdt:client:open', src, bulletin, activeUnits, calls)
--TriggerClientEvent('mdt:client:GetActiveUnits', src, activeUnits)
end)

Expand Down Expand Up @@ -238,6 +240,12 @@ QBCore.Functions.CreateCallback('mdt:server:GetProfileData', function(source, cb
person.gallery = json.decode(mdtData.gallery)
end

local mdtData2 = GetPfpFingerPrintInformation(sentId)
if mdtData2 then
person.fingerprint = mdtData2.fingerprint
person.profilepic = mdtData.pfp
end

return cb(person)
end)

Expand Down

0 comments on commit 794df3d

Please sign in to comment.