Jump to content

Problem with making Gui disapear


AlexWo

Recommended Posts

Hey I have a problem that my gui don't disapear when i click on the exit button

Script(client):

LSPolice = createMarker( 1554, -1675, 15.28, "cylinder", 1.5, 0, 0, 255) 
  
  
function MarkerHit ( hitPlayer, matchingDimension ) 
    outputChatBox ( getPlayerName(hitPlayer) .. ", you entered the Police-Job Marker in LS", 255, 255, 0 ) 
    local policeWindow = guiCreateWindow ( 0.25, 0.25, 0.4, 0.4, "Policejob LS", true ) 
    local policePanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, policeWindow )       -- create a tab panel which fills the whole window 
    local policeMap = guiCreateTab( "Job Information", policePanel )   
    guiCreateLabel(0.02, 0.04, 0.94, 0.2, "Welcome to the Police Department in Los Santos", true, policeMap) 
    guiCreateLabel(0.02, 0.08, 0.94, 0.92, "Press 'Accept' to accept the Job and get your Equipment", true, policeMap) 
    guiCreateLabel(0.02, 0.12, 0.94, 0.92, "Press 'Exit' to close this gui and exit", true, policeMap) 
    exitbutton = guiCreateButton( 0.5, 0.5, 0.1, 0.05, "Exit", true, policeMap ) 
    acceptbutton = guiCreateButton( 0.3, 0.5, 0.1, 0.05, "Accept", true, policeMap ) 
    showCursor ( true )   
end 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
  
function wclose(state) 
 if state == "left" then 
  if source == exitbutton then 
   guiSetVisible(policeWindow, false) 
   showCursor(false) 
  end 
 end 
end 
addEventHandler("onClientGUIClick", getRootElement(), wclose) 
  
  

Would be pretty cool if somebody could help me :)

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