Jump to content

gui not closing


oldnag

Recommended Posts

ok hereis the code and when i click the close button nothing happens

-- show the interface 
function showMiningUI   (   ) 
        miningUI = guiCreateWindow(773, 426, 399, 205, "Mining", false) 
        guiWindowSetSizable(miningUI, false) 
        guiSetVisible (miningUI,false) 
        guiSetAlpha(miningUI, 1.00) 
        guiSetProperty(miningUI, "CaptionColour", "FF2FFF00") 
  
        bStartMining = guiCreateButton(11, 121, 376, 66, "Start Mining", false, miningUI) 
        bCancelMining = guiCreateButton(359, 26, 18, 15, "x", false, miningUI) 
  
        guiSetProperty(bStartMining, "NormalTextColour", "FF2FFF00") 
        guiSetProperty(bMiningCancel, "NormalTextColour", "FFFD0102") 
  
  
        helpText = guiCreateLabel(10, 31, 362, 112, "To start mining just click the button below and wait until your \ncharacter stops gathering to do it again. To abort current task \njust click on the \"x\" at the top right of the UI", false, miningUI)   
  
        addEventHandler("onClientGUIClick", bStartmining, startMining) 
        addEventHandler("onClientGUIClick", bcancelMining, cancelMining) 
    end 
  
showMiningUI (      ) 
  
addEvent('showMiningUI',true) 
addEventHandler ( 'showMiningUI',root, 
    function (      )    
        guiSetVisible (miningUI,true) 
    end 
) 
-- close button 
function cancelMining(button, state) 
    if (source==bCancelMining) and (button=="left") and (state=="up") then 
        guiSetInputEnabled(false) 
        destroyElement(miningUI) 
        miningUI, bCancelMining, bStartMining = nil, nil, nil 
        removeEventHandler("onClientGUIClick", getRootElement(), cancelMining) 
    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...