I recall playing RDR2 and pressing “M” brings up the full screen map. I’d like to put something on my server that does this rather than going to the pause menu and then pressing again for the map.
I found a native that is supposed to do this, however I don’t know how to call it up.
Heyo
, try this in a client-side script:
--lua
RegisterCommand('map', function(source, args)
ActivateFrontendMenu("FE_MENU_VERSION_MP_PAUSE", true, -1) --Opens a frontend-type menu. Scaleform is already loaded, but can be changed.
while not IsPauseMenuActive() or IsPauseMenuRestarting() do --Making extra-sure that the frontend menu is fully loaded
Wait(0)
end
PauseMenuceptionGoDeeper(0) --Setting up the context menu of the Pause Menu. For other frontend menus, use https://docs.fivem.net/natives/?_0xDD564BDD0472C936
end)
edit: this seems to cause weirdness, when trying to go back (you have to press Back twice). Not sure why, but you should be able to fix it.
You have more faith in me than I deserve. I had no idea how to bring this up reliably. Every time I tried this native, it brought the map up all by itself at weird times. If you can see a way to exit without pressing bach twice, I’d appreciate your input.
You’re always such a great help. I enjoy reading your posts and learn quite a bit.
there you go!
--lua
RegisterCommand('map', function(source, args)
ActivateFrontendMenu("FE_MENU_VERSION_MP_PAUSE", false, -1) --Opens a frontend-type menu. Scaleform is already loaded, but can be changed.
while not IsPauseMenuActive() or IsPauseMenuRestarting() do --Making extra-sure that the frontend menu is fully loaded
Wait(0)
end
PauseMenuceptionGoDeeper(0) --Setting up the context menu of the Pause Menu. For other frontend menus, use https://docs.fivem.net/natives/?_0xDD564BDD0472C936
PauseMenuceptionTheKick()
while not IsControlJustPressed(2,202) and not IsControlJustPressed(2,200) and not IsControlJustPressed(2,199) do --Waiting for any of frontend cancel buttons to be hit. Kinda slow but whatever.
Wait(0)
end
PauseMenuceptionTheKick() --doesn't really work, but the native's name is funny.
SetFrontendActive(false) --Force-closing the entire frontend menu. I wanted a simple back button, but R* forced my hand.
end)