Wiseguy Posted October 1, 2018 Share Posted October 1, 2018 Hi, I have a problem with my login panel, it does not display correctly. I would like to get help from you. There are no errors in the console. Client: local screenW, screenH = guiGetScreenSize() windowStart = guiCreateWindow((screenW - 419) / 2, (screenH - 198) / 2, 419, 198, "Panel login v0.1", false) guiWindowSetSizable(windowStart, false) guiSetAlpha(windowStart, 0.57) buttonRegister = guiCreateButton(10, 173, 184, 15, "Zarejestruj", false, windowStart) guiSetProperty(buttonRegister, "NormalTextColour", "FFFEFEFE") buttonLogin = guiCreateButton(227, 173, 182, 15, "Zaloguj", false, windowStart) guiSetProperty(buttonLogin, "NormalTextColour", "FFFFFFFF") editDown = guiCreateEdit(66, 104, 284, 24, "", false, windowStart) editUp = guiCreateEdit(66, 61, 284, 24, "", false, windowStart) addEvent("showHide", true) function showHide() if guiGetVisible(windowStart) == true then guiSetVisible(windowStart, false) showCursor(false) elseif guiGetVisible(windowStart) == false then guiSetVisible(windowStart, true) showCursor(true) end end addEventHandler("showHide", getLocalPlayer(), showHide) showHide() function buttonClick() if source == buttonRegister then local username = guiGetText(editUp) local password = guiGetText(editDown) triggerServerEvent("registerRequest", getLocalPlayer(), getLocalPlayer(), username, password) elseif source == buttonLogin then end end addEventHandler("onClientGUIClick", windowStart, buttonClick) Server: addEvent("registerRequest", true) function registerRequest(player, username, password) local account = getAccount(username) if account == false then local ip = getPlayerIP(player) local serial = getPlayerSerial(player) exports.mysql:_Exec("insert into users (username, password, ip, serial) values (?,?,?,?)", username, password, ip, serial) local addAccounts = addAccount(tostring(username), tostring(password)) if addAccounts then outputDebugString("Użytkownik zarejestrował się z loginem".. username) else outputDebugString("ERROR: Nie udało się zarejestrować") end end end addEventHandler("registerRequest", getRootElement(), registerRequest) Link to comment
LyricalMM Posted October 1, 2018 Share Posted October 1, 2018 What do you mean by not displaying correctly? be more specific, or give a SS Link to comment
Wiseguy Posted October 1, 2018 Author Share Posted October 1, 2018 I have worded it wrong, nothing is displayed Link to comment
Dimos7 Posted October 1, 2018 Share Posted October 1, 2018 Well you need trigger then client even showHide and that it Link to comment
Wiseguy Posted October 1, 2018 Author Share Posted October 1, 2018 Could you describe this more detailed? Link to comment
Dimos7 Posted October 1, 2018 Share Posted October 1, 2018 The even ahowahide never triggers you need to triggers that costum event for panel show up and triggers it again for hide that all Link to comment
LyricalMM Posted October 2, 2018 Share Posted October 2, 2018 do you have the register panel and the login panel on the same panel? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now