Jump to content

Very small help


manve1

Recommended Posts

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
-- 
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...