So basically this is a panic button that displays blip on the map, the police can use it when they need help by pressing f6 to open the menu and then in the menu there is option called panic button and when you press on the panic button there is another options (yes or no). So I plugged the yes option to displays the panic blip on the map but I don’t know how to plug the no option to remove the blip from the map
This is my menu
elseif data.current.value == ‘renfort’ then
local elements = {}
local playerPed = PlayerPedId()
table.insert(elements, {label = ('yes'), value = 'petite_demande'})
table.insert(elements, {label = ('no'), value = 'no'})
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'renfort', {
css = 'police',
title = ('are you sure'),
align = 'bottom-right',
elements = elements
}, function(data2, menu2)
local coords = GetEntityCoords(playerPed)
vehicle = ESX.Game.GetVehicleInDirection()
action = data2.current.value
local name = GetPlayerName(PlayerId())
if action == 'petite_demande' then
local raison = 'petit'
TriggerServerEvent('renfort', coords, raison)
else
menu2.close()
end
end, function(data2, menu2)
menu2.close()
end)
ــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
This is my scrip
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
RegisterNetEvent(‘renfort:setBlip’)
AddEventHandler(‘renfort:setBlip’, function(coords, raison)
if raison == ‘petit’ then
local blip = AddBlipForRadius(coords , 200.0) -- you can use a higher number for a bigger zone
SetBlipHighDetail(blip, true)
SetBlipColour(blip, 1)
SetBlipAlpha (blip, 128)
SetBlipFlashTimer(blip, 5)
SetBlipFlashes(blip, true)
PlaySoundFrontend(-1, "Start_Squelch", "CB_RADIO_SFX", 1)
PlaySoundFrontend(-1, "OOB_Start", "GTAO_FM_Events_Soundset", 1)
ESX.ShowAdvancedNotification('LSPD INFORMATIONS', '~b~Reinforcement request', 'Request for reinforcement requested.\nRéponse: ~g~Code3\n~w~Importance: ~g~slight.', 'CHAR_CALL911', 8)
Wait(1000)
PlaySoundFrontend(-1, "End_Squelch", "CB_RADIO_SFX", 1)
color = 1
Wait(10000)
RemoveBlip(blip)
end
end
end)