Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions client/alerts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -545,16 +545,16 @@ 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
PhoneAnimation()

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,
Expand All @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion client/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down