elmy2424 Posted October 13, 2013 Share Posted October 13, 2013 Hello guys , i made this resource; it consist on a login and skinselector panels, created separated. i want that appears the login panel first and after the player login appears the skinselector panel. as you can see inthe client i create the loginpanel and skinselector gui but i set the visibility false in the skinselector gui and is turned true when the event "CloseLoginPanel" is called from the server.lua file when the player login. the problem is that the loginpanel gui dont appears when i start the resource. i cant see whats wrong with my resource so i will be happy if you help me with this. client.lua: addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function() loginpanel = guiCreateWindow(233, 65, 561, 618, "Ventana de Inicio", false) guiWindowSetSizable(loginpanel, false) guiSetAlpha(loginpanel, 0.65) logbutton = guiCreateButton(21, 501, 200, 42, "Iniciar Sesión", false, loginpanel) guiSetFont(logbutton, "sa-header") guiSetProperty(logbutton, "NormalTextColour", "FF69D429") regbutton = guiCreateButton(21, 553, 166, 42, "Registrarse", false, loginpanel) guiSetFont(regbutton, "sa-header") guiSetProperty(regbutton, "NormalTextColour", "FF69D429") guestbutton = guiCreateButton(199, 553, 129, 42, "Anónimo", false, loginpanel) guiSetFont(guestbutton, "sa-header") reguserlabel = guiCreateLabel(31, 353, 59, 17, "USUARIO:", false, loginpanel) guiLabelSetColor(reguserlabel, 252, 0, 0) regpasslabel = guiCreateLabel(31, 427, 86, 17, "CONTRASEÑA:", false, loginpanel) guiLabelSetColor(regpasslabel, 252, 0, 0) userreglogbox = guiCreateEdit(21, 380, 188, 37, "", false, loginpanel) passreglogbox = guiCreateEdit(21, 454, 188, 37, "", false, loginpanel) memo = guiCreateMemo(21, 32, 517, 217, "", false, loginpanel) memo2 = guiCreateMemo(21, 262, 205, 81, "", false, loginpanel) guiEditSetMasked(passreglogbox, true) showCursor (true) guiSetInputEnabled(true) end ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() skinsgui = guiCreateWindow(0, 157, 1024, 458, "skins", false) guiWindowSetSizable(skinsgui, false) guiSetAlpha(skinsgui, 0.00) GUIEditor.label[1] = guiCreateLabel(326, 46, 357, 84, "Selecciona tu skin", false, skinsgui) guiSetFont(GUIEditor.label[1], "sa-gothic") GUIEditor.label[2] = guiCreateLabel(235, 140, 570, 49, "Click izquierdo sobre el skin de tu preferencia", false, skinsgui) guiSetFont(GUIEditor.label[2], "sa-header") image10 = guiCreateStaticImage(915, 209, 89, 211, ":login/iconos/skin7.png", false, skinsgui) image9 = guiCreateStaticImage(816, 209, 89, 211, ":login/iconos/skin6.png", false, skinsgui) image8 = guiCreateStaticImage(717, 209, 89, 211, ":login/iconos/skin4.png", false, skinsgui) image7 = guiCreateStaticImage(618, 209, 89, 211, ":login/iconos/skin3.png", false, skinsgui) image6 = guiCreateStaticImage(519, 209, 89, 211, ":login/iconos/skin2.png", false, skinsgui) image5 = guiCreateStaticImage(420, 209, 89, 211, ":login/iconos/skin1.png", false, skinsgui) image4 = guiCreateStaticImage(321, 209, 89, 211, ":login/iconos/skin10.png", false, skinsgui) image3 = guiCreateStaticImage(222, 209, 89, 211, ":login/iconos/skin9.png", false, skinsgui) image2 = guiCreateStaticImage(123, 209, 89, 211, ":login/iconos/skin8.png", false, skinsgui) image1 = guiCreateStaticImage(22, 209, 89, 211, ":login/iconos/skin5.png", false, skinsgui) button10 = guiCreateButton(924, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button10, 0.00) button9 = guiCreateButton(826, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button9, 0.00) button8 = guiCreateButton(727, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button8, 0.00) button7 = guiCreateButton(627, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button7, 0.00) button6 = guiCreateButton(529, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button6, 0.00) button5 = guiCreateButton(430, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button5, 0.00) button4 = guiCreateButton(330, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button4, 0.00) button3 = guiCreateButton(231, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button3, 0.00) button2 = guiCreateButton(133, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button2, 0.00) button1 = guiCreateButton(32, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button1, 0.00) guiSetVisible (skinsgui,false) end ) function skinsv guiSetVisible (skinsgui,true) showCursor (true) end addEvent("closeLoginPanel", true) addEventHandler ("closeLoginPanel", getRootElement(), skinsv) function logbuttonf () local username = guiGetText(userreglogbox) local password = guiGetText(passreglogbox) if username ~= "" and password ~= "" then triggerServerEvent("login",getLocalPlayer(),getLocalPlayer(),username,password) end end addEventHandler ("onClientGUIClick",logbutton ,logbuttonf ,false) function regbuttonf () local username = guiGetText(userreglogbox) local password = guiGetText(passreglogbox) if username ~= "" and password ~= "" then triggerServerEvent("register",getLocalPlayer(),getLocalPlayer(),username,password) end end addEventHandler ("onClientGUIClick",regbutton ,regbuttonf ,false) function guestbuttonf () outputChatBox("HAS INGRESADO COMO ANÓNIMO") guiSetVisible(loginpanel,false) showCursor(false) triggerServerEvent("guestf", localPlayer, spawnX, spawnY, spawnZ) end addEventHandler ("onClientGUIClick",guestbutton ,guestbuttonf ,false) function closeLoginPanel ( ) guiSetVisible(loginpanel,false) showCursor(false) end addEventHandler("closeLoginPanel",getRootElement(),closeLoginPanel) bindKey (localPlayer, "enter", "down", logbuttonff) function logbuttonff (localPlayer, "enter", "down") local username = guiGetText(userreglogbox) local password = guiGetText(passreglogbox) if username ~= "" and password ~= "" then triggerServerEvent("login",getLocalPlayer(),getLocalPlayer(),username,password) end end server.lua function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("USTED SE HA REGISTRADO Y LOGUEADO CORRECTAMENTE",player,0,125,0) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("SE HA PRODUCIDO UN ERROR",player,125,0,0) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("HAS INICIADO SESION CORRECTAMENTE ,"..getPlayerName(player),player,0,125,0) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("USUARIO O CONTRASEÑA INCORRECTOS, VUELVA A INTENTARLO",player,125,0,0) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) skinchanger.lua function replaceModel() txd = engineLoadTXD("skins/skin1.txd", 7 ) engineImportTXD(txd, 7) dff = engineLoadDFF("skins/skin1.dff", 7 ) engineReplaceModel(dff, 7) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin2.txd", 14 ) engineImportTXD(txd, 14) dff = engineLoadDFF("skins/skin2.dff", 14 ) engineReplaceModel(dff, 14) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin3.txd", 15 ) engineImportTXD(txd, 15) dff = engineLoadDFF("skins/skin3.dff", 15 ) engineReplaceModel(dff, 15) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin4.txd", 16 ) engineImportTXD(txd, 16) dff = engineLoadDFF("skins/skin4.dff", 16 ) engineReplaceModel(dff, 16) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin5.txd", 17 ) engineImportTXD(txd, 17) dff = engineLoadDFF("skins/skin5.dff", 17 ) engineReplaceModel(dff, 17) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin6.txd", 18 ) engineImportTXD(txd, 18) dff = engineLoadDFF("skins/skin6.dff", 18 ) engineReplaceModel(dff, 18) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin7.txd", 19 ) engineImportTXD(txd, 19) dff = engineLoadDFF("skins/skin7.dff", 19 ) engineReplaceModel(dff, 19) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin8.txd", 20 ) engineImportTXD(txd, 20) dff = engineLoadDFF("skins/skin8.dff", 20 ) engineReplaceModel(dff, 20) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin9.txd", 21 ) engineImportTXD(txd, 21) dff = engineLoadDFF("skins/skin9.dff", 21 ) engineReplaceModel(dff, 21) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) function replaceModel() txd = engineLoadTXD("skins/skin10.txd", 22 ) engineImportTXD(txd, 22) dff = engineLoadDFF("skins/skin10.dff", 22 ) engineReplaceModel(dff, 22) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) meta.xml > author="eLmY2424" version="1.0.0" type="script" name="Panel de Inicio" description="Ventana para registrarse o iniciar sesion {SMILIES_PATH}/icon_biggrin.gif\" alt=\"\" title=\"Very Happy\" />" /> client" /> server" /> client" /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> Thanks for your time Link to comment
Jaysds1 Posted October 13, 2013 Share Posted October 13, 2013 try this: Meta.xml - > author="eLmY2424" version="1.0.0" type="script" name="Panel de Inicio" description="Ventana para registrarse o iniciar sesion" /> ="client.lua" type="client" /> ="server.lua" /> ="skinchanger.lua" type="client" /> src="skins/skin1.txd" /> src="skins/skin1.dff" /> src="skins/skin2.txd" /> src="skins/skin2.dff" /> src="skins/skin3.txd" /> src="skins/skin3.dff" /> src="skins/skin4.txd" /> src="skins/skin4.dff" /> src="skins/skin5.txd" /> src="skins/skin5.dff" /> src="skins/skin6.txd" /> src="skins/skin6.dff" /> src="skins/skin7.txd" /> src="skins/skin7.dff" /> src="skins/skin8.txd" /> src="skins/skin8.dff" /> src="skins/skin9.txd" /> src="skins/skin9.dff" /> src="skins/skin10.txd" /> src="skins/skin10.dff" /> src="iconos/skin1.png" /> src="iconos/skin2.png" /> src="iconos/skin3.png" /> src="iconos/skin4.png" /> src="iconos/skin5.png" /> src="iconos/skin6.png" /> src="iconos/skin7.png" /> src="iconos/skin8.png" /> src="iconos/skin9.png" /> src="iconos/skin10.png" />> Client.lua - loginpanel = guiCreateWindow(233, 65, 561, 618, "Ventana de Inicio", false) guiWindowSetSizable(loginpanel, false) guiSetAlpha(loginpanel, 0.65) logbutton = guiCreateButton(21, 501, 200, 42, "Iniciar Sesión", false, loginpanel) guiSetFont(logbutton, "sa-header") guiSetProperty(logbutton, "NormalTextColour", "FF69D429") regbutton = guiCreateButton(21, 553, 166, 42, "Registrarse", false, loginpanel) guiSetFont(regbutton, "sa-header") guiSetProperty(regbutton, "NormalTextColour", "FF69D429") guestbutton = guiCreateButton(199, 553, 129, 42, "Anónimo", false, loginpanel) guiSetFont(guestbutton, "sa-header") reguserlabel = guiCreateLabel(31, 353, 59, 17, "USUARIO:", false, loginpanel) guiLabelSetColor(reguserlabel, 252, 0, 0) regpasslabel = guiCreateLabel(31, 427, 86, 17, "CONTRASEÑA:", false, loginpanel) guiLabelSetColor(regpasslabel, 252, 0, 0) userreglogbox = guiCreateEdit(21, 380, 188, 37, "", false, loginpanel) passreglogbox = guiCreateEdit(21, 454, 188, 37, "", false, loginpanel) memo = guiCreateMemo(21, 32, 517, 217, "", false, loginpanel) memo2 = guiCreateMemo(21, 262, 205, 81, "", false, loginpanel) guiEditSetMasked(passreglogbox, true) showCursor (true) guiSetInputEnabled(true) skinsgui = guiCreateWindow(0, 157, 1024, 458, "skins", false) guiWindowSetSizable(skinsgui, false) guiSetAlpha(skinsgui, 0.00) GUIEditor.label[1] = guiCreateLabel(326, 46, 357, 84, "Selecciona tu skin", false, skinsgui) guiSetFont(GUIEditor.label[1], "sa-gothic") GUIEditor.label[2] = guiCreateLabel(235, 140, 570, 49, "Click izquierdo sobre el skin de tu preferencia", false, skinsgui) guiSetFont(GUIEditor.label[2], "sa-header") image10 = guiCreateStaticImage(915, 209, 89, 211, ":login/iconos/skin7.png", false, skinsgui) image9 = guiCreateStaticImage(816, 209, 89, 211, ":login/iconos/skin6.png", false, skinsgui) image8 = guiCreateStaticImage(717, 209, 89, 211, ":login/iconos/skin4.png", false, skinsgui) image7 = guiCreateStaticImage(618, 209, 89, 211, ":login/iconos/skin3.png", false, skinsgui) image6 = guiCreateStaticImage(519, 209, 89, 211, ":login/iconos/skin2.png", false, skinsgui) image5 = guiCreateStaticImage(420, 209, 89, 211, ":login/iconos/skin1.png", false, skinsgui) image4 = guiCreateStaticImage(321, 209, 89, 211, ":login/iconos/skin10.png", false, skinsgui) image3 = guiCreateStaticImage(222, 209, 89, 211, ":login/iconos/skin9.png", false, skinsgui) image2 = guiCreateStaticImage(123, 209, 89, 211, ":login/iconos/skin8.png", false, skinsgui) image1 = guiCreateStaticImage(22, 209, 89, 211, ":login/iconos/skin5.png", false, skinsgui) button10 = guiCreateButton(924, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button10, 0.00) button9 = guiCreateButton(826, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button9, 0.00) button8 = guiCreateButton(727, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button8, 0.00) button7 = guiCreateButton(627, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button7, 0.00) button6 = guiCreateButton(529, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button6, 0.00) button5 = guiCreateButton(430, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button5, 0.00) button4 = guiCreateButton(330, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button4, 0.00) button3 = guiCreateButton(231, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button3, 0.00) button2 = guiCreateButton(133, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button2, 0.00) button1 = guiCreateButton(32, 222, 70, 188, "", false, skinsgui) guiSetAlpha(button1, 0.00) guiSetVisible (skinsgui,false) function skinsv guiSetVisible (skinsgui,true) showCursor (true) end addEvent("closeLoginPanel", true) addEventHandler ("closeLoginPanel", getRootElement(), skinsv) function logbuttonf () local username = guiGetText(userreglogbox) local password = guiGetText(passreglogbox) if username ~= "" and password ~= "" then triggerServerEvent("login",getLocalPlayer(),username,password) end end addEventHandler ("onClientGUIClick",logbutton ,logbuttonf ,false) function regbuttonf () local username = guiGetText(userreglogbox) local password = guiGetText(passreglogbox) if username ~= "" and password ~= "" then triggerServerEvent("register",getLocalPlayer(),username,password) end end addEventHandler ("onClientGUIClick",regbutton ,regbuttonf ,false) function guestbuttonf () outputChatBox("HAS INGRESADO COMO ANÓNIMO") guiSetVisible(loginpanel,false) showCursor(false) triggerServerEvent("guestf", localPlayer, spawnX, spawnY, spawnZ) end addEventHandler ("onClientGUIClick",guestbutton ,guestbuttonf ,false) function closeLoginPanel ( ) guiSetVisible(loginpanel,false) showCursor(false) end addEventHandler("closeLoginPanel",getRootElement(),closeLoginPanel) function logbuttonff (localPlayer, "enter", "down") local username = guiGetText(userreglogbox) local password = guiGetText(passreglogbox) if username ~= "" and password ~= "" then triggerServerEvent("login",getLocalPlayer(),username,password) end end bindKey (localPlayer, "enter", "down", logbuttonff) Server.lua - function register_func (username, passwort) local acc = addAccount(username,passwort) if acc then logIn(source,acc,passwort) outputChatBox("USTED SE HA REGISTRADO Y LOGUEADO CORRECTAMENTE",source,0,125,0) triggerClientEvent(source,"closeLoginPanel",source) else outputChatBox("SE HA PRODUCIDO UN ERROR",source,125,0,0) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) function login_func (username, passwort) local acc = getAccount(username,passwort) if acc then logIn(source,acc,passwort) outputChatBox("HAS INICIADO SESION CORRECTAMENTE ,"..getPlayerName(source),source,0,125,0) triggerClientEvent(source,"closeLoginPanel",source) else outputChatBox("USUARIO O CONTRASEÑA INCORRECTOS, VUELVA A INTENTARLO",source,125,0,0) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Skinchanger.lua - addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()),function() txd = engineLoadTXD("skins/skin1.txd", 7 ) engineImportTXD(txd, 7) dff = engineLoadDFF("skins/skin1.dff", 7 ) engineReplaceModel(dff, 7) txd = engineLoadTXD("skins/skin2.txd", 14 ) engineImportTXD(txd, 14) dff = engineLoadDFF("skins/skin2.dff", 14 ) engineReplaceModel(dff, 14) txd = engineLoadTXD("skins/skin3.txd", 15 ) engineImportTXD(txd, 15) dff = engineLoadDFF("skins/skin3.dff", 15 ) engineReplaceModel(dff, 15) txd = engineLoadTXD("skins/skin4.txd", 16 ) engineImportTXD(txd, 16) dff = engineLoadDFF("skins/skin4.dff", 16 ) engineReplaceModel(dff, 16) txd = engineLoadTXD("skins/skin5.txd", 17 ) engineImportTXD(txd, 17) dff = engineLoadDFF("skins/skin5.dff", 17 ) engineReplaceModel(dff, 17) txd = engineLoadTXD("skins/skin6.txd", 18 ) engineImportTXD(txd, 18) dff = engineLoadDFF("skins/skin6.dff", 18 ) engineReplaceModel(dff, 18) txd = engineLoadTXD("skins/skin7.txd", 19 ) engineImportTXD(txd, 19) dff = engineLoadDFF("skins/skin7.dff", 19 ) engineReplaceModel(dff, 19) txd = engineLoadTXD("skins/skin8.txd", 20 ) engineImportTXD(txd, 20) dff = engineLoadDFF("skins/skin8.dff", 20 ) engineReplaceModel(dff, 20) txd = engineLoadTXD("skins/skin9.txd", 21 ) engineImportTXD(txd, 21) dff = engineLoadDFF("skins/skin9.dff", 21 ) engineReplaceModel(dff, 21) txd = engineLoadTXD("skins/skin10.txd", 22 ) engineImportTXD(txd, 22) dff = engineLoadDFF("skins/skin10.dff", 22 ) engineReplaceModel(dff, 22) end ) Link to comment
elmy2424 Posted October 13, 2013 Author Share Posted October 13, 2013 the same T.T the skins txd and dff change fine but the gui dont appears logingui neither skinselector gui. sorry for my bad english an thanks for you time. 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