manve1 Posted January 12, 2013 Share Posted January 12, 2013 I tried making a script piece that would be shortened a little bit, but i can't figure out how to make it to work for a picture as it did work for a button; Everything is defined; -- local mark1 = guiCreateStaticImage( 0.52, 0.51, 0.035, 0.035, 'blip.png', true, map ) -- -- addEventHandler('onClientGUIClick', resourceRoot, function() if (source == mark1) then guiSetVisible( windowMap, false ) showCursor( false ) end end, false ) -- P.S. Don't write ask what Debug script 3 say's as it has no ERROR. Link to comment
Castillo Posted January 12, 2013 Share Posted January 12, 2013 -- local mark1 = guiCreateStaticImage( 0.52, 0.51, 0.035, 0.035, 'blip.png', true, map ) -- -- addEventHandler ( 'onClientGUIClick', mark1, function ( ) guiSetVisible ( windowMap, false ) showCursor ( false ) end ,false ) Try that. Link to comment
manve1 Posted January 12, 2013 Author Share Posted January 12, 2013 I know that will work, but i need it to be shortened as i am gonna use 'elseif' Link to comment
Castillo Posted January 12, 2013 Share Posted January 12, 2013 Use this then: -- local mark1 = guiCreateStaticImage( 0.52, 0.51, 0.035, 0.035, 'blip.png', true, map ) -- -- addEventHandler ( 'onClientGUIClick', guiRoot, function ( ) if ( source == mark1 ) then guiSetVisible ( windowMap, false ) showCursor ( false ) elseif ( source == mark2 ) then ... elseif ( source == mark3 ) then ... end end ) Unless you want to hide 'windowmap' when you click on several buttons, then you can do: addEventHandler ( 'onClientGUIClick', guiRoot, function ( ) if ( source == mark1 or source == mark2 or source == mark3 ) then guiSetVisible ( windowMap, false ) showCursor ( 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