Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CreateLoginWindow()
- local X = 0.375
- local Y = 0.375
- local Width = 0.25
- local Height = 0.25
- wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true)
- X = 0.0825
- Y = 0.2
- Width = 0.25
- Height = 0.25
- guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin)
- Y = 0.5
- guiCreateLabel(X, Y, Width, Height, "Password", 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)
- guiEditSetMaxLength(edtUser, 50)
- guiEditSetMaxLength(edtPass, 50)
- X = 0.415
- Y = 0.7
- Width = 0.25
- Height = 0.2
- btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin)
- guiSetVisible(wdwLogin, false)
- end
- function CreateRegisterWindow()
- local X = 0.375
- local Y = 0.375
- local Width = 0.25
- local Height = 0.25
- wdwRegister = guiCreateWindow(X, Y, Width, Height, "Please Register", true)
- X = 0.0825
- Y = 0.2
- Width = 0.25
- Height = 0.25
- guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin)
- Y = 0.5
- guiCreateLabel(X, Y, Width, Height, "Password", 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)
- guiEditSetMaxLength(edtUser, 50)
- guiEditSetMaxLength(edtPass, 50)
- X = 0.415
- Y = 0.7
- Width = 0.25
- Height = 0.2
- btnRegister = guiCreateButton(X, Y, Width, Height, "Register", true, wdwLogin)
- guiSetVisible(wdwLogin, false)
- end
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
- if(getClientAccount()then
- function ()
- CreateLoginWindow()
- outputChatBox("Welcome to Revolution Role-Play, please log in. ")
- if (wdwLogin ~= nil) then
- guiSetVisible(wdwLogin, true)
- end
- showCursor(true)
- guiSetInputEnabled(true)
- else
- function()
- CreateRegisterWindow()
- outputChatBox("Welcome to Revolution Role-Play, please register. ")
- if(wdwRegister ~= nil)then
- guiSetVisible(wdwRegister, true)
- end
- showCursor(true)
- guiSetInputEnabled(true)
- end
- )
- function clientSubmitLogin(button)
- if (button == "left")then
- triggerServerEvent("SubmitLogin", getRootElement(), guiGetText(edtUser), guiGetText(edtPass))
- guiSetInputEnabled(false)
- guiSetVisible(wdwLogin, false)
- showCursor(false)
- end
- end
- function clientSubmitRegister(button)
- if (button == "left")then
- triggerServerEvent("SubmitRegister", getRootElement(), guiGetText(edtUser), guiGetText(edtPass))
- guiSetInputEnabled(false)
- guiSetVisible(wdwLogin, false)
- showCursor(false)
- end
- end
- function createButtonNext()
- next = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Next", true )
- showCursor(true)
- end
- function createButtonPrev()
- prev = guiCreateButton( 0.4, 0.1, 0.2, 0.1, "Previous", true)
- showCursor(true)
- end
- function createButtonDone()
- done = guiCreateButton(0.55, 0.05, 0.2, 0.1, "Done", true)
- showCursor(true)
- end
- function skinSelectNext()
- skin = getPlayerSkin(getLocalPlayer())
- setPlayerSkin(getLocalPlayer(), skin + 1 or 0)
- end
- function skinSelectPrev()
- skin = getPlayerSkin(getLocalPlayer())
- setPlayerSkin(getLocalPlayer(), skin - 1 or 0)
- end
- function skinSelectDone()
- showCursor(false)
- guiSetInputEnabled(false)
- guiSetVisible(done, false)
- guiSetVisible(next, false)
- guiSetVisible(prev, false)
- if(isPlayerChoking)
- triggerServerEvent(stopChoking)
- end
- setCameraTarget(getLocalPlayer())
- end
- addEventHandler("onClientGUIClick", next, skinSelectNext)
- addEventHandler("onClientGUIClick", prev, skinSelectPrev)
- addEventHandler("onClientGUIClick", done, skinSelectDone)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement