Hi,I found that this function is include in the source of fivem.
I can’t call it because it did not included in natives yet.
Without this the overlay lose clip after seconds.(but HasMinimapOverlayLoaded(overlayid) is true).
My code is
function LoadMinimapOverlay(cb)
if overlay == nil then
overlay = AddMinimapOverlay('nbk_pausemenu_map_position.gfx')
else
Wait(1)
end
while not HasMinimapOverlayLoaded(overlay) do
Wait(0)
end
cb( overlay)
end
Citizen.CreateThread(function()
while true do
local pos = GetEntityCoords(PlayerPedId())
print(HasMinimapOverlayLoaded(overlay))
LoadMinimapOverlay(function(GlobalOverlay)
if IsPauseMenuActive() then
SetMinimapOverlayDisplay(GlobalOverlay, 0.0,0.0, 100.0, 100.0, 100.0)
else
SetMinimapOverlayDisplay(GlobalOverlay, 0.0,0.0, 100.0, 100.0, 100.0)
end
--CallMinimapScaleformFunction(GlobalOverlay,"SET_CASH")
--PushScaleformMovieFunctionParameterInt(333320)
--PopScaleformMovieFunctionVoid()
end)
Citizen.Wait(200)
end
end )
It’s not comfortable to spam AddMinimapOverlay if I did not release/remove the last overlay.
Source of fivem:
Why would you think that would even be needed in the first place, and why don’t you think to just provide a repro for what is clearly a bug instead of requesting functionality for a workaround?
Most of drawings functions we spam it as a hobbit…so I think it should spam for normally…
Like GamerTag may lose clip after somewhile.So we have to recreate it for seconds.I took a look ‘playernames’ It’s like remove->add->remove->add.
So that I try to find RemoveMinimapOverlay and found it in the source code.
After that I try to call it as native.But It didn’t worked.So I try to request this function…
--line 66~75 playernames_cl.lua
if mpGamerTags[i] then
RemoveMpGamerTag(mpGamerTags[i].tag)
end
-- store the new tag
mpGamerTags[i] = {
tag = CreateMpGamerTag(GetPlayerPed(i), nameTag, false, false, '', 0),
ped = ped
}