Jump to content

Login GUI for my server.


Recommended Posts

Hey guys, i wish to create a Login GUI. I have already created the code with GUIEditor, but how can i make it work. If not, can someone please do it for me, i will give credit too you guys if it is made possible. I am not good with this, sorry. Also i cannot pay anyone for this, but please help me with it.

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Radio = {} 
  
GUIEditor_Window[1] = guiCreateWindow(219,223,628,358,"K@N Zombies Login GUI",false) 
GUIEditor_Label[1] = guiCreateLabel(18,21,595,31,"The username or password you have entered seems to be incorrect.",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],0,150,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(297,65,270,22,"Username:",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[2],255,255,0) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(302,105,270,22,"Password:",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[1] = guiCreateEdit(367,57,178,30,"",false,GUIEditor_Window[1]) 
GUIEditor_Edit[2] = guiCreateEdit(366,98,180,30,"",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(367,133,80,23,"Login now",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(452,133,90,23,"Register now",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
GUIEditor_Checkbox[1] = guiCreateCheckBox(314,163,180,22,"Don't start the first mission.",false,false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Checkbox[2] = guiCreateCheckBox(314,189,223,17,"I want a weapon when I spawn first. (If you ticked the above)",false,false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Checkbox[2],"default-bold-small") 
GUIEditor_Checkbox[3] = guiCreateCheckBox(315,276,304,19,"I want to spawn first outside of the spawning area.",false,false,GUIEditor_Window[1]) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],true) 
guiSetFont(GUIEditor_Checkbox[3],"default-bold-small") 
GUIEditor_Checkbox[4] = guiCreateCheckBox(315,300,273,19,"I want some zombies when first spawning.",false,false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Checkbox[4],"default-bold-small") 
GUIEditor_Radio[1] = guiCreateRadioButton(343,212,199,18,"Colt-45 with 200 ammo",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Radio[1],"default-bold-small") 
GUIEditor_Radio[2] = guiCreateRadioButton(343,233,198,18,"Uzi with 100 ammo",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Radio[2],"default-bold-small") 
GUIEditor_Radio[3] = guiCreateRadioButton(344,252,199,18,"M4 with 75 ammo",false,GUIEditor_Window[1]) 
guiRadioButtonSetSelected(GUIEditor_Radio[3],true) 
guiSetFont(GUIEditor_Radio[3],"default-bold-small") 
GUIEditor_Label[4] = guiCreateLabel(15,50,268,237,"Welcome K@N's zombie server, we have many functions which will keep you having fun. We have a goal to reach over 30 players regually, once we upgrade the server.\n \nYou are to follow the following rules.\n1. Do not hack or cheat with any program.\n2. Respect everyone on the server.\n3.Do not attempt to steal any content we have on our server.\n4. Do not give your password out to anyone\n5. Do not ask to be an admin.\n6. Do not ask an admin to set your cash.\n7. Do not abuse any bug found on the server.\n8. Do not deathmatch those who do not deathmatch.",false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(431,330,179,16,"Edited by [K@N~AS]Chris|GEN",false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(8,320,307,36,"Our forum can be found at killallnoobs.forumotion.com\nplease post all bug reports there.",false,GUIEditor_Window[1]) 
GUIEditor_Label[7] = guiCreateLabel(53,331,5,5,"",false,GUIEditor_Window[1]) 
  

Link to comment

What I do is first add the functions

then put quotes, to keep it organize,

after I just add the EventHandlers for the buttons:

  
function zombie_LG() 
GUIEditor_Window[1] = guiCreateWindow(219,223,628,358,"K@N Zombies Login GUI",false) 
  
-- Labels 
GUIEditor_Label[1] = guiCreateLabel(18,21,595,31,"The username or password you have entered seems to be incorrect.",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],0,150,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(297,65,270,22,"Username:",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[2],255,255,0) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(302,105,270,22,"Password:",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Label[4] = guiCreateLabel(15,50,268,237,"Welcome K@N's zombie server, we have many functions which will keep you having fun. We have a goal to reach over 30 players regually, once we upgrade the server.\n \nYou are to follow the following rules.\n1. Do not hack or cheat with any program.\n2. Respect everyone on the server.\n3.Do not attempt to steal any content we have on our server.\n4. Do not give your password out to anyone\n5. Do not ask to be an admin.\n6. Do not ask an admin to set your cash.\n7. Do not abuse any bug found on the server.\n8. Do not deathmatch those who do not deathmatch.",false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(431,330,179,16,"Edited by [K@N~AS]Chris|GEN",false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(8,320,307,36,"Our forum can be found at killallnoobs.forumotion.com\nplease post all bug reports there.",false,GUIEditor_Window[1]) 
GUIEditor_Label[7] = guiCreateLabel(53,331,5,5,"",false,GUIEditor_Window[1]) 
  
-- Players Username and Password 
GUIEditor_Edit[1] = guiCreateEdit(367,57,178,30,"",false,GUIEditor_Window[1]) 
GUIEditor_Edit[2] = guiCreateEdit(366,98,180,30,"",false,GUIEditor_Window[1]) 
  
-- Buttons 
GUIEditor_Button[1] = guiCreateButton(367,133,80,23,"Login now",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(452,133,90,23,"Register now",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
  
--Check boxs 
GUIEditor_Checkbox[1] = guiCreateCheckBox(314,163,180,22,"Don't start the first mission.",false,false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Checkbox[2] = guiCreateCheckBox(314,189,223,17,"I want a weapon when I spawn first. (If you ticked the above)",false,false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Checkbox[2],"default-bold-small") 
GUIEditor_Checkbox[3] = guiCreateCheckBox(315,276,304,19,"I want to spawn first outside of the spawning area.",false,false,GUIEditor_Window[1]) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],true) 
guiSetFont(GUIEditor_Checkbox[3],"default-bold-small") 
GUIEditor_Checkbox[4] = guiCreateCheckBox(315,300,273,19,"I want some zombies when first spawning.",false,false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Checkbox[4],"default-bold-small") 
  
-- Radio boxs 
GUIEditor_Radio[1] = guiCreateRadioButton(343,212,199,18,"Colt-45 with 200 ammo",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Radio[1],"default-bold-small") 
GUIEditor_Radio[2] = guiCreateRadioButton(343,233,198,18,"Uzi with 100 ammo",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Radio[2],"default-bold-small") 
GUIEditor_Radio[3] = guiCreateRadioButton(344,252,199,18,"M4 with 75 ammo",false,GUIEditor_Window[1]) 
guiRadioButtonSetSelected(GUIEditor_Radio[3],true) 
guiSetFont(GUIEditor_Radio[3],"default-bold-small") 
end 
  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
    function() 
            -- Create the login gui 
            zombie_LG() 
            -- now make sure the window is open 
            if (GUIEditor_Window[1] ~= nil) then 
                guiSetVisible(GUIEditor_Window[1], true) 
            else -- if there is something wrong, output that there is something wrong 
                outputChatBox("The Login GUI Does not work") 
            end 
        -- enable the players cursor (so they can select and click on the components) 
            showCursor(true) 
        -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening 
            guiSetInputEnabled(true) 
            
        -- now add our onClientGUIClick event to the button we just created 
            addEventHandler("onClientGUIClick", GUIEditor_Button[1], login, false) 
            addEventHandler("onClientGUIClick", GUIEditor_Button[2], rigister, false) 
    end) 
  

this only creates the gui

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