MisterQuestions Posted October 13, 2014 Posted October 13, 2014 Hola a todos, tengo un problema, he creado un pequeño login, pero pues tengo el problema de que no me registra la cuenta, o almenos eso parece por que aparece como si la registrara pero al intentar logear con esta, da error. Aqui el codigo. Server-Side function serverLogin( username, password ) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn(source, account, password) outputChatBox("You successfully logged in", source, 0, 255, 0, true) else outputChatBox("Failed to login!", source, 255, 0, 0, true) end end end end addEvent("player:login", true) addEventHandler("player:login", getRootElement(), serverLogin) function serverRegister( username, password ) local account = getAccount ( username, password ) if (account == false) then addAccount(tostring(username),tostring(password)) outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) else outputChatBox("Failed to register!", source, 255, 0, 0, true) end end addEvent("player:register", true) addEventHandler("player:register", getRootElement(), serverRegister)
alex17 Posted October 14, 2014 Posted October 14, 2014 le diste permisos de Admin a tu script de login ?
alex17 Posted October 14, 2014 Posted October 14, 2014 que raro no tiene ningun problema tu codigo lo acabo de provar y me funciona prefectamente asegurate bien de darle permisos de admin en el ACL "resource.login"> ---- enves de login debes poner el nombre de tu script
MisterQuestions Posted October 14, 2014 Author Posted October 14, 2014 Si, tiene permisos de admin & todo pero no se que falla...
depato123 Posted October 14, 2014 Posted October 14, 2014 ¿Estás seguro que está encendido el resource? ¿Está bien colocado el meta.xml? ¿Tiene fallos en el debugscript?
alex17 Posted October 14, 2014 Posted October 14, 2014 Si, tiene permisos de admin & todo pero no se que falla... que raro @XeroxMta como te dije yo lo prove y no me dio ningun problema me registro correctamente y me pude logear tambien correctamente
MisterQuestions Posted October 14, 2014 Author Posted October 14, 2014 Listo, ya no tengo mas errores, gracias.
alex17 Posted October 14, 2014 Posted October 14, 2014 Listo, ya no tengo mas errores, gracias. y cual era el problemma ?
MisterQuestions Posted October 14, 2014 Author Posted October 14, 2014 No se .-. Reinicie el servidor y ya registraba y todo
AlFA# Posted October 14, 2014 Posted October 14, 2014 No se .-. Reinicie el servidor y ya registraba y todo cada vez que editas la acl por la carpeta en vez por panel, tendrás que reiniciar el servidor entero, por eso es mejor vía panel.
Tomas Posted October 14, 2014 Posted October 14, 2014 Se puede editar desde el archivo y luego reiniciar el ACL...
AlFA# Posted October 14, 2014 Posted October 14, 2014 Se puede editar desde el archivo y luego reiniciar el ACL... ¿Y que comando es? Yo solo conozco el reloadacl pero que yo sepa solo esta en paradise.
MisterQuestions Posted October 17, 2014 Author Posted October 17, 2014 No entinedo aveces funciona aveces no les paso el codigo.... Client-Side ---Trigger Register addEventHandler("onClientClick", getRootElement(), function( button, state, px, py ) if ( button == "left" and state == "down" ) then if ( px > 266 and px < 359 and py > 634 and py < 674 ) then local username = guiGetText( user_edit ) local password = guiGetText( pass_edit ) if ( user ~= "" and pass ~= "" ) then -- outputChatBox("El boton de register funciona!", 255, 255, 255, true) triggerServerEvent("player:register", getLocalPlayer(), username, password) end end end end ) Server-Side function serverRegister( username, password ) local account = getAccount ( username, password ) if (account == false) then addAccount(tostring(username),tostring(password)) outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) outputChatBox("Ahora puedes logearte!", source, 255, 255, 255, true) else outputChatBox("Failed to register!", source, 255, 0, 0, true) end end addEvent("player:register", true) addEventHandler("player:register", getRootElement(), serverRegister)
MisterQuestions Posted October 17, 2014 Author Posted October 17, 2014 No entinedo aveces funciona aveces no les paso el codigo.... Client-Side ---Trigger Register addEventHandler("onClientClick", getRootElement(), function( button, state, px, py ) if ( button == "left" and state == "down" ) then if ( px > 266 and px < 359 and py > 634 and py < 674 ) then local username = guiGetText( user_edit ) local password = guiGetText( pass_edit ) if ( user ~= "" and pass ~= "" ) then -- outputChatBox("El boton de register funciona!", 255, 255, 255, true) triggerServerEvent("player:register", getLocalPlayer(), username, password) end end end end ) Server-Side function serverRegister( username, password ) local account = getAccount ( username, password ) if (account == false) then addAccount(tostring(username),tostring(password)) outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) outputChatBox("Ahora puedes logearte!", source, 255, 255, 255, true) else outputChatBox("Failed to register!", source, 255, 0, 0, true) end end addEvent("player:register", true) addEventHandler("player:register", getRootElement(), serverRegister)
MisterQuestions Posted October 17, 2014 Author Posted October 17, 2014 No entinedo aveces funciona aveces no les paso el codigo.... Client-Side ---Trigger Register addEventHandler("onClientClick", getRootElement(), function( button, state, px, py ) if ( button == "left" and state == "down" ) then if ( px > 266 and px < 359 and py > 634 and py < 674 ) then local username = guiGetText( user_edit ) local password = guiGetText( pass_edit ) if ( user ~= "" and pass ~= "" ) then -- outputChatBox("El boton de register funciona!", 255, 255, 255, true) triggerServerEvent("player:register", getLocalPlayer(), username, password) end end end end ) Server-Side function serverRegister( username, password ) local account = getAccount ( username, password ) if (account == false) then addAccount(tostring(username),tostring(password)) outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) outputChatBox("Ahora puedes logearte!", source, 255, 255, 255, true) else outputChatBox("Failed to register!", source, 255, 0, 0, true) end end addEvent("player:register", true) addEventHandler("player:register", getRootElement(), serverRegister)
Recommended Posts