|H|TiTanium Posted August 11, 2013 Share Posted August 11, 2013 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 ) if ( guiGetVisible ( myWindow ) == true ) then guiSetVisible ( myWindow, false ) else guiSetVisible ( myWindow, true ) showCursor( true ) end end addEventHandler( "onClientMarkerHit", getRootElement(), showGUI ) function closeGUI ( ) guiSetVisible ( myWindow, false ) showCursor( false ) end addEventHandler("onClientGUIClick", myButton2, closeGUI, false) Link to comment
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 Use guiSetVisible(myWindow, false) after the window is created with guiCreateWindow. Link to comment
|H|TiTanium Posted August 11, 2013 Author Share Posted August 11, 2013 Works fine now, I forgot to use it. Thank you for remembering me about it Link to comment
tosfera Posted August 11, 2013 Share Posted August 11, 2013 I can also see a little bug in your script, always use this while you're making a marker; if ( hitElement == getLocalPlayer() and source == ) then Else it will trigger for all the players and not only the client (hitElement) Link to comment
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 The window will not be shown to all players because it's clientside. But the window will be shown whenever he hits an marker. Link to comment
xXMADEXx Posted August 11, 2013 Share Posted August 11, 2013 The window will not be shown to all players because it's clientside. Incorrect... For some reason you do have to do a check on the hitelement otherwise it will show for all players.. Not really sure why, but it does. Link to comment
tosfera Posted August 11, 2013 Share Posted August 11, 2013 The window will not be shown to all players because it's clientside. Incorrect... For some reason you do have to do a check on the hitelement otherwise it will show for all players.. Not really sure why, but it does. ^ that is still a black box for me too. Client side is only for the player thats doing something, like single player. But somehow the entire server will get the GUI... Link to comment
|H|TiTanium Posted August 11, 2013 Author Share Posted August 11, 2013 Done. Something strange happened to me, yesterday GUI was working fine, today I could just see the Cursor, so I did what you have said to and works fine now. function showGUI( hitElement, matchingDimension ) if ( hitElement == getLocalPlayer() and source == myMarker ) then guiSetVisible ( myWindow, true ) showCursor( true ) else end end addEventHandler( "onClientMarkerHit", getRootElement(), showGUI ) function closeGUI ( ) guiSetVisible ( myWindow, false ) showCursor( false ) end addEventHandler("onClientGUIClick", myButton2, closeGUI, false) 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