Hey guys i have a question i use esx legacy and i want to add a blip to the ambulancejob on the map that comes when you press G (47). Have there taken a template but unfortunately that does not work quite have you there ne idea what I did wrong?
Client Side
function getEMSNotified()
local xPlayer = ESX.GetPlayerFromId(_source) if xPlayer.job.name == 'ambulance' then 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)]] TriggerServerEvent("esx_ambulancejob:helpblip", blips) TriggerEvent("chatMessage", "DISPATCH ", 3, 'a medic should be informed by now, you can still use /me')
end
endRegisterNetEvent(‘esx_ambulancejob:sendhelpblip’)
AddEventHandler(‘esx_ambulancejob:sendhelpblip’, function(blips)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)
end)
Server Side TOP
ESX = nil
local playersHealing, deadPlayers = {}, {}
TriggerEvent(‘esx:getSharedObject’, function(obj) ESX = obj end)
TriggerEvent(‘esx_phone:registerNumber’, ‘ambulance’, _U(‘alert_ambulance’), true, true)
TriggerEvent(‘esx_society:registerSociety’, ‘ambulance’, ‘Ambulance’, ‘society_ambulance’, ‘society_ambulance’, ‘society_ambulance’, {type = ‘public’})
ServerSide
RegisterServerEvent(‘esx_ambulancejob:helpblip’)
AddEventHandler(‘esx_ambulancejob:helpblip’, function(blips)local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local Players = ESX.GetPlayers()for i=1, players, 1 do
TriggerClientEvent(‘esx_ambulancejob:sendhelpblip’, Players[i], blips)
end
end)
I would really appreciate any help
warm greetings