Hello
When a player dies, he gets to press Button ‘G’, I want ambulance to be informed by a notification and a blip shows up
I did it this way :
if IsControlPressed(0, Keys['G']) then
SendDistressSignal()
getEMSNotified()
Citizen.CreateThread(function()
Citizen.Wait(1000 * 60 * 5)
if IsDead then
StartDistressSignal()
end
end)
break
end
function getEMSNotified()
local blips = {
{title= "Attention required" , colour=3, id=1, x = PedPosition.x, y = PedPosition.y, z = PedPosition.z }
}
Citizen.CreateThread(function()
for _, info in pairs(blips) do
info.blip = AddBlipForCoord(info.x, info.y, info.z)
SetBlipSprite(info.blip, info.id)
SetBlipDisplay(info.blip, 4)
SetBlipScale(info.blip, 1.0)
SetBlipColour(info.blip, info.colour)
SetBlipAsShortRange(info.blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(info.title)
EndTextCommandSetBlipName(info.blip)
end
end)
TriggerEvent("chatMessage", "DISPATCH ", 3, 'a medic should be informed by now, you can still use /me')
end
The blip shows only to me when I revive my self and not to any medic