I Made a Native UI Menu that works fine. I added in that you have to be in certain locations for the menu to open.
There are makers on the map for you to know were to open it. After testing it when you join the Markers are there but the menu wont open with out restarting the resource
if (World.GetDistance(playerped.Position, marker) < 2f) {
Debug.WriteLine("I am within range");
if(Game.IsControlJustReleased(1, Control.SelectCharacterMichael)){
Debug.WriteLine("I am pressing the button");
mainMenu.Visible = !mainMenu.Visible;
}
}
Alright glad you figured it out, I found it not very logical anyway to do: Ped playerped = Game.Player.Character; and after initialize the Vector3 marker.
May aswel get the player position right away Vector3 playerpos = Game.Player.Character.Position;