Xakep_SDK Posted November 14, 2012 Share Posted November 14, 2012 Code: function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Пожалуйста, залогиньтесь", true) X = 0.0825 Y = 0.2 Width = 0.25 Heidht = 0.25 guiCreateLabel(X, Y, Width, Height, "Имя", true, wdwLogin) Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Пароль", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLenght(edtUser, 50) guiEditSetMaxLenght(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Логин", true, wdwLogin) guiSetVisible(wdwLogin, false) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() createLoginWindow() outputChatBox("Добро пожаловать на мой MTA:SA сервер, пожалуйста зологиньтесь") if(wdwLogin ~=nil) then guiSetVisible(wdwLogin, true) else outputChatBox("Ошибка, GUI не был создан.") end showCursor(true) guiSetInputEnabled(true) end ) function clientSubmitLogin(button,state) if button == "left" and state == "up" then local username = guiGetText(edtUser) local password = guiGetText(edtPass) if username and password then triggerServerEvent("submitLogin", getRootElement(), username, password) guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) else outputChatBox("Пожалуйста, введите логин и пароль.") end end end Link to comment
Castillo Posted November 14, 2012 Share Posted November 14, 2012 So, you expect us to guess what your problem is? tell us what is wrong with it. Link to comment
Xakep_SDK Posted November 14, 2012 Author Share Posted November 14, 2012 If i join on my server, i got login form without login button(sorry my bad english) Link to comment
Castillo Posted November 14, 2012 Share Posted November 14, 2012 That is because you put: guiEditSetMaxLenght Instead of: guiEditSetMaxLength Link to comment
Xakep_SDK Posted November 14, 2012 Author Share Posted November 14, 2012 Ooh, thx. How to connect this script witch mysql database? Link to comment
Castillo Posted November 14, 2012 Share Posted November 14, 2012 dbConnect dbExec dbQuery dbPoll dbFree These are the MySQL functions, click on each one and read the syntax. They all have examples. 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