Jump to content

onMarkerHit problem


|H|TiTanium

Recommended Posts

Basically, my script is about a GUI which should open when a player enters a marker, but it doesn't work, when I enter server, the GUI automatically shows up on my screen instead of being hidden til I get to marker, here I got the code.

I just need your help to make the GUI appears when a player reaches the marker.

function showGUI( hitElement, matchingDimension ) 
    if ( guiGetVisible ( myWindow ) == true ) then 
                guiSetVisible ( myWindow, false ) 
        else               
                guiSetVisible ( myWindow, true ) 
        showCursor( true ) 
        end 
end 
addEventHandler( "onMarkerHit", myMarker, showGUI ) 
  
function closeGUI( leaveElement, matchingDimension ) 
        guiSetVisible ( myWindow, false ) 
        showCursor( false ) 
end 
addEventHandler( "onMarkerLeave", myMarker, closeGUI ) 

Link to comment

Ok, it works a bit better now, but the main problem and the last one is that when a player enters the server the GUI shows up automatically instead of keeping hidden. I don't know what is wrong. I need a help to make GUI hidden and then just show up when a player hits marker

function showGUI( hitElement, matchingDimension ) 
        guiSetVisible ( myWindow, true ) 
        showCursor( true ) 
end 
addEventHandler( "onClientMarkerHit", getRootElement(), showGUI ) 
  
function closeGUI ( ) 
        guiSetVisible ( myWindow, false ) 
        showCursor( false ) 
end 
addEventHandler("onClientGUIClick", myButton2, closeGUI, false) 

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