theralio Posted August 16, 2018 Share Posted August 16, 2018 Hi, i created a menu with NativeUI and the menu works Perfect but i want to know how can i fix it that it works like this bcs atm it wont open when iam at the position mp.keys.bind(0x71, false, () => { mp.players.forEachInRange(new mp.Vector3(238.60870361328125, -2576.864990234375, 5.962751388549805), 10, (player) => { if (mainMenu.Visible) mainMenu.Close(); else mainMenu.Open(); }) }); Link to comment Share on other sites More sharing options...
Doom Posted August 19, 2018 Share Posted August 19, 2018 If I understand you correctly I don't see why you need to loop the player pool to show the menu to yourself. All you need is to get your local player's position and compare the two vectors. mp.keys.bind(0x71, false, () => { let playerPos = mp.players.local.position; if(mp.game.system.vdist2(playerPos.x, playerPos.y, playerPos.z, 238.60870361328125, -2576.864990234375, 5.962751388549805) <= 10) { if (mainMenu.Visible) mainMenu.Close(); else mainMenu.Open(); } }); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now