BriGhtx3 Posted April 8, 2012 Author Posted April 8, 2012 I know that ;D I put it in my code The GUI is centered and the function works. Jaysday your code doesn't work as well Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 I know that ;DI put it in my code The GUI is centered and the function works. Jaysds your code doesn't work as well Is this all your script? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
BriGhtx3 Posted April 8, 2012 Author Posted April 8, 2012 What do you mean? oO This is the full code in this file Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Moderators Sarrum Posted April 8, 2012 Moderators Posted April 8, 2012 function centerWindow ( center_window ) local screenW, screenH = guiGetScreenSize ( ) local windowW, windowH = guiGetSize ( center_window, false ) local x, y = ( screenW-windowW )/2, ( screenH-windowH )/2 guiSetPosition ( center_window, x, y, false ) end HInv_Window = guiCreateWindow ( 354, 252, 362, 272, "Haushaltsinventar", false ) guiWindowSetSizable ( HInv_Window, false ) HInv_LBL_Welcome = guiCreateLabel ( 34, 25, 305, 35, "Hallo. Das ist dein Haushaltsinventar.\nVon hier aus kannst du M?bel in dein Haus platzieren.", false, HInv_Window ) guiSetFont ( HInv_LBL_Welcome, "default-bold-small" ) HInv_Grid = guiCreateGridList ( 38, 69, 290, 157, false, HInv_Window ) guiGridListSetSelectionMode ( HInv_Grid, 2 ) guiSetVisible ( HInv_Window, true ) hinvName = guiGridListAddColumn ( HInv_Grid, "Name", 2 ) HInv_BTN_Platzieren = guiCreateButton ( 90, 231, 186, 22, "Platzieren", false, HInv_Window ) centerWindow ( HInv_Window ) addEventHandler ( "onClientGUIClick", HInv_BTN_Platzieren, function ( ) guiSetVisible ( HInv_Window, false ) textITT ( ) end, false ) function textITT ( ) outputChatBox ( "TEXT" ) end
BriGhtx3 Posted April 8, 2012 Author Posted April 8, 2012 Tried it: doesn't work You didn't change anything oO You just inserted the centerWindow function, right? Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Moderators Sarrum Posted April 8, 2012 Moderators Posted April 8, 2012 Tried it: doesn't work I tested it, works.
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 try this: hi_window = guiCreateWindow(354,252,362,272,"Haushaltsinventar",false) guiWindowSetSizable(hi_window,false) --Label hi_lbl = guiCreateLabel(34,25,305,35,"Hallo. Das ist dein Haushaltsinventar.\nVon hier aus kannst du Möbel in dein Haus platzieren.",false,hi_window) guiSetFont(hi_lbl,"default-bold-small") --Grid hi_grid = guiCreateGridList(38,69,290,157,false,hi_window) guiGridListSetSelectionMode(hi_grid,2) hinvName = guiGridListAddColumn(hi_grid,"Name",2) --Button hi_btn = guiCreateButton(90,231,186,22,"Platzieren",false,hi_window) centerWindow(hi_window) addEventHandler("onClientGUIClick",root,function(button) if(button=="left")then if(source==hi_btn)then guiSetVisible(hi_window,false) textITT() end end end,false) I know what was wrong My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Smart. Posted April 8, 2012 Posted April 8, 2012 Tested and works perfectly. HInv_Window = guiCreateWindow(354,252,362,272,"Haushaltsinventar",false) guiWindowSetSizable(HInv_Window,false) HInv_LBL_Welcome = guiCreateLabel(34,25,305,35,"Hallo. Das ist dein Haushaltsinventar.\nVon hier aus kannst du Möbel in dein Haus platzieren.",false,HInv_Window) guiSetFont(HInv_LBL_Welcome,"default-bold-small") HInv_Grid = guiCreateGridList(38,69,290,157,false,HInv_Window) guiGridListSetSelectionMode(HInv_Grid,2) centerWindow(HInv_Window) hinvName = guiGridListAddColumn(HInv_Grid,"Name",2) HInv_BTN_Platzieren = guiCreateButton(90,231,186,22,"Platzieren",false,HInv_Window) function textITT() outputChatBox("TEXT") end addEventHandler( "onClientGUIClick" ,root, function() if (source == HInv_BTN_Platzieren) then guiSetVisible ( HInv_Window, false ) textITT() end end) lol
BriGhtx3 Posted April 8, 2012 Author Posted April 8, 2012 Lol I just don't get it Tried both codes and they don't work. Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
drk Posted April 8, 2012 Posted April 8, 2012 Debug. EPT Team Server Development: 0% Learning C++ | C++ is amazing
BriGhtx3 Posted April 8, 2012 Author Posted April 8, 2012 I would always post the errors if there were any ;D Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 try this: hi_window = guiCreateWindow(354,252,362,272,"Haushaltsinventar",false) guiWindowSetSizable(hi_window,false) guiSetVisible(hi_window,true) --Label hi_lbl = guiCreateLabel(34,25,305,35,"Hallo. Das ist dein Haushaltsinventar.\nVon hier aus kannst du Möbel in dein Haus platzieren.",false,hi_window) guiSetFont(hi_lbl,"default-bold-small") --Grid hi_grid = guiCreateGridList(38,69,290,157,false,hi_window) guiGridListSetSelectionMode(hi_grid,2) hinvName = guiGridListAddColumn(hi_grid,"Name",2) --Button hi_btn = guiCreateButton(90,231,186,22,"Platzieren",false,hi_window) centerWindow(hi_window) addEventHandler("onClientGUIClick",guiRoot,function(button) if(button=="left")then if(source==hi_btn)then guiSetVisible(hi_window,false) textITT() end end end,false) function textITT() outputChatBox("TEXT") end My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
BriGhtx3 Posted April 8, 2012 Author Posted April 8, 2012 What is guiRoot? I tried the script in your last post and turned off all resources. Now it works. Thank you Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 What is guiRoot?Thank you guiRoot is a new predefined variable: Predefined_variables_list and your welcome My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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