Blaawee Posted October 24, 2011 Share Posted October 24, 2011 (edited) hi guys need help in gui i made this graphical user interface ----------------- --The Windows ------------------ GUIEditor_Window = {} GUIEditor_Button = {} Shop_Window = guiCreateWindow(135,67,532,481,"Weapon Shop",false) guiSetAlpha(Shop_Window,0.69999998807907) guiWindowSetMovable(Shop_Window,true) guiWindowSetSizable(Shop_Window,false) guiSetVisible (Shop_Window, false) Pistol_popup = guiCreateButton(13,40,199,42,"Handguns",false,Shop_Window) guiSetFont(Pistol_popup,"sa-header") Weapon_popup = guiCreateButton(12,93,204,41,"Assault Rifles",false,Shop_Window) guiSetFont(Weapon_popup,"sa-header") Speical_popup = guiCreateButton(12,143,206,40,"Speical",false,Shop_Window) guiSetFont(Speical_popup,"sa-header") close = guiCreateButton(483,32,22,17,"X",false,Shop_Window) guiSetFont(close,"clear-normal") Pistol_Window = guiCreateWindow(135,67,532,481,"Handguns",false) guiSetAlpha(Pistol_Window,0.69999998807907) guiWindowSetMovable(Pistol_Window,true) guiWindowSetSizable(Pistol_Window,false) GUIEditor_Button[7] = guiCreateButton(9,39,204,42,"Pistol",false,Pistol_Window) GUIEditor_Button[8] = guiCreateButton(9,93,204,40,"Silenced Pistol",false,Pistol_Window) GUIEditor_Button[9] = guiCreateButton(9,144,207,41,"Desert Eagle",false,Pistol_Window) GUIEditor_Button[10] = guiCreateButton(401,442,121,30,"<| Back",false,Pistol_Window) Weapon_Window = guiCreateWindow(135,67,532,481,"Assault Rifles",false) guiWindowSetMovable(Weapon_Window,true) guiWindowSetSizable(Weapon_Window,false) GUIEditor_Button[11] = guiCreateButton(12,43,194,39,"AK-47",false,Weapon_Window) GUIEditor_Button[12] = guiCreateButton(10,92,198,39,"M4",false,Weapon_Window) GUIEditor_Button[13] = guiCreateButton(11,145,198,40,"Weapon 3",false,Weapon_Window) GUIEditor_Button[14] = guiCreateButton(401,442,121,30,"<| Back",false,Weapon_Window) Spiciacl_Window = guiCreateWindow(135,67,532,481,"Spiciacl",false) guiWindowSetMovable(Spiciacl_Window,true) guiWindowSetSizable(Spiciacl_Window,false) GUIEditor_Button[16] = guiCreateButton(290,13,5,5,"",false,Spiciacl_Window) GUIEditor_Button[17] = guiCreateButton(43,44,171,39,"spe 1",false,Spiciacl_Window) GUIEditor_Button[18] = guiCreateButton(44,96,171,39,"spe 2",false,Spiciacl_Window) GUIEditor_Button[19] = guiCreateButton(46,146,170,38,"spe 3",false,Spiciacl_Window) GUIEditor_Button[20] = guiCreateButton(401,442,121,30,"<| Back",false,Spiciacl_Window) bindKey ( "F2" , "down" , function() if ( guiGetVisible ( Shop_Window ) == true ) then guiSetVisible ( Shop_Window ,false ) showCursor (false ) guiSetInputEnabled(false) elseif ( guiGetVisible ( Shop_Window ) == false ) then guiSetVisible ( Shop_Window ,true ) showCursor (false ) guiSetInputEnabled(true) end end ) all i want to do is when i press the button popup a new window e.x. when i press the button (Pistol_popup = guiCreateButton(13,40,199,42,"Handguns",false,Shop_Window) ) popup Pistol_Window = guiCreateWindow(135,67,532,481,"Handguns",false) and when i press (GUIEditor_Button[10] = guiCreateButton(401,442,121,30,"<| Back",false,Pistol_Window)) hide the window Edited October 24, 2011 by Guest Link to comment
Castillo Posted October 24, 2011 Share Posted October 24, 2011 ----------------- --The Windows ------------------ GUIEditor_Window = {} GUIEditor_Button = {} Shop_Window = guiCreateWindow(135,67,532,481,"Weapon Shop",false) guiSetAlpha(Shop_Window,0.69999998807907) guiWindowSetMovable(Shop_Window,true) guiWindowSetSizable(Shop_Window,false) guiSetVisible (Shop_Window, false) Pistol_popup = guiCreateButton(13,40,199,42,"Handguns",false,Shop_Window) guiSetFont(Pistol_popup,"sa-header") Weapon_popup = guiCreateButton(12,93,204,41,"Assault Rifles",false,Shop_Window) guiSetFont(Weapon_popup,"sa-header") Speical_popup = guiCreateButton(12,143,206,40,"Speical",false,Shop_Window) guiSetFont(Speical_popup,"sa-header") close = guiCreateButton(483,32,22,17,"X",false,Shop_Window) guiSetFont(close,"clear-normal") addEventHandler ( "onClientGUIClick", close, down, false ) Pistol_Window = guiCreateWindow(135,67,532,481,"Handguns",false) guiSetAlpha(Pistol_Window,0.69999998807907) guiWindowSetMovable(Pistol_Window,true) guiWindowSetSizable(Pistol_Window,false) GUIEditor_Button[7] = guiCreateButton(9,39,204,42,"Pistol",false,Pistol_Window) GUIEditor_Button[8] = guiCreateButton(9,93,204,40,"Silenced Pistol",false,Pistol_Window) GUIEditor_Button[9] = guiCreateButton(9,144,207,41,"Desert Eagle",false,Pistol_Window) GUIEditor_Button[10] = guiCreateButton(401,442,121,30,"<| Back",false,Pistol_Window) Weapon_Window = guiCreateWindow(135,67,532,481,"Assault Rifles",false) guiWindowSetMovable(Weapon_Window,true) guiWindowSetSizable(Weapon_Window,false) GUIEditor_Button[11] = guiCreateButton(12,43,194,39,"AK-47",false,Weapon_Window) GUIEditor_Button[12] = guiCreateButton(10,92,198,39,"M4",false,Weapon_Window) GUIEditor_Button[13] = guiCreateButton(11,145,198,40,"Weapon 3",false,Weapon_Window) GUIEditor_Button[14] = guiCreateButton(401,442,121,30,"<| Back",false,Weapon_Window) Spiciacl_Window = guiCreateWindow(135,67,532,481,"Spiciacl",false) guiWindowSetMovable(Spiciacl_Window,true) guiWindowSetSizable(Spiciacl_Window,false) GUIEditor_Button[16] = guiCreateButton(290,13,5,5,"",false,Spiciacl_Window) GUIEditor_Button[17] = guiCreateButton(43,44,171,39,"spe 1",false,Spiciacl_Window) GUIEditor_Button[18] = guiCreateButton(44,96,171,39,"spe 2",false,Spiciacl_Window) GUIEditor_Button[19] = guiCreateButton(46,146,170,38,"spe 3",false,Spiciacl_Window) GUIEditor_Button[20] = guiCreateButton(401,442,121,30,"<| Back",false,Spiciacl_Window) bindKey ( "F2" , "down" , function() if ( guiGetVisible ( Shop_Window ) == true ) then guiSetVisible ( Shop_Window ,false ) showCursor (false ) guiSetInputEnabled(false) elseif ( guiGetVisible ( Shop_Window ) == false ) then guiSetVisible ( Shop_Window ,true ) showCursor (false ) guiSetInputEnabled(true) end end ) addEventHandler("onClientGUIClick",root, function () if (source == Pistol_popup) then guiSetVisible(Pistol_Window, not guiGetVisible(Pistol_Window)) elseif (source == Weapon_popup) then guiSetVisible(Weapon_Window, not guiGetVisible(Weapon_Window)) end end) Link to comment
Blaawee Posted October 24, 2011 Author Share Posted October 24, 2011 thx Solidsnake14 , what about the button <| Back ? Link to comment
Castillo Posted October 24, 2011 Share Posted October 24, 2011 You can check how I did it and do it with the "Back" button(s). Link to comment
Blaawee Posted October 24, 2011 Author Share Posted October 24, 2011 i didn't got the idea :@ Link to comment
Castillo Posted October 24, 2011 Share Posted October 24, 2011 ----------------- --The Windows ------------------ GUIEditor_Window = {} GUIEditor_Button = {} Shop_Window = guiCreateWindow(135,67,532,481,"Weapon Shop",false) guiSetAlpha(Shop_Window,0.69999998807907) guiWindowSetMovable(Shop_Window,true) guiWindowSetSizable(Shop_Window,false) guiSetVisible (Shop_Window, false) Pistol_popup = guiCreateButton(13,40,199,42,"Handguns",false,Shop_Window) guiSetFont(Pistol_popup,"sa-header") Weapon_popup = guiCreateButton(12,93,204,41,"Assault Rifles",false,Shop_Window) guiSetFont(Weapon_popup,"sa-header") Speical_popup = guiCreateButton(12,143,206,40,"Speical",false,Shop_Window) guiSetFont(Speical_popup,"sa-header") close = guiCreateButton(483,32,22,17,"X",false,Shop_Window) guiSetFont(close,"clear-normal") addEventHandler ( "onClientGUIClick", close, down, false ) Pistol_Window = guiCreateWindow(135,67,532,481,"Handguns",false) guiSetAlpha(Pistol_Window,0.69999998807907) guiWindowSetMovable(Pistol_Window,true) guiWindowSetSizable(Pistol_Window,false) GUIEditor_Button[7] = guiCreateButton(9,39,204,42,"Pistol",false,Pistol_Window) GUIEditor_Button[8] = guiCreateButton(9,93,204,40,"Silenced Pistol",false,Pistol_Window) GUIEditor_Button[9] = guiCreateButton(9,144,207,41,"Desert Eagle",false,Pistol_Window) GUIEditor_Button[10] = guiCreateButton(401,442,121,30,"<| Back",false,Pistol_Window) Weapon_Window = guiCreateWindow(135,67,532,481,"Assault Rifles",false) guiWindowSetMovable(Weapon_Window,true) guiWindowSetSizable(Weapon_Window,false) GUIEditor_Button[11] = guiCreateButton(12,43,194,39,"AK-47",false,Weapon_Window) GUIEditor_Button[12] = guiCreateButton(10,92,198,39,"M4",false,Weapon_Window) GUIEditor_Button[13] = guiCreateButton(11,145,198,40,"Weapon 3",false,Weapon_Window) GUIEditor_Button[14] = guiCreateButton(401,442,121,30,"<| Back",false,Weapon_Window) Spiciacl_Window = guiCreateWindow(135,67,532,481,"Spiciacl",false) guiWindowSetMovable(Spiciacl_Window,true) guiWindowSetSizable(Spiciacl_Window,false) GUIEditor_Button[16] = guiCreateButton(290,13,5,5,"",false,Spiciacl_Window) GUIEditor_Button[17] = guiCreateButton(43,44,171,39,"spe 1",false,Spiciacl_Window) GUIEditor_Button[18] = guiCreateButton(44,96,171,39,"spe 2",false,Spiciacl_Window) GUIEditor_Button[19] = guiCreateButton(46,146,170,38,"spe 3",false,Spiciacl_Window) GUIEditor_Button[20] = guiCreateButton(401,442,121,30,"<| Back",false,Spiciacl_Window) bindKey ( "F2" , "down" , function() if ( guiGetVisible ( Shop_Window ) == true ) then guiSetVisible ( Shop_Window ,false ) showCursor (false ) guiSetInputEnabled(false) elseif ( guiGetVisible ( Shop_Window ) == false ) then guiSetVisible ( Shop_Window ,true ) showCursor (false ) guiSetInputEnabled(true) end end ) addEventHandler("onClientGUIClick",root, function () if (source == Pistol_popup) then guiSetVisible(Pistol_Window, not guiGetVisible(Pistol_Window)) elseif (source == Weapon_popup) then guiSetVisible(Weapon_Window, not guiGetVisible(Weapon_Window)) elseif(source == GUIEditor_Button[10]) then guiSetVisible(Pistol_Window, false) end end) Link to comment
Blaawee Posted October 24, 2011 Author Share Posted October 24, 2011 like this ?? ----------------- --The Windows ------------------ GUIEditor_Window = {} GUIEditor_Button = {} Shop_Window = guiCreateWindow(135,67,532,481,"Weapon Shop",false) guiSetAlpha(Shop_Window,0.69999998807907) guiWindowSetMovable(Shop_Window,true) guiWindowSetSizable(Shop_Window,false) guiSetVisible (Shop_Window, false) Pistol_popup = guiCreateButton(13,40,199,42,"Handguns",false,Shop_Window) guiSetFont(Pistol_popup,"sa-header") Weapon_popup = guiCreateButton(12,93,204,41,"Assault Rifles",false,Shop_Window) guiSetFont(Weapon_popup,"sa-header") Speical_popup = guiCreateButton(12,143,206,40,"Speical",false,Shop_Window) guiSetFont(Speical_popup,"sa-header") close = guiCreateButton(483,32,22,17,"X",false,Shop_Window) guiSetFont(close,"clear-normal") Pistol_Window = guiCreateWindow(135,67,532,481,"Handguns",false) guiSetAlpha(Pistol_Window,0.69999998807907) guiWindowSetMovable(Pistol_Window,true) guiWindowSetSizable(Pistol_Window,false) --this Buttons to give weapon give_Pistol = guiCreateButton(9,39,204,42,"Pistol",false,Pistol_Window) give_SPistol = guiCreateButton(9,93,204,40,"Silenced Pistol",false,Pistol_Window) give_DEagle = guiCreateButton(9,144,207,41,"Desert Eagle",false,Pistol_Window) Hidep = guiCreateButton(401,442,121,30,"<| Back",false,Pistol_Window) Weapon_Window = guiCreateWindow(135,67,532,481,"Assault Rifles",false) guiWindowSetMovable(Weapon_Window,true) guiWindowSetSizable(Weapon_Window,false) GUIEditor_Button[11] = guiCreateButton(12,43,194,39,"AK-47",false,Weapon_Window) GUIEditor_Button[12] = guiCreateButton(10,92,198,39,"M4",false,Weapon_Window) GUIEditor_Button[13] = guiCreateButton(11,145,198,40,"Weapon 3",false,Weapon_Window) GUIEditor_Button[14] = guiCreateButton(401,442,121,30,"<| Back",false,Weapon_Window) Spiciacl_Window = guiCreateWindow(135,67,532,481,"Spiciacl",false) guiWindowSetMovable(Spiciacl_Window,true) guiWindowSetSizable(Spiciacl_Window,false) GUIEditor_Button[16] = guiCreateButton(290,13,5,5,"",false,Spiciacl_Window) GUIEditor_Button[17] = guiCreateButton(43,44,171,39,"spe 1",false,Spiciacl_Window) GUIEditor_Button[18] = guiCreateButton(44,96,171,39,"spe 2",false,Spiciacl_Window) GUIEditor_Button[19] = guiCreateButton(46,146,170,38,"spe 3",false,Spiciacl_Window) GUIEditor_Button[20] = guiCreateButton(401,442,121,30,"<| Back",false,Spiciacl_Window) bindKey ( "F2" , "down" , function() if ( guiGetVisible ( Shop_Window ) == true ) then guiSetVisible ( Shop_Window ,false ) showCursor (false ) guiSetInputEnabled(false) elseif ( guiGetVisible ( Shop_Window ) == false ) then guiSetVisible ( Shop_Window ,true ) showCursor (false ) guiSetInputEnabled(true) end end ) addEventHandler("onClientGUIClick",root, function () if (source == Pistol_popup) then guiSetVisible(Pistol_Window, not guiGetVisible(Pistol_Window)) elseif (source == Weapon_popup) then guiSetVisible(Weapon_Window, not guiGetVisible(Weapon_Window)) elseif (source == Speical_popup) then guiSetVisible(Spiciacl_Window, not guiGetVisible(Spiciacl_Window)) elseif (source == Hidep) then guiSetVisible(Pistol_Window) end end) Link to comment
Castillo Posted October 24, 2011 Share Posted October 24, 2011 ----------------- --The Windows ------------------ GUIEditor_Window = {} GUIEditor_Button = {} Shop_Window = guiCreateWindow(135,67,532,481,"Weapon Shop",false) guiSetAlpha(Shop_Window,0.69999998807907) guiWindowSetMovable(Shop_Window,true) guiWindowSetSizable(Shop_Window,false) guiSetVisible (Shop_Window, false) Pistol_popup = guiCreateButton(13,40,199,42,"Handguns",false,Shop_Window) guiSetFont(Pistol_popup,"sa-header") Weapon_popup = guiCreateButton(12,93,204,41,"Assault Rifles",false,Shop_Window) guiSetFont(Weapon_popup,"sa-header") Speical_popup = guiCreateButton(12,143,206,40,"Speical",false,Shop_Window) guiSetFont(Speical_popup,"sa-header") close = guiCreateButton(483,32,22,17,"X",false,Shop_Window) guiSetFont(close,"clear-normal") Pistol_Window = guiCreateWindow(135,67,532,481,"Handguns",false) guiSetAlpha(Pistol_Window,0.69999998807907) guiWindowSetMovable(Pistol_Window,true) guiWindowSetSizable(Pistol_Window,false) --this Buttons to give weapon give_Pistol = guiCreateButton(9,39,204,42,"Pistol",false,Pistol_Window) give_SPistol = guiCreateButton(9,93,204,40,"Silenced Pistol",false,Pistol_Window) give_DEagle = guiCreateButton(9,144,207,41,"Desert Eagle",false,Pistol_Window) Hidep = guiCreateButton(401,442,121,30,"<| Back",false,Pistol_Window) Weapon_Window = guiCreateWindow(135,67,532,481,"Assault Rifles",false) guiWindowSetMovable(Weapon_Window,true) guiWindowSetSizable(Weapon_Window,false) GUIEditor_Button[11] = guiCreateButton(12,43,194,39,"AK-47",false,Weapon_Window) GUIEditor_Button[12] = guiCreateButton(10,92,198,39,"M4",false,Weapon_Window) GUIEditor_Button[13] = guiCreateButton(11,145,198,40,"Weapon 3",false,Weapon_Window) GUIEditor_Button[14] = guiCreateButton(401,442,121,30,"<| Back",false,Weapon_Window) Spiciacl_Window = guiCreateWindow(135,67,532,481,"Spiciacl",false) guiWindowSetMovable(Spiciacl_Window,true) guiWindowSetSizable(Spiciacl_Window,false) GUIEditor_Button[16] = guiCreateButton(290,13,5,5,"",false,Spiciacl_Window) GUIEditor_Button[17] = guiCreateButton(43,44,171,39,"spe 1",false,Spiciacl_Window) GUIEditor_Button[18] = guiCreateButton(44,96,171,39,"spe 2",false,Spiciacl_Window) GUIEditor_Button[19] = guiCreateButton(46,146,170,38,"spe 3",false,Spiciacl_Window) GUIEditor_Button[20] = guiCreateButton(401,442,121,30,"<| Back",false,Spiciacl_Window) bindKey ( "F2" , "down" , function() if ( guiGetVisible ( Shop_Window ) == true ) then guiSetVisible ( Shop_Window ,false ) showCursor (false ) guiSetInputEnabled(false) elseif ( guiGetVisible ( Shop_Window ) == false ) then guiSetVisible ( Shop_Window ,true ) showCursor (false ) guiSetInputEnabled(true) end end ) addEventHandler("onClientGUIClick",root, function () if (source == Pistol_popup) then guiSetVisible(Pistol_Window, not guiGetVisible(Pistol_Window)) elseif (source == Weapon_popup) then guiSetVisible(Weapon_Window, not guiGetVisible(Weapon_Window)) elseif (source == Speical_popup) then guiSetVisible(Spiciacl_Window, not guiGetVisible(Spiciacl_Window)) elseif (source == Hidep) then guiSetVisible(Pistol_Window, false) end end) Link to comment
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