From 9c07c2465440a0ca9a004e879f4b833b62ade998 Mon Sep 17 00:00:00 2001 From: complex Date: Wed, 20 Dec 2023 22:06:06 +0200 Subject: [PATCH] 311 / 911 / No Phone Notify --- client/alerts.lua | 8 ++++---- client/utils.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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