0 Üye ve 1 Ziyaretçi konuyu incelemekte.
local screenW, screenH = guiGetScreenSize()local X, Y = guiGetScreenSize()local hX, hY = (X/2)-(1920/2), (Y/2)-(1080/2)local font_0 = guiCreateFont("font.ttf")local font_1 = guiCreateFont("font.ttf",11)local isButtonOn4 = false;guiSetInputMode("no_binds_when_editing")addEventHandler("onClientResourceStart", resourceRoot,function() showCursor(true) loginwindow = guiCreateStaticImage((screenW - 489) / 2, (screenH - 253) / 2, 489, 253, "window2.png", false) guiSetAlpha(loginwindow, 0.99) guiSetVisible(loginwindow, true) logintitle = guiCreateLabel(155, 0, 293, 15, "Hilal Askeri Roleplay", false, loginwindow) guiSetFont(logintitle, font_0) logininfo = guiCreateLabel(8, 25, 453, 98, "Merhaba "..removeColorCoding(getPlayerName(getLocalPlayer())).."\nÜye olmadıysanız bilgilerinizi girip kayıt ol tuşuna basınız\neğer üyeliğiniz var ise login butonuna basarak giriş yapabilirsiniz.", false, loginwindow) guiSetFont(logininfo, font_1) loginuserlbl = guiCreateLabel(10, 118, 160, 37, "Kullanıcı adı : ", false, loginwindow) guiSetFont(loginuserlbl, font_1) loginuserpass = guiCreateLabel(10, 165, 160, 37, "Şifre : ", false, loginwindow) guiSetFont(loginuserpass, font_1) useredit = guiCreateEdit(143, 108, 174, 32, "", false, loginwindow) passedit = guiCreateEdit(143, 160, 174, 32, "", false, loginwindow) guiEditSetMaxLength ( useredit,25) guiEditSetMaxLength ( passedit,25) guiEditSetMasked ( passedit, true ) loginbutton = guiCreateStaticImage(49, 208, 126, 35, "button.png", false, loginwindow) loginlbl = guiCreateLabel(0, 0, 126, 35, "Giriş yap", false, loginbutton) guiSetFont(loginlbl, font_1) guiLabelSetHorizontalAlign(loginlbl, "center", false) guiLabelSetVerticalAlign(loginlbl, "center") registerbutton = guiCreateStaticImage(227, 208, 126, 35, "button.png", false, loginwindow) registerlbl = guiCreateLabel(0, 0, 126, 35, "Kayıt ol", false, registerbutton) guiSetFont(registerlbl, font_1) guiLabelSetHorizontalAlign(registerlbl, "center", false) guiLabelSetVerticalAlign(registerlbl, "center") rememberImage = guiCreateStaticImage(351, 160, 128, 32, "off.png", false, loginwindow) rememberlbl = guiCreateLabel(345, 140, 138, 32, "Üyeliğin hatırlansın mı?", false, loginwindow) guiSetFont(rememberlbl, font_0) addEventHandler("onClientGUIClick",loginlbl,onClickBtnLogin) addEventHandler("onClientGUIClick",registerlbl,onClickBtnRegister) local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiSetText ( useredit, tostring(username)) guiSetText ( passedit, tostring(password)) guiStaticImageLoadImage(rememberImage, "on.png") isButtonOn4 = true else guiSetText ( useredit, tostring(username)) guiSetText ( passedit, tostring(password)) guiStaticImageLoadImage(rememberImage, "off.png") isButtonOn4 = false endend)function click4() if (source == rememberImage and isButtonOn4 == false) then guiStaticImageLoadImage(rememberImage, "on.png") isButtonOn4 = true elseif (source == rememberImage and isButtonOn4 == true) then guiStaticImageLoadImage(rememberImage, "off.png") isButtonOn4 = false end endaddEventHandler("onClientGUIClick",root,click4)function loadLoginFromXML() local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File )end function saveLoginToXML(username, password) local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File)endaddEvent("saveLoginToXML", true)addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML)function resetSaveXML() local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File)endaddEvent("resetSaveXML", true)addEventHandler("resetSaveXML", getRootElement(), resetSaveXML)function onClickBtnLogin(button,state) if(button == "left" and state == "up") then if (source == loginlbl) then username = guiGetText(useredit) password = guiGetText(passedit) if isButtonOn4 == true then isButtonOn4 = true else isButtonOn4 = false end triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,isButtonOn4) end endendfunction onClickBtnRegister(button,state) showCursor(true) username = guiGetText(useredit) password = guiGetText(passedit) triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password) endfunction hideLoginWindow() showCursor(false) showChat(true) guiSetVisible(loginwindow,false) removeEventHandler("onClientGUIClick",loginlbl,onClickBtnLogin)endaddEvent("hideLoginWindow", true)addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow)function hover() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "buttonhover.png") elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "buttonhover.png") endendaddEventHandler("onClientMouseEnter", getRootElement(), hover)function leave() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "button.png") elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "button.png") endendaddEventHandler("onClientMouseLeave", getRootElement(), leave)function click() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "buttonclicked.png") setTimer(function() guiStaticImageLoadImage(loginbutton, "button.png") end, 50, 1) elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "buttonclicked.png") setTimer(function() guiStaticImageLoadImage(registerbutton, "button.png") end, 50, 1) endendaddEventHandler("onClientGUIClick", getRootElement(), click)function removeColorCoding (name) return type(name)=="string" and string.gsub(name, "#%x%x%x%x%x%x", "") or nameendlocal sX, sY = guiGetScreenSize()local lobbyUI = { bg = {}, arenas = { width = 300, count = 0, margin = 25, rows = 2, infoLabel = 0.14, defaultOpacity = 200 }, state = true}setSkyGradient(60, 100, 196, 136, 170, 212)showPlayerHudComponent("all", false)showPlayerHudComponent("crosshair", true)setCloudsEnabled(false)setBlurLevel(0)setTime(12, 0)setMinuteDuration(3600000)setPedCanBeKnockedOffBike(localPlayer, false)lobbyUI.bg.horizontalOffset = 0lobbyUI.bg.verticalOffset = 0lobbyUI.bg.alpha = 0lobbyUI.bg.multiplier = 1function drawLobbyBackground() if lobbyUI.bg.alpha < 175 then lobbyUI.bg.multiplier = 1.1 lobbyUI.bg.alpha = math.min(lobbyUI.bg.alpha + 2 * lobbyUI.bg.multiplier, 175) if lobbyUI.bg.alpha == 175 then end end dxDrawRectangle(0, 0, sX, sY,tocolor(0, 0, 0, lobbyUI.bg.alpha),false)endaddEventHandler("onClientRender",root, drawLobbyBackground)addEvent("dxDrawClose", true)addEventHandler("dxDrawClose", getRootElement(),function() removeEventHandler("onClientRender",root, drawLobbyBackground)end)
addEventHandler("onPlayerLogin",root,function() setPlayerHudComponentVisible(source,"radar",true)end)
Kod: luaaddEventHandler("onPlayerLogin",root,function() setPlayerHudComponentVisible(source,"radar",true)end)
Calısmıyor
-- Do not remove the green text!-- ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><-- Script by: John_Scott-- Skype: gernas12 -- ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><-- Do not remove the green text!function PlayerLogin(username,password,isButtonOn4) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn(source, account, password) triggerClientEvent (source,"hideLoginWindow",getRootElement()) triggerClientEvent (source,"dxDrawClose",source) triggerClientEvent(source,"addNotification",getRootElement(),"Başarıyla giriş yaptın!", 1) if isButtonOn4 == true then triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) else triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) end else triggerClientEvent(source,"addNotification",getRootElement(),"Hata! Kullanıcı adı veya şifre yanlış!", 3) end else triggerClientEvent(source,"addNotification",getRootElement(),"Lütfen şifrenizi giriniz!", 3) end else triggerClientEvent(source,"addNotification",getRootElement(),"Lütfen Kullanıcı adınızı giriniz!", 3) endendaddEvent("onRequestLogin",true)addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)function registerPlayer(username,password) if not (username == "") then if not (password == "") then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then outputChatBox("#ffffffKayıtınız başarılı oldu! bilgileriniz [Kullanıcı adı: #ABCDEF" .. username .. " #FF0000| #FFFFFFŞifre: #ABCDEF" .. password .. "#FFFFFF]",source,255,255,255,true ) triggerClientEvent(source,"addNotification",getRootElement(),"Başarıyla kayıt oldun!", 1) else triggerClientEvent(source,"addNotification",getRootElement(),"Hata! Lütfen başka bir kullanıcı adı veya şifre giriniz!", 3) end else triggerClientEvent(source,"addNotification",getRootElement(),"Hata! Bu kullanıcı adı zaten mevcut!", 3) end else triggerClientEvent(source,"addNotification",getRootElement(),"Hata! Lütfen şifrenizi giriniz!", 2) end else triggerClientEvent(source,"addNotification",getRootElement(),"Hata! Lütfen kullanıcı adınızı giriniz!", 2) endendaddEvent("onRequestRegister", true)addEventHandler("onRequestRegister", getRootElement(), registerPlayer)
local screenW, screenH = guiGetScreenSize() local X, Y = guiGetScreenSize()local hX, hY = (X/2)-(1920/2), (Y/2)-(1080/2) local font_0 = guiCreateFont("font.ttf")local font_1 = guiCreateFont("font.ttf",11) local isButtonOn4 = false; guiSetInputMode("no_binds_when_editing") addEventHandler("onClientResourceStart", resourceRoot,function() showCursor(true) loginwindow = guiCreateStaticImage((screenW - 489) / 2, (screenH - 253) / 2, 489, 253, "window2.png", false) guiSetAlpha(loginwindow, 0.99) guiSetVisible(loginwindow, true) logintitle = guiCreateLabel(155, 0, 293, 15, "Hilal Askeri Roleplay", false, loginwindow) guiSetFont(logintitle, font_0) logininfo = guiCreateLabel(8, 25, 453, 98, "Merhaba "..removeColorCoding(getPlayerName(getLocalPlayer())).."\nÜye olmadıysanız bilgilerinizi girip kayıt ol tuşuna basınız\neğer üyeliğiniz var ise login butonuna basarak giriş yapabilirsiniz.", false, loginwindow) guiSetFont(logininfo, font_1) loginuserlbl = guiCreateLabel(10, 118, 160, 37, "Kullanıcı adı : ", false, loginwindow) guiSetFont(loginuserlbl, font_1) loginuserpass = guiCreateLabel(10, 165, 160, 37, "Şifre : ", false, loginwindow) guiSetFont(loginuserpass, font_1) useredit = guiCreateEdit(143, 108, 174, 32, "", false, loginwindow) passedit = guiCreateEdit(143, 160, 174, 32, "", false, loginwindow) guiEditSetMaxLength ( useredit,25) guiEditSetMaxLength ( passedit,25) guiEditSetMasked ( passedit, true ) loginbutton = guiCreateStaticImage(49, 208, 126, 35, "button.png", false, loginwindow) loginlbl = guiCreateLabel(0, 0, 126, 35, "Giriş yap", false, loginbutton) guiSetFont(loginlbl, font_1) guiLabelSetHorizontalAlign(loginlbl, "center", false) guiLabelSetVerticalAlign(loginlbl, "center") registerbutton = guiCreateStaticImage(227, 208, 126, 35, "button.png", false, loginwindow) registerlbl = guiCreateLabel(0, 0, 126, 35, "Kayıt ol", false, registerbutton) guiSetFont(registerlbl, font_1) guiLabelSetHorizontalAlign(registerlbl, "center", false) guiLabelSetVerticalAlign(registerlbl, "center") rememberImage = guiCreateStaticImage(351, 160, 128, 32, "off.png", false, loginwindow) rememberlbl = guiCreateLabel(345, 140, 138, 32, "Üyeliğin hatırlansın mı?", false, loginwindow) guiSetFont(rememberlbl, font_0) addEventHandler("onClientGUIClick",loginlbl,onClickBtnLogin) addEventHandler("onClientGUIClick",registerlbl,onClickBtnRegister) local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiSetText ( useredit, tostring(username)) guiSetText ( passedit, tostring(password)) guiStaticImageLoadImage(rememberImage, "on.png") isButtonOn4 = true else guiSetText ( useredit, tostring(username)) guiSetText ( passedit, tostring(password)) guiStaticImageLoadImage(rememberImage, "off.png") isButtonOn4 = false endend) function click4() if (source == rememberImage and isButtonOn4 == false) then guiStaticImageLoadImage(rememberImage, "on.png") isButtonOn4 = true elseif (source == rememberImage and isButtonOn4 == true) then guiStaticImageLoadImage(rememberImage, "off.png") isButtonOn4 = false end endaddEventHandler("onClientGUIClick",root,click4) function loadLoginFromXML() local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File )end function saveLoginToXML(username, password) local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File)endaddEvent("saveLoginToXML", true)addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File)endaddEvent("resetSaveXML", true)addEventHandler("resetSaveXML", getRootElement(), resetSaveXML) function onClickBtnLogin(button,state) if(button == "left" and state == "up") then if (source == loginlbl) then username = guiGetText(useredit) password = guiGetText(passedit) if isButtonOn4 == true then isButtonOn4 = true else isButtonOn4 = false end triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,isButtonOn4) end endend function onClickBtnRegister(button,state) showCursor(true) username = guiGetText(useredit) password = guiGetText(passedit) triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password) end function hideLoginWindow() showCursor(false) showChat(true) guiSetVisible(loginwindow,false) removeEventHandler("onClientGUIClick",loginlbl,onClickBtnLogin) showPlayerHudComponent("all", true)endaddEvent("hideLoginWindow", true)addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) function hover() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "buttonhover.png") elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "buttonhover.png") endendaddEventHandler("onClientMouseEnter", getRootElement(), hover) function leave() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "button.png") elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "button.png") endendaddEventHandler("onClientMouseLeave", getRootElement(), leave) function click() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "buttonclicked.png") setTimer(function() guiStaticImageLoadImage(loginbutton, "button.png") end, 50, 1) elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "buttonclicked.png") setTimer(function() guiStaticImageLoadImage(registerbutton, "button.png") end, 50, 1) endendaddEventHandler("onClientGUIClick", getRootElement(), click) function removeColorCoding (name) return type(name)=="string" and string.gsub(name, "#%x%x%x%x%x%x", "") or nameend local sX, sY = guiGetScreenSize() local lobbyUI = { bg = {}, arenas = { width = 300, count = 0, margin = 25, rows = 2, infoLabel = 0.14, defaultOpacity = 200 }, state = true} setSkyGradient(60, 100, 196, 136, 170, 212)showPlayerHudComponent("all", false)setCloudsEnabled(false)setBlurLevel(0)setTime(12, 0)setMinuteDuration(3600000)setPedCanBeKnockedOffBike(localPlayer, false) lobbyUI.bg.horizontalOffset = 0lobbyUI.bg.verticalOffset = 0 lobbyUI.bg.alpha = 0lobbyUI.bg.multiplier = 1 function drawLobbyBackground() if lobbyUI.bg.alpha < 175 then lobbyUI.bg.multiplier = 1.1 lobbyUI.bg.alpha = math.min(lobbyUI.bg.alpha + 2 * lobbyUI.bg.multiplier, 175) if lobbyUI.bg.alpha == 175 then end end dxDrawRectangle(0, 0, sX, sY,tocolor(0, 0, 0, lobbyUI.bg.alpha),false)endaddEventHandler("onClientRender",root, drawLobbyBackground) addEvent("dxDrawClose", true)addEventHandler("dxDrawClose", getRootElement(),function() removeEventHandler("onClientRender",root, drawLobbyBackground)end)
ClientKod: lualocal screenW, screenH = guiGetScreenSize() local X, Y = guiGetScreenSize()local hX, hY = (X/2)-(1920/2), (Y/2)-(1080/2) local font_0 = guiCreateFont("font.ttf")local font_1 = guiCreateFont("font.ttf",11) local isButtonOn4 = false; guiSetInputMode("no_binds_when_editing") addEventHandler("onClientResourceStart", resourceRoot,function() showCursor(true) loginwindow = guiCreateStaticImage((screenW - 489) / 2, (screenH - 253) / 2, 489, 253, "window2.png", false) guiSetAlpha(loginwindow, 0.99) guiSetVisible(loginwindow, true) logintitle = guiCreateLabel(155, 0, 293, 15, "Hilal Askeri Roleplay", false, loginwindow) guiSetFont(logintitle, font_0) logininfo = guiCreateLabel(8, 25, 453, 98, "Merhaba "..removeColorCoding(getPlayerName(getLocalPlayer())).."\nÜye olmadıysanız bilgilerinizi girip kayıt ol tuşuna basınız\neğer üyeliğiniz var ise login butonuna basarak giriş yapabilirsiniz.", false, loginwindow) guiSetFont(logininfo, font_1) loginuserlbl = guiCreateLabel(10, 118, 160, 37, "Kullanıcı adı : ", false, loginwindow) guiSetFont(loginuserlbl, font_1) loginuserpass = guiCreateLabel(10, 165, 160, 37, "Şifre : ", false, loginwindow) guiSetFont(loginuserpass, font_1) useredit = guiCreateEdit(143, 108, 174, 32, "", false, loginwindow) passedit = guiCreateEdit(143, 160, 174, 32, "", false, loginwindow) guiEditSetMaxLength ( useredit,25) guiEditSetMaxLength ( passedit,25) guiEditSetMasked ( passedit, true ) loginbutton = guiCreateStaticImage(49, 208, 126, 35, "button.png", false, loginwindow) loginlbl = guiCreateLabel(0, 0, 126, 35, "Giriş yap", false, loginbutton) guiSetFont(loginlbl, font_1) guiLabelSetHorizontalAlign(loginlbl, "center", false) guiLabelSetVerticalAlign(loginlbl, "center") registerbutton = guiCreateStaticImage(227, 208, 126, 35, "button.png", false, loginwindow) registerlbl = guiCreateLabel(0, 0, 126, 35, "Kayıt ol", false, registerbutton) guiSetFont(registerlbl, font_1) guiLabelSetHorizontalAlign(registerlbl, "center", false) guiLabelSetVerticalAlign(registerlbl, "center") rememberImage = guiCreateStaticImage(351, 160, 128, 32, "off.png", false, loginwindow) rememberlbl = guiCreateLabel(345, 140, 138, 32, "Üyeliğin hatırlansın mı?", false, loginwindow) guiSetFont(rememberlbl, font_0) addEventHandler("onClientGUIClick",loginlbl,onClickBtnLogin) addEventHandler("onClientGUIClick",registerlbl,onClickBtnRegister) local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiSetText ( useredit, tostring(username)) guiSetText ( passedit, tostring(password)) guiStaticImageLoadImage(rememberImage, "on.png") isButtonOn4 = true else guiSetText ( useredit, tostring(username)) guiSetText ( passedit, tostring(password)) guiStaticImageLoadImage(rememberImage, "off.png") isButtonOn4 = false endend) function click4() if (source == rememberImage and isButtonOn4 == false) then guiStaticImageLoadImage(rememberImage, "on.png") isButtonOn4 = true elseif (source == rememberImage and isButtonOn4 == true) then guiStaticImageLoadImage(rememberImage, "off.png") isButtonOn4 = false end endaddEventHandler("onClientGUIClick",root,click4) function loadLoginFromXML() local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File )end function saveLoginToXML(username, password) local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File)endaddEvent("saveLoginToXML", true)addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() local xml_save_log_File = xmlLoadFile ("userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File)endaddEvent("resetSaveXML", true)addEventHandler("resetSaveXML", getRootElement(), resetSaveXML) function onClickBtnLogin(button,state) if(button == "left" and state == "up") then if (source == loginlbl) then username = guiGetText(useredit) password = guiGetText(passedit) if isButtonOn4 == true then isButtonOn4 = true else isButtonOn4 = false end triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,isButtonOn4) end endend function onClickBtnRegister(button,state) showCursor(true) username = guiGetText(useredit) password = guiGetText(passedit) triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password) end function hideLoginWindow() showCursor(false) showChat(true) guiSetVisible(loginwindow,false) removeEventHandler("onClientGUIClick",loginlbl,onClickBtnLogin) showPlayerHudComponent("all", true)endaddEvent("hideLoginWindow", true)addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) function hover() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "buttonhover.png") elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "buttonhover.png") endendaddEventHandler("onClientMouseEnter", getRootElement(), hover) function leave() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "button.png") elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "button.png") endendaddEventHandler("onClientMouseLeave", getRootElement(), leave) function click() if source == loginlbl then guiStaticImageLoadImage(loginbutton, "buttonclicked.png") setTimer(function() guiStaticImageLoadImage(loginbutton, "button.png") end, 50, 1) elseif source == registerlbl then guiStaticImageLoadImage(registerbutton, "buttonclicked.png") setTimer(function() guiStaticImageLoadImage(registerbutton, "button.png") end, 50, 1) endendaddEventHandler("onClientGUIClick", getRootElement(), click) function removeColorCoding (name) return type(name)=="string" and string.gsub(name, "#%x%x%x%x%x%x", "") or nameend local sX, sY = guiGetScreenSize() local lobbyUI = { bg = {}, arenas = { width = 300, count = 0, margin = 25, rows = 2, infoLabel = 0.14, defaultOpacity = 200 }, state = true} setSkyGradient(60, 100, 196, 136, 170, 212)showPlayerHudComponent("all", false)setCloudsEnabled(false)setBlurLevel(0)setTime(12, 0)setMinuteDuration(3600000)setPedCanBeKnockedOffBike(localPlayer, false) lobbyUI.bg.horizontalOffset = 0lobbyUI.bg.verticalOffset = 0 lobbyUI.bg.alpha = 0lobbyUI.bg.multiplier = 1 function drawLobbyBackground() if lobbyUI.bg.alpha < 175 then lobbyUI.bg.multiplier = 1.1 lobbyUI.bg.alpha = math.min(lobbyUI.bg.alpha + 2 * lobbyUI.bg.multiplier, 175) if lobbyUI.bg.alpha == 175 then end end dxDrawRectangle(0, 0, sX, sY,tocolor(0, 0, 0, lobbyUI.bg.alpha),false)endaddEventHandler("onClientRender",root, drawLobbyBackground) addEvent("dxDrawClose", true)addEventHandler("dxDrawClose", getRootElement(),function() removeEventHandler("onClientRender",root, drawLobbyBackground)end)
Eyw Kilit