Hello all ,
As I have talked about it a bit two weeks ago in with some posts in this topic : [Releases] [Free] Cayo Perico Improvements Freeroam 4.2.2
I found a way to load the Cayo Perico minimap all of the time without breaking every other interiors minimap. I think that this can have it’s own topic so that people will be able to find it easily.
You can find the original post here :
He is the snippet with some comments :
---Will be true if the player is close to cayo perico
---@type boolean
local _isCloseToCayo = false
---Will be true if the minimap is loaded with SetToggleMinimapHeistIsland
---@type boolean
local _isCayoMinimapLoaded = false
---Checks coords to know if the player is close enough to cayo perico to be in need to load the minimap with SetToggleMinimapHeistIsland
Citizen.CreateThread(function()
while true do
---Wether the player is actually close to cayo perico or not
---@type boolean
local isCloseToCayo<const> = #(GetEntityCoords(PlayerPedId()) - vector3(4858.0, -5171.0, 2.0)) < 2200.0
if _isCloseToCayo ~= isCloseToCayo then
-- If the player is now close to cayo perico and was not, or vice versa
-- Then we init our variables and unload the minimap
_isCloseToCayo = isCloseToCayo
_isCayoMinimapLoaded = isCloseToCayo
-- switch radar interior
SetToggleMinimapHeistIsland(_isCloseToCayo)
end
Wait(5000)
end
end)
---Handle the minimap loading and unloading
CreateThread(function()
while true do
---We don't need to do something every frame in every cases
---@type integer
local wait = 500
if IsPauseMenuActive() and not IsMinimapInInterior() then
-- If the player is in the pause menu and not looking at an interior minimap
if _isCayoMinimapLoaded then
-- If the minimap was loaded with SetToggleMinimapHeistIsland, then we disable it
_isCayoMinimapLoaded = false
SetToggleMinimapHeistIsland(false)
end
-- We force load the cayo perico minimap
SetRadarAsExteriorThisFrame()
SetRadarAsInteriorThisFrame(GetHashKey("h4_fake_islandx"), 4700.0, -5145.0, 0, 0)
wait = 0
elseif not _isCayoMinimapLoaded and _isCloseToCayo then
-- If the minimap is not loaded with SetToggleMinimapHeistIsland and the player is close to cayo perico, then we load it
_isCayoMinimapLoaded = true
SetToggleMinimapHeistIsland(true)
end
Wait(wait)
end
end)
Resmon goes from 0.00ms idle, to 0.02ms when it has to load the minimap on the pause menu.
Here is what it will look like and with the ms consumptions :
Default minimap and radars are used.
-
On los santos, pause menu closed :
-
On los santos, pause menu opened :
-
On los santos and inside of an interior, pause menu closed :
-
On los santos and inside of an interior, pause menu opened and looking at the interior minimap:
-
On los santos and inside of an interior, pause menu opened and changed view to see the whole map :
-
On cayo perico, pause menu closed :
-
On cayo perico, pause menu opened :
Here is the really small resource that I used for these screenshots :
cayo_map.zip (1.3 KB)
So that you can test it easily and anybody have an example of how to use the snippet
There are two slight issues that I couldn’t find a way to fix :
-
Once you have changed the view from inside an interior to see the whole map, you can’t go back to the interior minimap without closing and opening your pause menu
-
I couldn’t move the radar border, so we can’t go further to the right and bottom when the map is opened.
To fix this, you need to set a blip in the far bottom right corner.
See more informations here : [How-To] Load CayoPerico minimap all of the time - #3 by Blaxered
Thanks to @Blaxered for the information <3
If somebody knows how to fix any of these, I would be pleased to learn about it.