Jump to content

GUI Issues


Atton

Recommended Posts

I have been having a few issues with my GUI where if you click on blank space. It triggers random buttons and causes confusion is I have posted the relevant code below.

Any ideas would be wonderful.

  local screenWidth, screenHeight = guiGetScreenSize() 
    local windowWidth, windowHeight = 552, 476 
    local left = screenWidth/2 - windowWidth/2 
    local top = screenHeight/2 - windowHeight/2 
    Agui = guiCreateWindow(left, top, windowWidth, windowHeight, "Fuck Around Panel v1.2", false) 
    guiWindowSetSizable(Agui, false) 
    guiSetVisible(Agui, false) 
     
function CCF (button,state) 
    if (button == "left" and state == "up") then 
        triggerServerEvent("aCore.cloakCar", localPlayer, localPlayer) 
    else 
        -- Place Holder 
    end 
end 
addEventHandler("onClientGUIClick",CCB,CCF) 
  
CCB = guiCreateButton(280, 175, 121, 61, "Cloak Car", false, Agui) 

Link to comment

  screenWidth, screenHeight = guiGetScreenSize() 
    local windowWidth, windowHeight = 552, 476 
    local left = screenWidth/2 - windowWidth/2 
    local top = screenHeight/2 - windowHeight/2 
    Agui = guiCreateWindow(left, top, windowWidth, windowHeight, ":O Around Panel v1.2", false) 
    CCB = guiCreateButton(280, 175, 121, 61, "Cloak Car", false, Agui) 
    guiWindowSetSizable(Agui, false) 
    guiSetVisible(Agui, false) 
addEventHandler(' onClientGUIClick', root, 
   function ( ) 
   if ( source == CCB ) then 
   triggerServerEvent ( 'aCore.cloak', localPlayer ); 
      end 
 end 
); 
Edited by Guest
Link to comment
    screenWidth, screenHeight = guiGetScreenSize() 
    local windowWidth, windowHeight = 552, 476 
    local left = screenWidth/2 - windowWidth/2 
    local top = screenHeight/2 - windowHeight/2 
    Agui = guiCreateWindow(left, top, windowWidth, windowHeight, ":O Around Panel v1.2", false) 
    guiWindowSetSizable(Agui, false) 
    guiSetVisible(Agui, false) 
     
addEventHandler(' onClientGUIClick', root, 
   function ( ) 
   if ( source == CCB ) then  
   triggerServerEvent ( 'aCore.cloak', localPlayer ); 
      end 
 end 
); 

It brings up errors expecting () and shit not sure about it.

Link to comment
    screenWidth, screenHeight = guiGetScreenSize() 
    local windowWidth, windowHeight = 552, 476 
    local left = screenWidth/2 - windowWidth/2 
    local top = screenHeight/2 - windowHeight/2 
    Agui = guiCreateWindow(left, top, windowWidth, windowHeight, ":O Around Panel v1.2", false) 
    guiWindowSetSizable(Agui, false) 
    guiSetVisible(Agui, false) 
     
addEventHandler(' onClientGUIClick', root, 
   function ( ) 
   if ( source == CCB ) then  
   triggerServerEvent ( 'aCore.cloak', localPlayer ); 
      end 
 end 
); 

It brings up errors expecting () and :~ not sure about it.

lol i forgot the button , post edit , copy it again .

Link to comment
    screenWidth, screenHeight = guiGetScreenSize() 
    local windowWidth, windowHeight = 552, 476 
    local left = screenWidth/2 - windowWidth/2 
    local top = screenHeight/2 - windowHeight/2 
    Agui = guiCreateWindow(left, top, windowWidth, windowHeight, ":O Around Panel v1.2", false) 
    guiWindowSetSizable(Agui, false) 
    guiSetVisible(Agui, false) 
    CCB = guiCreateButton(280, 175, 121, 61, "Cloak Car", false, Agui) 
addEventHandler(' onClientGUIClick', root, 
   function ( ) 
   if ( source == CCB ) then  
   triggerServerEvent ( 'aCore.cloak', localPlayer ); 
      end 
 end 
); 

It brings up errors expecting () and :~ not sure about it.

lol i forgot the button , post edit , copy it again .

addEventHandler(' onClientGUIClick', root, 
   function ( ) 
   if ( source == CCB ) then 
   triggerServerEvent ( 'aCore.cloak', localPlayer ); 
      end 
 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...