Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GUIEditor = {
- tab = {},
- staticimage = {},
- tabpanel = {},
- edit = {},
- button = {},
- label = {},
- checkbox = {},
- combobox = {}
- }
- GUIEditor.tabpanel[1] = guiCreateTabPanel(349, 162, 807, 442, false)
- GUIEditor.tab[1] = guiCreateTab("Login", GUIEditor.tabpanel[1])
- GUIEditor.checkbox[1] = guiCreateCheckBox(300, 57, 146, 15, "Remember username ?", true, false, GUIEditor.tab[1])
- guiSetProperty(GUIEditor.checkbox[1], "NormalTextColour", "FFB10216")
- GUIEditor.checkbox[2] = guiCreateCheckBox(300, 178, 146, 15, "Remember password ?", true, false, GUIEditor.tab[1])
- guiSetProperty(GUIEditor.checkbox[2], "NormalTextColour", "FFB10216")
- GUIEditor.edit[1] = guiCreateEdit(27, 32, 240, 40, "", false, GUIEditor.tab[1])
- GUIEditor.edit[2] = guiCreateEdit(26, 157, 240, 43, "", false, GUIEditor.tab[1])
- guiEditSetMasked(GUIEditor.edit[2],true)
- GUIEditor.button[1] = guiCreateButton(280, 346, 192, 44, "Login", false, GUIEditor.tab[1])
- GUIEditor.button[2] = guiCreateButton(527, 166, 228, 49, "Forgot password ?", false, GUIEditor.tab[1])
- GUIEditor.button[3] = guiCreateButton(527, 34, 228, 49, "Forgot username ?", false, GUIEditor.tab[1])
- GUIEditor.button[4] = guiCreateButton(147, 268, 465, 57, " ACCOUNT RETRIEVAL", false, GUIEditor.tab[1])
- guiSetFont(GUIEditor.button[4], "clear-normal")
- GUIEditor.tab[2] = guiCreateTab("Register", GUIEditor.tabpanel[1])
- GUIEditor.edit[3] = guiCreateEdit(37, 27, 231, 38, "", false, GUIEditor.tab[2])
- GUIEditor.label[1] = guiCreateLabel(275, 41, 164, 41, "Username", false, GUIEditor.tab[2])
- guiSetFont(GUIEditor.label[1], "clear-normal")
- GUIEditor.edit[4] = guiCreateEdit(39, 94, 230, 39, "", false, GUIEditor.tab[2])
- getEditSetMasked(GUIEditor.edit[4],true)
- GUIEditor.label[2] = guiCreateLabel(278, 104, 81, 15, "Password", false, GUIEditor.tab[2])
- guiSetFont(GUIEditor.label[2], "clear-normal")
- GUIEditor.combobox[1] = guiCreateComboBox(80, 179, 123, 79, "", false, GUIEditor.tab[2])
- guiComboBoxAddItem(GUIEditor.combobox[1], "Male")
- guiComboBoxAddItem(GUIEditor.combobox[1], "Female")
- GUIEditor.label[3] = guiCreateLabel(275, 177, 99, 27, "Gender", false, GUIEditor.tab[2])
- GUIEditor.checkbox[3] = guiCreateCheckBox(52, 221, 265, 54, "I agree to follow CRP rules.", false, false, GUIEditor.tab[2])
- GUIEditor.button[5] = guiCreateButton(276, 322, 239, 49, "Register", false, GUIEditor.tab[2])
- GUIEditor.combobox[2] = guiCreateComboBox(511, 50, 215, 110, "", false, GUIEditor.tab[2])
- guiComboBoxAddItem(GUIEditor.combobox[2], "Your childhood name?")
- guiComboBoxAddItem(GUIEditor.combobox[2], "Your Mother's last name?")
- guiComboBoxAddItem(GUIEditor.combobox[2], "Your highschool?")
- guiComboBoxAddItem(GUIEditor.combobox[2], "The city you were born in ?")
- guiComboBoxAddItem(GUIEditor.combobox[2], "Your favourite color?")
- guiComboBoxAddItem(GUIEditor.combobox[2], "Your favourite sport-team?")
- GUIEditor.label[4] = guiCreateLabel(0, -23, 245, 24, "", false, GUIEditor.combobox[2])
- GUIEditor.label[5] = guiCreateLabel(510, 22, 237, 19, "Choose a secret question.", false, GUIEditor.tab[2])
- GUIEditor.label[6] = guiCreateLabel(510, 99, 237, 19, "Set your answer.", false, GUIEditor.tab[2])
- GUIEditor.edit[5] = guiCreateEdit(510, 122, 252, 35, "", false, GUIEditor.tab[2])
- GUIEditor.edit[6] = guiCreateEdit(510, 228, 252, 35, "", false, GUIEditor.tab[2])
- GUIEditor.label[7] = guiCreateLabel(510, 202, 237, 19, "Email", false, GUIEditor.tab[2])
- GUIEditor.tab[3] = guiCreateTab("Rules", GUIEditor.tabpanel[1])
- GUIEditor.tab[4] = guiCreateTab("Updates", GUIEditor.tabpanel[1])
- GUIEditor.tab[5] = guiCreateTab("Info", GUIEditor.tabpanel[1])
- addEvent("showHide",true)
- function showHide()
- if guiGetVisible(GUIEditor.tab[1]) == true then
- guiSetVisible(GUIEditor.tab[1],false)
- showCursor(false)
- elseif
- guiGetVisible(GUIEditor.tab[1]) == false then
- guiSetVisible(GUIEditor.tab[1],true)
- showCursor(true)
- end
- end
- addEventHandler("showHide", getLocalPlayer(),showHide)
- showHide()
- addEventHandler( 'onClientGUIClick', root,
- function ()
- if (source == GUIEditor.button[1]) then
- guiSetVisible ( GUIEditor.tab[1], false)
- showCursor(false)
- end
- end
- function onRegisterClick ( )
- local username = guiGetText (GUIEditor.edit[3])
- local password = guiGetText (GUIEditor.edit[4])
- if username ~= "" and password ~= "" then
- triggerServerEvent("tregister", getLocalPlayer(),username,password)
- end
- end
- addEventHandler("onClientGUIClick",GUIEditor.button[5],onRegisterClick,false)
- function onLoginClick ( )
- local username = guiGetText (GUIEditor.edit[1])
- local password = guiGetText (GUIEditor.edit[2])
- if username ~= "" and password ~= "" then
- triggerServerEvent("login",getLocalPlayer(),username,password)
- end
- end
- addEventHandler("onClientGUIClick",GUIEditor.button[5],onLoginClick,false)
- addEvent("loginn",true)
- addEventHandler("loginn",getLocalPlayer(),function()
- guiSetVisible(winRegister,false)
- showCursor(false)
- end)
- addEvent("Login-Register", true)
- addEventHandler("Login-Register", root,
- function(action, userName, passWord)
- if (action == "Login") then
- local account = getAccount(userName, passWord)
- if account then
- logIn(source, account, passWord)
- triggerClientEvent(source, "onLoginSuccess", source)
- else
- exports.UIPtexts:output ("Wrong username or password!", source, 255, 255, 0)
- end
- elseif (action == "Register") then
- local serial = getPlayerSerial(source)
- local TotalAcc = TotalAccounts(serial) or 0
- if TotalAcc < 3 then
- if not getAccount(userName) then
- local accountAdded = addAccount(userName, passWord)
- if accountAdded then
- exports.UIPtexts:output("You have successfully registered!, you can now login with your username and password.", source, 0, 255, 50)
- setAccountData(accountAdded, "reg-Serial", serial)
- else
- exports.UIPtexts:output("Error creating account, please contact the admin.", source, 255, 0, 50)
- end
- else
- exports.UIPtexts:output("Account with this name already exists!", source, 255, 0, 0)
- end
- else
- exports.UIPtexts:output("You can register up to 3 accounts only!", source, 255, 0, 0)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement