Timic Posted October 28, 2010 Posted October 28, 2010 (edited) Hey, I made a login script but i had on a problem but i dont know what's the problem And here's my code: Client-Side: LoginWin = guiCreateWindow(532,337,359,234,"LoGiN SySTeM v1.0",false) GUIEditor_Label[1] = guiCreateLabel(26,64,61,18,"Username:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[1],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Label[2] = guiCreateLabel(52,181,5,5,"",false,GUIEditor_Label[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) GUIEditor_Label[3] = guiCreateLabel(26,108,61,18,"Password:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[3],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) usernameEditLogin = guiCreateEdit(92,59,228,31,"",false,LoginWin) passwordEditLogin = guiCreateEdit(92,103,228,31,"",false,LoginWin) logbtn = guiCreateButton(22,171,138,22,"Log In",false,LoginWin) regbtn = guiCreateButton(197,171,138,22,"Register",false,LoginWin) guestbtn = guiCreateButton(22,199,313,23,"Guest",false,LoginWin) GUIEditor_Label[4] = guiCreateLabel(127,28,107,16,"Log in or Register.",false,LoginWin) guiLabelSetColor(GUIEditor_Label[4],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) guiSetFont(GUIEditor_Label[4],"default-bold-small") function receiveVars( allow, email) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") if (email == "false") then guiSetVisible(LblRegisterEmail, false) guiSetVisible(EditRegisterEmail, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) guiSetText(usernameEditLogin, playername) guiSetText(usernameEditPassword, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == logbtn) then triggerServerEvent("onLogin", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", logbtn, onClickBtn, false) function onClickBtn1(button, state) if(button == "left" and state == "up") then if(source == regbtn) then triggerServerEvent("onRegister", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", regbtn, onClickBtn, false) function onClickBtn2(button, state) if(button == "left" and state == "up") then if(source == guestbtn) then guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end end end addEventHandler("onClientGUIClick", guestbtn, onClickBtn, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) Server-Side: function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... logOut ( player ) -- Log them out. end if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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, email ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "email", email) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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 ) function needVars() local allow_register = get("allow_register") local email_on_register = get("email_on_register") triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, email_on_register) end addEvent("onNeedVars", true) addEventHandler("onNeedVars", getRootElement(), needVars) EDITS: I dont know what's wrong again!: Edited October 28, 2010 by Guest Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
Timic Posted October 28, 2010 Author Posted October 28, 2010 ehmm.. How i can get reply? Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
CowTurbo Posted October 28, 2010 Posted October 28, 2010 go back to the basic lua scripts. LoginWin = guiCreateWindow(532,337,359,234,"LoGiN SySTeM v1.0",false) replace it with GUIEditor_Window[1] = guiCreateWindow(532,337,359,234,"LoGiN SySTeM v1.0",false) http://mrteamgaming.eu
[DMC] Posted October 28, 2010 Posted October 28, 2010 your window is called LoginWin and not GUIEditor_Window[1] Example GUIEditor_Label[1] = guiCreateLabel(26,64,61,18,"Username:",false,GUIEditor_Window[1]) needs to be GUIEditor_Label[1] = guiCreateLabel(26,64,61,18,"Username:",false,LoginWin) this should work LoginWin = guiCreateWindow(532,337,359,234,"LoGiN SySTeM v1.0",false) GUIEditor_Label[1] = guiCreateLabel(26,64,61,18,"Username:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[1],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Label[2] = guiCreateLabel(52,181,5,5,"",false,GUIEditor_Label[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) GUIEditor_Label[3] = guiCreateLabel(26,108,61,18,"Password:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[3],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) usernameEditLogin = guiCreateEdit(92,59,228,31,"",false,LoginWin) passwordEditLogin = guiCreateEdit(92,103,228,31,"",false,LoginWin) logbtn = guiCreateButton(22,171,138,22,"Log In",false,LoginWin) regbtn = guiCreateButton(197,171,138,22,"Register",false,LoginWin) guestbtn = guiCreateButton(22,199,313,23,"Guest",false,LoginWin) GUIEditor_Label[4] = guiCreateLabel(127,28,107,16,"Log in or Register.",false,LoginWin) guiLabelSetColor(GUIEditor_Label[4],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) guiSetFont(GUIEditor_Label[4],"default-bold-small") function receiveVars( allow, email) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") if (email == "false") then guiSetVisible(LblRegisterEmail, false) guiSetVisible(EditRegisterEmail, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) guiSetText(usernameEditLogin, playername) guiSetText(usernameEditPassword, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == logbtn) then triggerServerEvent("onLogin", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", logbtn, onClickBtn, false) function onClickBtn1(button, state) if(button == "left" and state == "up") then if(source == regbtn) then triggerServerEvent("onRegister", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", regbtn, onClickBtn, false) function onClickBtn2(button, state) if(button == "left" and state == "up") then if(source == guestbtn) then guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end end end addEventHandler("onClientGUIClick", guestbtn, onClickBtn, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) Server-Side: function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... logOut ( player ) -- Log them out. end if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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, email ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "email", email) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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 ) function needVars() local allow_register = get("allow_register") local email_on_register = get("email_on_register") triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, email_on_register) end addEvent("onNeedVars", true) addEventHandler("onNeedVars", getRootElement(), needVars)
Timic Posted October 28, 2010 Author Posted October 28, 2010 Hmm something wrong Look up i edit and add picture ^ Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
[DMC] Posted October 28, 2010 Posted October 28, 2010 lol ive just checked your code and just stop you are making an label on a label GUIEditor_Label[2] = guiCreateLabel(52,181,5,5,"",false,GUIEditor_Label[1])
Timic Posted October 28, 2010 Author Posted October 28, 2010 then ? what wrong? my cursor not showing too Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
[DMC] Posted October 29, 2010 Posted October 29, 2010 then ? what wrong?my cursor not showing too i know im an idiot but you dont get it YOU ARE PASTING A LABEL ON A LABEL
Timic Posted October 29, 2010 Author Posted October 29, 2010 yes i know i delete but still not working. Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
BabY Posted October 29, 2010 Posted October 29, 2010 Why you Don't make it With GUI Editor, Then Make the Scripts you Want Easly ... iiiiii Think This Would Work Thanks dzek for bearing my stupid questions as a noob. You helped me become a better programmer. Now I understand how important it is to help those who SUCK at programming.
dzek (varez) Posted October 29, 2010 Posted October 29, 2010 he have used gui editor THEN change SOME variable names (and not all their instances) inside the script .. o_O Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Timic Posted October 29, 2010 Author Posted October 29, 2010 Please help me Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
[DMC] Posted October 29, 2010 Posted October 29, 2010 LoginWin = guiCreateWindow(532,337,359,234,"LoGiN SySTeM v1.0",false) GUIEditor_Label[1] = guiCreateLabel(26,64,61,18,"Username:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[1],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Label[2] = guiCreateLabel(52,181,5,5,"",false,LoginWin) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) GUIEditor_Label[3] = guiCreateLabel(26,108,61,18,"Password:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[3],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) usernameEditLogin = guiCreateEdit(92,59,228,31,"",false,LoginWin) passwordEditLogin = guiCreateEdit(92,103,228,31,"",false,LoginWin) logbtn = guiCreateButton(22,171,138,22,"Log In",false,LoginWin) regbtn = guiCreateButton(197,171,138,22,"Register",false,LoginWin) guestbtn = guiCreateButton(22,199,313,23,"Guest",false,LoginWin) GUIEditor_Label[4] = guiCreateLabel(127,28,107,16,"Log in or Register.",false,LoginWin) guiLabelSetColor(GUIEditor_Label[4],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) guiSetFont(GUIEditor_Label[4],"default-bold-small") function receiveVars( allow, email) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") if (email == "false") then guiSetVisible(LblRegisterEmail, false) guiSetVisible(EditRegisterEmail, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) guiSetText(usernameEditLogin, playername) guiSetText(usernameEditPassword, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == logbtn) then triggerServerEvent("onLogin", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", logbtn, onClickBtn, false) function onClickBtn1(button, state) if(button == "left" and state == "up") then if(source == regbtn) then triggerServerEvent("onRegister", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", regbtn, onClickBtn, false) function onClickBtn2(button, state) if(button == "left" and state == "up") then if(source == guestbtn) then guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end end end addEventHandler("onClientGUIClick", guestbtn, onClickBtn, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) Server-Side: function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... logOut ( player ) -- Log them out. end if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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, email ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "email", email) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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 ) function needVars() local allow_register = get("allow_register") local email_on_register = get("email_on_register") triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, email_on_register) end addEvent("onNeedVars", true) addEventHandler("onNeedVars", getRootElement(), needVars)
Timic Posted October 29, 2010 Author Posted October 29, 2010 Still not works Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
BabY Posted October 29, 2010 Posted October 29, 2010 All you can Do, Is to Set Down Disaccppointed and Start Crying ... As you see, no one can Help and my Fool Post Dosen't Deserve to be a Post ! haha Thanks dzek for bearing my stupid questions as a noob. You helped me become a better programmer. Now I understand how important it is to help those who SUCK at programming.
Castillo Posted October 29, 2010 Posted October 29, 2010 client side: LoginWin = guiCreateWindow(532,337,359,234,"LoGiN SySTeM v1.0",false) loginLabel1 = guiCreateLabel(26,64,61,18,"Username:",false,LoginWin) guiLabelSetColor(loginLabel1,255,139,0) guiLabelSetVerticalAlign(loginLabel1,"top") guiLabelSetHorizontalAlign(loginLabel1,"left",false) loginLabel2 = guiCreateLabel(52,181,5,5,"",false,LoginWin) guiLabelSetColor(loginLabel2,255,255,255) guiLabelSetVerticalAlign(loginLabel2,"top") guiLabelSetHorizontalAlign(loginLabel2,"left",false) loginLabel3 = guiCreateLabel(26,108,61,18,"Password:",false,LoginWin) guiLabelSetColor(loginLabel3,255,139,0) guiLabelSetVerticalAlign(loginLabel3,"top") guiLabelSetHorizontalAlign(loginLabel3,"left",false) usernameEditLogin = guiCreateEdit(92,59,228,31,"",false,LoginWin) passwordEditLogin = guiCreateEdit(92,103,228,31,"",false,LoginWin) logbtn = guiCreateButton(22,171,138,22,"Log In",false,LoginWin) regbtn = guiCreateButton(197,171,138,22,"Register",false,LoginWin) guestbtn = guiCreateButton(22,199,313,23,"Guest",false,LoginWin) loginLabel4 = guiCreateLabel(127,28,107,16,"Log in or Register.",false,LoginWin) guiLabelSetColor(loginLabel4,255,255,255) guiLabelSetVerticalAlign(loginLabel4,"top") guiLabelSetHorizontalAlign(loginLabel4,"left",false) guiSetFont(loginLabel4,"default-bold-small") function receiveVars( allow, email) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") if (email == "false") then guiSetVisible(LblRegisterEmail, false) guiSetVisible(EditRegisterEmail, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) guiSetText(usernameEditLogin, playername) guiSetText(usernameEditPassword, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == logbtn) then triggerServerEvent("onLogin", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", logbtn, onClickBtn, false) function onClickBtn1(button, state) if(button == "left" and state == "up") then if(source == regbtn) then triggerServerEvent("onRegister", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", regbtn, onClickBtn, false) function onClickBtn2(button, state) if(button == "left" and state == "up") then if(source == guestbtn) then guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end end end addEventHandler("onClientGUIClick", guestbtn, onClickBtn, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) server side: function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... logOut ( player ) -- Log them out. end if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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, email ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "email", email) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "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 ) function needVars() local allow_register = get("allow_register") local email_on_register = get("email_on_register") triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, email_on_register) end addEvent("onNeedVars", true) addEventHandler("onNeedVars", getRootElement(), needVars) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Timic Posted October 29, 2010 Author Posted October 29, 2010 Thank you! Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
Timic Posted October 30, 2010 Author Posted October 30, 2010 ehmm... I cant login i cant do nothing Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
Castillo Posted October 30, 2010 Posted October 30, 2010 thats your problem not mine, check all the script and find your bug. i fixed the main one that gui elements wasn't there San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Aibo Posted October 30, 2010 Posted October 30, 2010 ehmm... I cant login i cant do nothing looks like you're copying stuff from the same place as this guy: viewtopic.php?f=91&t=29723 triggerServerEvent("onLogin", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) is localPlayer defined anywhere? if not — use getLocalPlayer() instead. ?
Timic Posted October 30, 2010 Author Posted October 30, 2010 nope i copyied from: https://community.multitheftauto.com/index.php?p= ... ils&id=617 but i changed some lines Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
Aibo Posted October 31, 2010 Posted October 31, 2010 nope i copyied from: https://community.multitheftauto.com/index.php?p= ... ils&id=617 but i changed some lines that doesnt mean that "other guy" haven't copied his stuff from the same resource. and you both forgot to copy one important line: local localPlayer = getLocalPlayer() ?
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