With a simple code in your init. I recommed to take a look at sources which have the feature already. So you can look how they solved it.I have game modes located in my menu, but I want it to where once you load a gamemode and the game restarts, that the menu is locked and it will not open until you go back. How can I lock the menu?
LockMenu()
{
//self _closeMenu();
//wait .3;
self.menuLocked = true;
self iprintln("^1Menu Now Locked");
}
UnlockMenu()
{
self.menuLocked = false;
self iprintln("^2Menu Now Unlocked");
}
Thanks, I'll test it.so all you do is make a Var to see if the menu is open or closed.
add this into your MonitorButtons (Maybe called something different):
self.menuLocked = false;
Once you have done that you need to do a check on your open button monitoring, Example:
if(self actionSlotOneButtonPressed() && !self.menu.open && !self.menuLocked)
Once you have done both of them you can start working on the lock menu and unlockMenu:
Code:LockMenu() { //self _closeMenu(); //wait .3; self.menuLocked = true; self iprintln("^1Menu Now Locked"); } UnlockMenu() { self.menuLocked = false; self iprintln("^2Menu Now Unlocked"); }
NOTE: I recommend running your close menu when you lock your menu so they wont be any issues down the line, also take note the text above is all examples and may not work so you will need to make it suite the base you are using.
~Extinct
Let me know if you need anymore help, @CabCon and @StonedYoda first of all why didn't you just help him and it isn't a code in the inits dafuq, that is utter nonsense, If its that simple why tf didn't you just help him.Thanks, I'll test it.
Let me know if you need anymore help, @CabCon and @StonedYoda first of all why didn't you just help him and it isn't a code in the inits dafuq, that is utter nonsense, If its that simple why tf didn't you just help him.
~Extinct
sure you are.im stoned
I added everything as you said correctly... So when I useLet me know if you need anymore help, @CabCon and @StonedYoda first of all why didn't you just help him and it isn't a code in the inits dafuq, that is utter nonsense, If its that simple why tf didn't you just help him.
~Extinct
gameSelector(G)
{
self resetdvars();
self thread kickAllBots();
iPrintln("^2Changing Game Mode...");
setDvar("customgametype",G);
self fastRestart();
//self LockMenu();
}
looks goodI added everything as you said correctly... So when I use
Would I lock the menu there?Code:gameSelector(G) { self resetdvars(); self thread kickAllBots(); iPrintln("^2Changing Game Mode..."); setDvar("customgametype",G); self fastRestart(); //self LockMenu(); }
Dammit, thats not working. The menu will still openlooks good
lol you've messed up somewhere.Dammit, thats not working. The menu will still open
Thank you, I was online on my smartphone. But I also thought he want something similar like a gamemode menu. Like the menus in w@w have it.Let me know if you need anymore help, @CabCon and @StonedYoda first of all why didn't you just help him and it isn't a code in the inits dafuq, that is utter nonsense, If its that simple why tf didn't you just help him.
~Extinct
You could simply change the onplayerconnect and onplayerspawn to a different name (In your gamemode), then the menu wont be called with the gamemode. I've had this problem before. If you need anymore help, message me on skype "ryan.fout1" ill be happy to help. <3I have game modes located in my menu, but I want it to where once you load a gamemode and the game restarts, that the menu is locked and it will not open until you go back. How can I lock the menu?
Thank youYou could simply change the onplayerconnect and onplayerspawn to a different name (In your gamemode), then the menu wont be called with the gamemode. I've had this problem before. If you need anymore help, message me on skype "ryan.fout1" ill be happy to help. <3
Thank you