BriGhtx3 Posted April 20, 2011 Share Posted April 20, 2011 Hey Guys, i have a little question : Why can't I see the window in the Ingame? Is there any error in the Code? function Status() local sWidth, sHeight = guiGetScreenSize() local Width,Height = 800,45 local X = (sWidth/2) - (Width/2) local Y = sHeight - (Height/2) local StatusW = guiCreateWindow ( X, Y, Width, Height, "SoLA-Status", true ) guiWindowSetMovable ( StatusW, true ) guiWindowSetSizable ( StatusW, false ) local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, StatusW ) local tabAll = guiCreateTab( "Allgemein", tabPanel ) local tabBed = guiCreateTab( "Bedürfnisse", tabPanel ) local tabRel = guiCreateTab( "Regeln", tabPanel ) guiCreateButton(0.02, 0.04, 0.94, 0.2, "JOB", true, tabAll) guiCreateLabel(0.02, 0.04, 0.94, 0.2, "Die Bedürfnisse : ", true, tabBed) guiCreateLabel(0.02, 0.04, 0.94, 0.2, "Keine unnötigen ADs, Kein Töten (ohne Grund), kein Flaming, kein Spamming", true, tabRel) guiSetVisible(StatusW, false) end addEventHandler("onClientResourceStart",resourceRoot,Status) Help would be really nice (This is my first self-made script ) Greetz Edit : I forgot to say whether I see any errors or if the console shows any errors : Really quick : No Link to comment
Gungneer Posted April 20, 2011 Share Posted April 20, 2011 guiSetVisible(StatusW, false) Make a command handler or bind a key to toggle the visible state of the window? Link to comment
BriGhtx3 Posted April 20, 2011 Author Share Posted April 20, 2011 You mean sth. like this? guiSetVisible ( StatusW, false) end addEventHandler("onClientResourceStart",resourceRoot,Status) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () Status() end ) Link to comment
Gungneer Posted April 20, 2011 Share Posted April 20, 2011 function toggleWindowVis(key,keyState) if guiGetVisible(StatusW) then guiSetVisible ( StatusW, false) else guiSetVisible ( StatusW, true) end end bindKey ( "F1", "down", funcInput ) Something like that. Link to comment
BriGhtx3 Posted April 20, 2011 Author Share Posted April 20, 2011 (edited) Now my Script looks like this : addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),toggleWindowVis) function toggleWindowVis(key,keyState) if guiGetVisible(StatusW) then guiSetVisible ( StatusW, false) else guiSetVisible ( StatusW, true) end end bindKey ( "F1", "down", Status) It doesn't work either Edited April 20, 2011 by Guest Link to comment
Gungneer Posted April 20, 2011 Share Posted April 20, 2011 Oh, my bad, I copied some shit from the Wiki and just edited it, I never edited it properly. Line to: bindKey("F1","down",toggleWindowVis) Use that instead, sorry. Link to comment
Gungneer Posted April 20, 2011 Share Posted April 20, 2011 Although, y'know... If you want teh window there all the time, you just have to take out line 18 from your original code. Line is was: guiSetVisible(StatusW, false) You were setting it to not show by default, what I just tried to help you do was find a way to toggle it instead, but if you want it to show all the time, don't both with the toggle shit and just remove that line. Link to comment
BriGhtx3 Posted April 20, 2011 Author Share Posted April 20, 2011 Oh, my bad, I copied some :~ from the Wiki and just edited it, I never edited it properly. Line to: bindKey("F1","down",toggleWindowVis) Use that instead, sorry. doesn't work. Although, y'know... If you want teh window there all the time, you just have to take out line 18 from your original code.Line is was: guiSetVisible(StatusW, false) You were setting it to not show by default, what I just tried to help you do was find a way to toggle it instead, but if you want it to show all the time, don't both with the toggle :~ and just remove that line. Ok i tested it without guiSetVisible(StatusW,false), but i don't see it anyway. I think this is because of the Login Panel I have. The Login Panel makes a blackscreen... I tested it with some outputchat Text, and the text shows, but the window is still not visible. Link to comment
Gungneer Posted April 20, 2011 Share Posted April 20, 2011 Right, then I can safely say that this headache has got the better of my for now, 'cause I can't think of how to help you for shit, sorry. Hopefully someone else can come along and help. 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