mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 10:48:52 +00:00
Add phone number
This commit is contained in:
@@ -32,4 +32,21 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function(
|
||||
|
||||
cb()
|
||||
|
||||
end)
|
||||
|
||||
TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message, anon)
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
local xPlayers = ESX.GetPlayers()
|
||||
|
||||
if phoneNumber == 'ambulance' then
|
||||
for k, v in pairs(xPlayers) do
|
||||
if v.job.name == 'ambulance' then
|
||||
TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId)
|
||||
TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Alerte Ambulance', requestId)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end)
|
||||
Reference in New Issue
Block a user