Jump to content

Show/Hide GUI


Recommended Posts

I was wondering if anyone could make this gui show/hide with the F4 Key? Thanks.

GUIEditor = { 
     
window = {}, 
     
memo = {} 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, 
     
function() 
         
GUIEditor.window[1] = guiCreateWindow(363, 115, 572, 447, "Donation Information", false) 
         
guiWindowSetSizable(GUIEditor.window[1], false) 
         
guiSetAlpha(GUIEditor.window[1], 0.94) 
  
         
GUIEditor.memo[1] = guiCreateMemo(10, 250, 542, 180, "VIP Platinum Membership -\n\n-Access to exclusive Spawn Classes\n-First in line for Song Requests (Front of the queue 3 times a day)\n-Access to War Machines, Heavy Weaponry and many more features\n-VIP Panel (Spawn Vehicles, Spawn Weapons, Teleport, Change Skin etc...)\n-Makes you more likely to be chosen for a Staff Position\n-Exclusive Skins and Mods\n-Private Vehicles\n-Special Teams\n\nAnd much more!\n\nThe Platinum Membership starts from £15!\n\nOne Month - £15\nThree Months - £30\nPermanent - £45\n\nContact Atlas if you want to donate or require more information..\nSkype - teambarrelgaming\nEmail - [email protected]\nPayPal Email - [email protected]", false, GUIEditor.window[1]) 
         
GUIEditor.memo[2] = guiCreateMemo(10, 36, 542, 180, "Donation Rewards -\n\nVIP Panel - £10 for 3 weeks 
\n 
\nPrivate Vehicle - £5 per week 
\n 
\nPlatinum Ingame Membership - £15 
\n 
\nExtra Small Base -  £12 (Comes with 2 vehicles) 
\n 
\nMedium Base - £16 (Comes with 3 vehicles and a health pickup) 
\n 
\nLarge Base - £20 (Comes with 6 vehicles, a health pickup and a parachute pickup) 
\n 
\nSpawn Class & Medium Base - £26 (Comes with 3 Vehicles, a spawn class, variation of weapons, health pickup, and the option to allow friends to spawn as the class.) 
\n 
\n£35 - Private Spawn Class, 6 vehicles, 1 war machine, choice of 4 weapons, unlimited ammo. 
\n 
\n£50 - Everything in the £35 Package alongside 2 extra vehicles, an extra weapon and a VIP Panel. 
\n", false, GUIEditor.window[1]) 

Link to comment
function showGUI_Handler() 
    if(guiGetVisible(GUIEditor.window[1]) == false) then 
        guiSetVisible(GUIEditor.window[1], true) 
    else 
        guiSetVisible(GUIEditor.window[1], false) 
    end 
end 
bindKey("F4", "down", showGUI_Handler) 

Link to comment

Right, it's important you understand what's going on here.

  
local function bindKeys() 
    local newVisibleStatus = not guiGetVisible(GUIEditor.window[1]) -- get the opposite of the visibility (if its showing, make it hide)  
    guiSetVisible(GUIEditor.window[1], newVisibleStatus) -- change window visibility state 
    showCursor(newVisibleStatus) -- change cursor visibility state 
end 
  
-- add a bind 
bindKey("F4', "down", bindKeys) 
  
 

This section is not for us to make your code. Any competent scripter will refuse to provide you code outright (sorry abxf bro :/) and it is essential you understand the code we provide you. We provide you code so that you can learn from it, not so we can make your server. Please learn from what we've taught you and apply the code we provide in other areas. The wiki is there and the search feature works perfectly well in the forum as well. Do not expect us (competent scripters) to provide you code at free will without your desire to understand it and learn from it.

Link to comment
Right, it's important you understand what's going on here.
  
local function bindKeys() 
    local newVisibleStatus = not guiGetVisible(GUIEditor.window[1]) -- get the opposite of the visibility (if its showing, make it hide)  
    guiSetVisible(GUIEditor.window[1], newVisibleStatus) -- change window visibility state 
    showCursor(newVisibleStatus) -- change cursor visibility state 
end 
  
-- add a bind 
bindKey("F4', "down", bindKeys) 
  
  
 

This section is not for us to make your code. Any competent scripter will refuse to provide you code outright (sorry abxf bro :/) and it is essential you understand the code we provide you. We provide you code so that you can learn from it, not so we can make your server. Please learn from what we've taught you and apply the code we provide in other areas. The wiki is there and the search feature works perfectly well in the forum as well. Do not expect us (competent scripters) to provide you code at free will without your desire to understand it and learn from it.

I asked for a small amount of help with showing and hiding a GUI, are you serious? I'm not exactly asking for you to create the next GTA, I was pretty much seeking help on something that takes 15 seconds to type up. If people around the forum want to actually be useful and helpful, then let them be. I don't see why you'd try to bring out any negativity towards the people here that ACTUALLY enjoy helping people. It just shows that you care more about the money (people paying for scripts) than assisting other people for free.

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