Jump to content

[HELP] DayZ Login/Register script problem.


^_^ LOL ^_^

Recommended Posts

--------------------------------------------------| 
--------(C)2010 Copyright by  Galaxy_Liam---------| 
--------------------------------------------------| 
--------------------------------------------------| 
--------(C)2010 Copyright by   Soner_lag----------| 
--------------------------------------------------| 
  
  
GUIEditor = { 
    tab = {}, 
    button = {}, 
    edit = {}, 
    window = {}, 
    label = {}, 
    tabpanel = {}, 
} 
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
GUIEditor.window[1] = guiCreateWindow(486, 246, 286, 256, "", false) 
centerWindow(GUIEditor.window[1]) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.tabpanel[2] = guiCreateTabPanel(9, 19, 268, 228, false, GUIEditor.window[1]) 
  
GUIEditor.tab[2] = guiCreateTab("Login", GUIEditor.tabpanel[2]) 
  
GUIEditor.label[1] = guiCreateLabel(9, 25, 85, 27, "Username", false, GUIEditor.tab[2]) 
guiSetFont(GUIEditor.label[1], "default-bold-small") 
guiLabelSetColor(GUIEditor.label[1], 254, 0, 1) 
GUIEditor.edit[1] = guiCreateEdit(69, 18, 188, 30, "", false, GUIEditor.tab[2]) 
GUIEditor.label[2] = guiCreateLabel(10, 71, 100, 39, "Password", false, GUIEditor.tab[2]) 
guiSetFont(GUIEditor.label[2], "default-bold-small") 
guiLabelSetColor(GUIEditor.label[2], 254, 0, 1) 
GUIEditor.edit[2] = guiCreateEdit(69, 61, 189, 30, "", false, GUIEditor.tab[2]) 
guiEditSetMasked(GUIEditor.edit[2], true) 
GUIEditor.button[1] = guiCreateButton(54, 115, 157, 56, "Login", false, GUIEditor.tab[2]) 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF16AE12") 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF16AE12") 
  
GUIEditor.tab[3] = guiCreateTab("Register", GUIEditor.tabpanel[2]) 
  
GUIEditor.label[3] = guiCreateLabel(9, 25, 85, 27, "Username", false, GUIEditor.tab[3]) 
guiSetFont(GUIEditor.label[3], "default-bold-small") 
guiLabelSetColor(GUIEditor.label[3], 254, 0, 1) 
GUIEditor.label[4] = guiCreateLabel(10, 71, 100, 39, "Password", false, GUIEditor.tab[3]) 
guiSetFont(GUIEditor.label[4], "default-bold-small") 
guiLabelSetColor(GUIEditor.label[4], 254, 0, 1) 
GUIEditor.edit[4] = guiCreateEdit(69, 18, 188, 30, "", false, GUIEditor.tab[3]) 
GUIEditor.edit[5] = guiCreateEdit(69, 61, 189, 30, "", false, GUIEditor.tab[3]) 
guiEditSetMasked(GUIEditor.edit[5], true) 
GUIEditor.button[3] = guiCreateButton(54, 115, 157, 56, "Register", false, GUIEditor.tab[3]) 
guiSetFont(GUIEditor.button[3], "default-bold-small") 
guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF16AE12") 
  
showCursor(true) 
  
function onGuestKlick ( ) 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
end 
addEventHandler("onClientGUIClick",GUIEditor.button[2],onGuestKlick,false) 
  
function closseLoginPanel () 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
end 
addEvent("closeLoginPanel",true) 
addEventHandler("closeLoginPanel",getRootElement(),closseLoginPanel) 
  
function onRegisterKlick () 
   local username = guiGetText(GUIEditor.edit[4]) 
   local password = guiGetText(GUIEditor.edit[5]) 
   if username ~= "" and password ~= "" then 
     triggerServerEvent("register",getLocalPlayer(),getLocalPlayer(),username,password) 
     end 
end 
addEventHandler("onClientGUIClick",GUIEditor.button[3],onRegisterKlick,false) 
  
  
  
function onLoginKlick () 
   local username = guiGetText(GUIEditor.edit[1]) 
   local password = guiGetText(GUIEditor.edit[2]) 
   if username ~= "" and password ~= "" then      
        triggerServerEvent("login",getLocalPlayer(),getLocalPlayer(),username,password) 
    end 
end 
addEventHandler("onClientGUIClick",GUIEditor.button[1],onLoginKlick,false) 

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