GUi's

Started by Mr.Trant, Thu 15/05/2003 00:08:11

Previous topic - Next topic

Mr.Trant

how do u make it so a gui only pops up when u click on a button in the main gui, then when it pops u, it goes away when u click on the button in the gui that popped up????

Scorpiorus

#1
You should make a main GUI with a button (suppose it's name GUIMAIN and the number of button is 1), then choose button's properties and select Left Click: Run script. Now make another GUI: GUISUB (let's button number is 0). Don't forget to select Left Click: Run script too. Then inside interface_click() function add something like this:

//get called when a player has clicked on a GUI
function interface_click (int interface, int button) {

 if (interface == GUIMAIN) { //if player clicked on the MAIN GUI then...
    if (button == 1) { //if it was button 1 of that GUI he has clicked on
       GUIOn(GUISUB); //then show another gui
    }
   
 }
 
 else  if (interface == GUISUB) { //if player clicked on the SUB GUI then...
    if (button == 0) { //if it was button number 0 then...
      GUIOff(GUISUB); //close SUB GUI
    }

 }


}


that should work ;)

-Cheers

SMF spam blocked by CleanTalk