CapY Posted July 11, 2011 Share Posted July 11, 2011 Hey ! I have a little problem with welcome screen window.... It's dont want to start when player joins. CheckBox don't Work and Accept button doesn't works. -- Created: 02/07/2011 09:45 addEventHandler("onClientResourceStart",resourceRoot, function() guiEditor_Memo = {} guiEditor_Label = {} guiEditor_Image = {} guiFgWelcomeWindow = guiCreateWindow(77,262,1279,1023," R U L E S ! ",false) guiSetAlpha(GUIFgWelcomeWindow,1) guiWindowSetSizable(GUIFgWelcomeWindow,false) guiFgOkButton = guiCreateButton(564,943,172,59,"O K ! ",false,GUIFgWelcomeWindow) guiSetAlpha(GUIFgOkButton,1) guiSetFont(GUIFgOkButton,"clear-normal") guiFgImage = guiCreateStaticImage(9,21,1261,333,"images/FGOfficialLogo.png",false,GUIFgWelcomeWindow) guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,GUIFgWelcomeWindow) guiSetAlpha(GUIEditor_Label[1],1) guiLabelSetColor(GUIEditor_Label[1],0, 155 ,155) guiSetFont(GUIEditor_Label[1],"clear-normal") guiFgRulesMemo = guiCreateMemo(2,5,1265,565," [FG] Rules !\n\n\n\n\n\n**********************************************************************************************************************************************************************************\n T H I S I S A F R E E R O A M !!!\n\n*DO NOT ADVERTISE !\n\n\n*DO NOT SPAM THE CHAT !\n\n\n*DO NO SPAM VEHICLES ! \n\n\n*DO NOT BE ANNOYING !\n\n\n*BE NICE, RESPECT OTHERS !\n\n\n*DO NOT USE HACKS, CHEATS OR HANDLING CFG !\n\n\n***************************************************************\n\nAbove all, Have fun ! \n\n",false,GUIEditor_Label[1]) guiMemoSetReadOnly(GUIFgRulesMemo,true) guiEditor_Image[1] = guiCreateStaticImage(19,953,91,56,"images/shruk.png",false,GUIFgWelcomeWindow) guiFgCheckBox = guiCreateCheckBox(398,940,343,72,"",false,false,GUIFgWelcomeWindow) guiCheckBoxSetSelected(GUIFgCheckBox,true) guiEditor_Memo[1] = guiCreateMemo(15,3,148,37,"I accept these Rules ! ",false,GUIFgCheckBox) end ) addEventHandler ( "onClientGUIClick", guiFgOkButton ) addEventHandler ( "onClientClick", getRootElement(), guiFgOkButton ) Link to comment
Castillo Posted July 11, 2011 Share Posted July 11, 2011 You had many errors here... try with this: -- Created: 02/07/2011 09:45 addEventHandler("onClientResourceStart",resourceRoot, function() guiEditor_Memo = {} guiEditor_Label = {} guiEditor_Image = {} guiFgWelcomeWindow = guiCreateWindow(77,262,1279,1023," R U L E S ! ",false) guiSetAlpha(GUIFgWelcomeWindow,1) guiWindowSetSizable(GUIFgWelcomeWindow,false) guiFgOkButton = guiCreateButton(564,943,172,59,"O K ! ",false,GUIFgWelcomeWindow) guiSetAlpha(GUIFgOkButton,1) guiSetFont(GUIFgOkButton,"clear-normal") guiFgImage = guiCreateStaticImage(9,21,1261,333,"images/FGOfficialLogo.png",false,GUIFgWelcomeWindow) guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,GUIFgWelcomeWindow) guiSetAlpha(GUIEditor_Label[1],1) guiLabelSetColor(GUIEditor_Label[1],0, 155 ,155) guiSetFont(GUIEditor_Label[1],"clear-normal") guiFgRulesMemo = guiCreateMemo(2,5,1265,565," [FG] Rules !\n\n\n\n\n\n**********************************************************************************************************************************************************************************\n T H I S I S A F R E E R O A M !!!\n\n*DO NOT ADVERTISE !\n\n\n*DO NOT SPAM THE CHAT !\n\n\n*DO NO SPAM VEHICLES ! \n\n\n*DO NOT BE ANNOYING !\n\n\n*BE NICE, RESPECT OTHERS !\n\n\n*DO NOT USE HACKS, CHEATS OR HANDLING CFG !\n\n\n***************************************************************\n\nAbove all, Have fun ! \n\n",false,GUIEditor_Label[1]) guiMemoSetReadOnly(GUIFgRulesMemo,true) guiEditor_Image[1] = guiCreateStaticImage(19,953,91,56,"images/shruk.png",false,GUIFgWelcomeWindow) guiFgCheckBox = guiCreateCheckBox(398,940,343,72,"",false,false,GUIFgWelcomeWindow) guiCheckBoxSetSelected(GUIFgCheckBox,true) guiEditor_Memo[1] = guiCreateMemo(15,3,148,37,"I accept these Rules ! ",false,GUIFgCheckBox) addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) end, false) end ) P.S: Use the LUA tags next time. Link to comment
CapY Posted July 11, 2011 Author Share Posted July 11, 2011 (edited) It's runned in Client side ? Edited July 12, 2011 by Guest Link to comment
Castillo Posted July 11, 2011 Share Posted July 11, 2011 Do you know what debugscript is? well, if you don't then go in-game and type /debugscript 3 and see if there's any error. Link to comment
CapY Posted July 12, 2011 Author Share Posted July 12, 2011 It represents (nil value) here -.- IDK how to fix it. On guiEditor_Label[1] guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,GUIFgWelcomeWindow) guiSetAlpha(GUIEditor_Label[1],1) guiLabelSetColor(GUIEditor_Label[1],0, 155 ,155) guiSetFont(GUIEditor_Label[1],"clear-normal") Link to comment
Aibo Posted July 12, 2011 Share Posted July 12, 2011 guiEditor_Label is not GUIEditor_Label. names are case-sensitive in Lua. Link to comment
CapY Posted July 12, 2011 Author Share Posted July 12, 2011 And when i click fgGuiOkbutton Window disappears, but cursor is still ON. Link to comment
JR10 Posted July 12, 2011 Share Posted July 12, 2011 That's because you didn't use showCursor(false) here: addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) showCursor(false) end, false) Link to comment
Castillo Posted July 12, 2011 Share Posted July 12, 2011 That's because you didn't use showCursor(false)here: addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) showCursor(false) end, false) Such a lazy guy isn't he? He could have found out how to toggle cursor off if he used the wiki. Link to comment
CapY Posted July 12, 2011 Author Share Posted July 12, 2011 I was,but it didn't worked, but now works ... Link to comment
CapY Posted July 13, 2011 Author Share Posted July 13, 2011 And one more question . I have resoulution 1280x1024 and i see that GUI window normal. My friend have resoulution 1024x768 and when he was joined the gui window has INCREASED to him, so he was unable to press OK button. Is there any adjust screen resoultion for gui ? Link to comment
JR10 Posted July 13, 2011 Share Posted July 13, 2011 With some mathes you can fit the gui in the middle for all resolutions here : This is your window creation: guiFgWelcomeWindow = guiCreateWindow(77,262,1279,1023," R U L E S ! ",false) This is how to fit it in the middle for all resolutions: local screenWidth, screenHeight = guiGetScreenSize() local x, y = screenWidth/2 - 1279/2, screenHeight/2 - 1023/2 guiFgWelcomeWindow = guiCreateWindow(x,y,1279,1023," R U L E S ! ",false) Link to comment
CapY Posted July 13, 2011 Author Share Posted July 13, 2011 It doesn't works . Are you tested it by yourself ? Link to comment
JR10 Posted July 13, 2011 Share Posted July 13, 2011 What happens exactly, because yes i use this in all my gui's and it works. Link to comment
CapY Posted July 13, 2011 Author Share Posted July 13, 2011 It's the same increased value on 1024x768 Link to comment
JR10 Posted July 13, 2011 Share Posted July 13, 2011 Show me the client script maybe you did something wrong. Link to comment
CapY Posted July 13, 2011 Author Share Posted July 13, 2011 Client : -- Created: 02/07/2011 09:45 local screenWidth, screenHeight = guiGetScreenSize() local x, y = screenWidth/2 - 1279/2, screenHeight/2 - 1023/2 addEventHandler("onClientResourceStart",resourceRoot, function() guiEditor_Memo = {} guiEditor_Label = {} guiEditor_Image = {} guiFgWelcomeWindow = guiCreateWindow(x,y,1279,1023," R U L E S ! ",false) guiSetAlpha(guiFgWelcomeWindow,1) guiWindowSetMovable(guiFgWelcomeWindow,false) guiWindowSetSizable(guiFgWelcomeWindow,false) guiFgOkButton = guiCreateButton(564,943,172,59,"O K ! ",false,guiFgWelcomeWindow) showCursor( true ) guiSetAlpha(guiFgOkButton,1) guiSetFont(guiFgOkButton,"clear-normal") guiFgImage = guiCreateStaticImage(9,21,1261,333,"Logo.png",false,guiFgWelcomeWindow) guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,guiFgWelcomeWindow) guiSetAlpha(guiEditor_Label[1],1) guiLabelSetColor(guiEditor_Label[1],0, 155 ,155) guiSetFont(guiEditor_Label[1],"clear-normal") guiEditor_Memo[1] = guiCreateMemo(2,5,1265,565," Welcome To [FG]Clan 24/7 Croatian Playground Freeroam \n\n\n\nPress F9 for any HELP or Commands. \n\n**********************************************************************************************************************************************************************************\nFreeroam Rules:\n \n\n*DO NOT ADVERTISE !\n\n*DO NOT SPAM THE CHAT !\n\n*DO NOT SPAM VEHICLES ! \n\n*DO NOT ANNOY OTHERS !\n\n*BE NICE, RESPECT OTHERS !\n\n*DO NOT USE HACKS, CHEATS OR HANDLING CFG !\n\n*DO NOT BOTHER STAFF !\n\n\n\n**********************************************************************************************************************************************************************************\n\nAtleast, you will be warned 2 times before BAN !\n\n\nAbove all, Have fun ! \n",false,guiEditor_Label[1]) guiMemoSetReadOnly(guiFgRulesMemo,false) guiEditor_Image[1] = guiCreateStaticImage(19,953,91,56,"Shruk.png",false,guiFgWelcomeWindow) addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) showCursor(false) end, false) end ) Link to comment
JR10 Posted July 13, 2011 Share Posted July 13, 2011 Are you sure, because you have 3 windows might be another one because this way works for me, and i can't find any problem. Link to comment
JR10 Posted July 13, 2011 Share Posted July 13, 2011 I mean, you are creating 3 windows, and the one that appears to you might not be the one your fitting on all resolutions. 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