Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createLoginWindow()
- -- gui elements
- outputChatBox("Welcome to My MTA:SA Server, Please log in")
- wdwLogin = guiCreateWindow(0.375, 0.375, 0.25, 0.25, "Please Log In", true)
- guiCreateLabel (0.0825, 0.25, 0.25, 0.25, "Username", true, wdwLogin)
- guiCreateLabel (0.0825, 0.5, 0.25, 0.25, "Password", true, wdwLogin)
- edtUser = guiCreateEdit(0.415, 0.2, 0.2, 0.15, "...", true, wdwLogin)
- edtPass = guiCreateEdit(0.415, 0.5, 0.2, 0.15, "....", true, wdwLogin)
- guiEditSetMaxLength(edtUser, 50)
- guiEditSetMaxLength(edtPass, 50)
- btnLogin = guiCreateButton(0.415, 0.7, 0.25, 0.2, "Log In", true, wdwLogin)
- -- gui settings
- showCursor(true)
- -- event handlers
- addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false)
- end
- addEventHandler( "onClientResourceStart", getRootElement(), createLoginWindow) -- makes the function to execute when the resource starts for the client.
- -- function that handles the login submition
- function clientSubmitLogin(button,state)
- if button == "left" and state == "up" then
- guiSetVisible(wdwLogin, false)
- showCursor(false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement