SnoopCat Posted September 12, 2011 Share Posted September 12, 2011 hello mi problem is that when i put my login on the server the gui appears but i cant register or login and when i choose the jugar sin registrarse buton that means Play not legged in the mouse is still showing and dont dissapears can someone help me?? here is the code: client: local localPlayer = getLocalPlayer () GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(201,213,255,341,"Welcome",false) GUIEditor_Edit[1] = guiCreateEdit(76,58,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[2] = guiCreateEdit(76,96,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(11,65,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(12,101,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(19,180,212,22,"O si eres Nuevo Registrate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(20,27,212,22,"Bienvenido porfavor Logeate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Button[1] = guiCreateButton(133,142,101,31,"Logear",false,GUIEditor_Window[1]) GUIEditor_Edit[3] = guiCreateEdit(74,202,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[4] = guiCreateEdit(74,240,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[5] = guiCreateLabel(10,208,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Label[6] = guiCreateLabel(7,245,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[6],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(133,284,101,31,"Registrarse",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(20,289,100,38,"Jugar Sin registrarse",false,GUIEditor_Window[1]) function closeThis() if (source == GUIEditor_Button[3]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end end function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetVisible ( GUIEditor_Window[1], true ) guiSetInputEnabled(true) showCursor ( true ) end function onClickBtn ( button, state ) if (source == GUIEditor_Button[1]) then triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword) ) end end function onClickBtn2 ( button, state ) if (source == GUIEditor_Button[2]) then triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword)) end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onClickBtn, false ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], onClickBtn2, false ) addEventHandler("onClientGUIClick", GUIEditor_Button[3],closeThis,false) Server: function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin ) function onRegister ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "onRegister", true ) addEventHandler( "onRegister", getRootElement(), onRegister ) pease help Link to comment
SnoopCat Posted September 12, 2011 Author Share Posted September 12, 2011 here is the image of debugscript 3 i rrly dont know what they means Link to comment
JR10 Posted September 12, 2011 Share Posted September 12, 2011 Of course, you are using nil variables in guiGetText local localPlayer = getLocalPlayer () GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(201,213,255,341,"Welcome",false) GUIEditor_Edit[1] = guiCreateEdit(76,58,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[2] = guiCreateEdit(76,96,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(11,65,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(12,101,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(19,180,212,22,"O si eres Nuevo Registrate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(20,27,212,22,"Bienvenido porfavor Logeate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Button[1] = guiCreateButton(133,142,101,31,"Logear",false,GUIEditor_Window[1]) GUIEditor_Edit[3] = guiCreateEdit(74,202,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[4] = guiCreateEdit(74,240,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[5] = guiCreateLabel(10,208,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Label[6] = guiCreateLabel(7,245,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[6],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(133,284,101,31,"Registrarse",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(20,289,100,38,"Jugar Sin registrarse",false,GUIEditor_Window[1]) function closeThis() if (source == GUIEditor_Button[3]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end end function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetVisible ( GUIEditor_Window[1], true ) guiSetInputEnabled(true) showCursor ( true ) end function onClickBtn ( button, state ) if (source == GUIEditor_Button[1]) then triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(GUIEditor_Edit[1]), guiGetText(GUIEditor_Edit[2]) ) end end function onClickBtn2 ( button, state ) if (source == GUIEditor_Button[2]) then triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(GUIEditor_Edit[3]sername), guiGetText(GUIEditor_Edit[4])) end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onClickBtn, false ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], onClickBtn2, false ) addEventHandler("onClientGUIClick", GUIEditor_Button[3],closeThis,false) It might be reversed at guiGetText, check it. Link to comment
SnoopCat Posted September 12, 2011 Author Share Posted September 12, 2011 not showing gui now this is what i get on the debugscript 3 Link to comment
JR10 Posted September 12, 2011 Share Posted September 12, 2011 local localPlayer = getLocalPlayer () GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(201,213,255,341,"Welcome",false) GUIEditor_Edit[1] = guiCreateEdit(76,58,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[2] = guiCreateEdit(76,96,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(11,65,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(12,101,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(19,180,212,22,"O si eres Nuevo Registrate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(20,27,212,22,"Bienvenido porfavor Logeate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Button[1] = guiCreateButton(133,142,101,31,"Logear",false,GUIEditor_Window[1]) GUIEditor_Edit[3] = guiCreateEdit(74,202,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[4] = guiCreateEdit(74,240,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[5] = guiCreateLabel(10,208,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Label[6] = guiCreateLabel(7,245,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[6],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(133,284,101,31,"Registrarse",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(20,289,100,38,"Jugar Sin registrarse",false,GUIEditor_Window[1]) function closeThis() if (source == GUIEditor_Button[3]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end end function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetVisible ( GUIEditor_Window[1], true ) guiSetInputEnabled(true) showCursor ( true ) end function onClickBtn ( button, state ) if (source == GUIEditor_Button[1]) then triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(GUIEditor_Edit[1]), guiGetText(GUIEditor_Edit[2]) ) end end function onClickBtn2 ( button, state ) if (source == GUIEditor_Button[2]) then triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(GUIEditor_Edit[3]), guiGetText(GUIEditor_Edit[4])) end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onClickBtn, false ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], onClickBtn2, false ) addEventHandler("onClientGUIClick", GUIEditor_Button[3],closeThis,false) Encode in UTF-8. Link to comment
SnoopCat Posted September 12, 2011 Author Share Posted September 12, 2011 thx now is working fine and now how i can hide the mouse when i push the play as not loged in button? Link to comment
SnoopCat Posted September 12, 2011 Author Share Posted September 12, 2011 that is just added look GUIEditor_Button[3] = guiCreateButton(20,289,100,38,"Jugar Sin registrarse",false,GUIEditor_Window[1]) function closeThis() if (source == GUIEditor_Button[3]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end end Link to comment
SnoopCat Posted September 13, 2011 Author Share Posted September 13, 2011 it is just fixed but when i put it on my non Testing server it haves the same problems 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