ImTitanium Posted June 29, 2014 Share Posted June 29, 2014 This is supposed to open an image when you press F10, but it's not showing anything and I get no error messages on the debug script, can someone check and see what's wrong on this? function mymap () local myWindow = guiCreateWindow ( 20, 200, 100, 100, "Mapa", true ) local mapa = guiCreateStaticImage( 20, 200, 100, 100, "radar.png", false, myWindow ) if ( guiGetVisible ( myWindow ) == true ) then guiSetVisible ( myWindow, false ) else guiSetVisible ( myWindow, true ) end end addCommandHandler( "abrirmapa", mymap ) bindKey( "F10", "down", mymap ) Link to comment
xXMADEXx Posted June 29, 2014 Share Posted June 29, 2014 That's because you're hiding the GUI when it is created function mymap () local myWindow = guiCreateWindow ( 20, 200, 100, 100, "Mapa", true ) local mapa = guiCreateStaticImage( 20, 200, 100, 100, "radar.png", false, myWindow ) end addCommandHandler( "abrirmapa", mymap ) bindKey( "F10", "down", mymap ) Link to comment
manve1 Posted June 29, 2014 Share Posted June 29, 2014 This will create a new image and a gui every time, i would recommend creating it, then making a function to make it visible/invisible. Link to comment
justn Posted June 29, 2014 Share Posted June 29, 2014 myWindow = guiCreateWindow ( 20, 200, 100, 100, "Mapa", true ) guiSetVisible(myWindow,false) guiCreateStaticImage( 20, 200, 100, 100, "radar.png", false, myWindow ) function mymap () guiSetVisible(myWindow,not guiGetVisible ( myWindow )) showCursor(not isCursorShowing()) end addCommandHandler( "abrirmapa", mymap ) bindKey( "F10", "down", mymap ) Link to comment
ImTitanium Posted June 29, 2014 Author Share Posted June 29, 2014 Sadly, none worked for me, I managed to build it this way: myWindow = guiCreateWindow( 128, 0, 534, 600, "noneedtoknow", false ) guiWindowSetSizable( myWindow, false ) guiWindowSetMovable( myWindow, false ) guiSetVisible ( myWindow, false ) myImage = guiCreateStaticImage(9, 19, 515, 571, "radar.png", false, myWindow ) function abriromapa () if ( guiGetVisible ( myWindow ) == false ) then guiSetVisible ( myWindow, true ) else guiSetVisible ( myWindow, false ) end end addCommandHandler( "noneedtoknoweither", abriromapa ) bindKey( "F10", "down", abriromapa ) Link to comment
_DrXenon Posted June 29, 2014 Share Posted June 29, 2014 Thats what did they say. _. ( MANVE did) Link to comment
ImTitanium Posted June 29, 2014 Author Share Posted June 29, 2014 They were not working, some did not display the image and some created the image on top of each other everytime I pressed the button Link to comment
manve1 Posted June 29, 2014 Share Posted June 29, 2014 This will create a new image and a gui every time, i would recommend creating it, then making a function to make it visible/invisible. exactly as i said that it will happen, and i told you how to do it ... 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