I found on the FiveM forum a post by user Vespura about a resource that sent a message in the location where the player was.
I tried to implement it in my trash resource, but I only get the address “Spanish Avenue” as a return.
Client-side:
local ped = PlayerPedId()
local x,y,z = GetStreetNameAtCoord(Config.Markers.Cloakroom.Pos)
local streetName, crossing = GetStreetNameAtCoord(x,y,z)
streetName = GetStreetNameFromHashKey(streetName)
if crossing ~= nil then
crossing = GetStreetNameFromHashKey(crossing)
adress = string.format(_U('reference_mission_service', streetName, crossing))
else
adress = string.format(_U('mission_service', streetName))
end
exports.es_extended:drawMissionText(adress, 10000)
-- TriggerServerEvent('sendChatMessage', drawMissionText)
Config (coordinates):
Config.GarbageCollections = {
{type = 'Collection', size = 5.0 , name = 'collection', pos = vector3(-505.9,-1801.57,21.04)},
}
Can someone help me, please?