diff --git a/client/alerts.lua b/client/alerts.lua index 48a2b781..c391c807 100644 --- a/client/alerts.lua +++ b/client/alerts.lua @@ -545,7 +545,7 @@ local function CustomAlert(data) end exports('CustomAlert', CustomAlert) -local function PhoneCall(message, anonymous, job) +local function PhoneCall(message, anonymous, job, type) local coords = GetEntityCoords(cache.ped) if IsCallAllowed(message) then @@ -553,8 +553,8 @@ local function PhoneCall(message, anonymous, job) local dispatchData = { message = anonymous and locale('anon_call') or locale('call'), - codeName = '911call', - code = '911', + codeName = type == '311' and '311call' or '911call', + code = type, icon = 'fas fa-phone', priority = 2, coords = coords, @@ -575,7 +575,7 @@ end RegisterNetEvent('ps-dispatch:client:sendEmergencyMsg', function(data, type, anonymous) local jobs = { ['911'] = { 'leo' }, ['311'] = { 'ems' } } - PhoneCall(data, anonymous, jobs[type]) + PhoneCall(data, anonymous, jobs[type], type) end) diff --git a/client/utils.lua b/client/utils.lua index 59cbd07f..46e8ae01 100644 --- a/client/utils.lua +++ b/client/utils.lua @@ -142,7 +142,7 @@ function IsCallAllowed(message) if msgLength == 0 then return false end if GetIsHandcuffed() then return false end - if Config.PhoneRequired and not HasPhone() then return false end + if Config.PhoneRequired and not HasPhone() then QBCore.Functions.Notify('You need a communications device for this.', 'error', 5000) return false end return true end