Jump to content

[Help] show window and guiCreateCheckBox (Not solved)


Recommended Posts

I got an error and doubt. The window does not open, and I need that when the box is checked, the chatbox disappear.

Help-me :cry::(

  
   local checkbox = {} 
  local  window = {} 
   local button = {} 
   local label = {} 
  
        panel.window[1] = guiCreateWindow(31, 179, 251, 307, "15", false) 
        guiWindowSetMovable(panel.window[1], false) 
        guiWindowSetSizable(panel.window[1], false) 
        guiSetAlpha(panel.window[1], 0.78) 
  
        panel.checkbox[1] = guiCreateCheckBox(96, 70, 15, 15, "", false, false, panel.window[1]) 
        panel.label[1] = guiCreateLabel(120, 68, 78, 19, "CHATBOX", false, panel.window[1]) 
    
  
         
         
         
function showpanel(key,keyState) 
if getElementData(getLocalPlayer(),"logedin") then 
    if ( keyState == "down" ) then 
        guiSetVisible(panel.window[1],not guiGetVisible(panel.window[1])) 
        showCursor(not isCursorShowing()) 
        if guiGetVisible(panel.window[1]) == true then 
            onClientOpenpanelStopMenu () 
        else 
            hidepanel () 
        end 
    end 
end  
end 
bindKey ( "o", "down", showpanel ) 
  
function showpanelManual () 
        guiSetVisible(panel.window[1],not guiGetVisible(panel.window[1])) 
        showCursor(not isCursorShowing()) 
        refreshInventory() 
        if guiGetVisible(panel.window[1]) == true then 
            onClientOpenpanelStopMenu () 
        end 
end 
  
function hidepanelManual () 
        guiSetVisible(panel.window[1],false) 
        showCursor(false) 
        hidepanel () 
end 
addEvent("hidepanelManual",true) 
addEventHandler("hidepanelManual",getLocalPlayer(),hidepanelManual) 
         
         
function onClientOpenpanelStopMenu () 
triggerEvent("disableMenu",getLocalPlayer()) 
end 
  
  
function hidepanel () 
    guiSetVisible(rightclickWindow,false) 
end 
  
  

Link to comment
  • Moderators

Try this:

  
local checkbox = {} 
local window = {} 
local button = {} 
local label = {} 
  
window[1] = guiCreateWindow(31, 179, 251, 307, "15", false) 
guiWindowSetMovable(window[1], false) 
guiWindowSetSizable(window[1], false) 
guiSetAlpha(window[1], 0.78) 
guiSetVisible(window[1], false) 
  
checkbox[1] = guiCreateCheckBox(96, 70, 15, 15, "", false, false, window[1]) 
panel.label[1] = guiCreateLabel(120, 68, 78, 19, "CHATBOX", false, window[1]) 
  
addEventHandler( "onClientGUIClick", checkbox[1],  
    function() 
        showChat( not guiCheckBoxGetSelected(source) ) 
    end, false 
) 
  
function showpanel(key,keyState) 
if getElementData(getLocalPlayer(),"logedin") then 
    if ( keyState == "down" ) then 
        guiSetVisible(window[1],not guiGetVisible(window[1])) 
        showCursor(not isCursorShowing()) 
        if guiGetVisible(window[1]) == true then 
            onClientOpenpanelStopMenu () 
        else 
            hidepanel () 
        end 
    end 
end  
end 
bindKey ( "o", "down", showpanel ) 
  
function showpanelManual () 
        guiSetVisible(window[1],not guiGetVisible(window[1])) 
        showCursor(not isCursorShowing()) 
        refreshInventory() 
        if guiGetVisible(window[1]) == true then 
            onClientOpenpanelStopMenu () 
        end 
end 
  
function hidepanelManual () 
        guiSetVisible(window[1],false) 
        showCursor(false) 
        hidepanel () 
end 
addEvent("hidepanelManual",true) 
addEventHandler("hidepanelManual",getLocalPlayer(),hidepanelManual) 
        
        
function onClientOpenpanelStopMenu () 
triggerEvent("disableMenu",getLocalPlayer()) 
end 
  
  
function hidepanel () 
    guiSetVisible(rightclickWindow,false) 
end 
  
  

Link to comment
  • 2 weeks later...

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