dontdo Posted June 21, 2016 Share Posted June 21, 2016 function LoginBTN (acc,pw) if (getAccount (acc,pw)) then logIn ( client, acc, pw ) --- ERROR HERE outputChatBox ("Exsiting") spawnPlayer ( client, -2172.79419, 500.00000, 35.17188 ) setCameraTarget ( client ) triggerClientEvent (client,"hide",client) else outputChatBox ("Not Exsiting") end end addEvent ("login",true) addEventHandler( "login", getRootElement(),LoginBTN) -- Server There is a preblom with logIn function function btns() local acc = guiGetText (email_txt) local pw = guiGetText (password_txt) if (source == Login_btn) then triggerServerEvent ("login",localPlayer,acc,pw) end end addEventHandler ( "onClientGUIClick", root, btns ) -Client Link to comment
Castillo Posted June 21, 2016 Share Posted June 21, 2016 You must use getAccount ( acc, pw ) instead of account name at logIn function. Link to comment
KariiiM Posted June 21, 2016 Share Posted June 21, 2016 -- server side: function LoginBTN ( acc, pw ) local account = getAccount ( acc, pw ) if ( account ) then if logIn ( source, account, pw ) then outputChatBox ( "Exsiting", source) spawnPlayer ( source, -2172.79419, 500.00000, 35.17188 ) fadeCamera ( source, true ) setCameraTarget ( source, source) triggerClientEvent ( source, "hide", source) end else outputChatBox ( "Not Exsiting", source) end end addEvent ( "login", true ) addEventHandler ( "login", root, LoginBTN ) -- client side: function btns ( ) if ( source == Login_btn ) then triggerServerEvent ( "login", localPlayer, guiGetText ( email_txt ), guiGetText ( password_txt ) ) end end addEventHandler ( "onClientGUIClick", guiRoot, btns ) Link to comment
Ahmed Ly Posted June 21, 2016 Share Posted June 21, 2016 ---Client addEventHandler ( "onClientGUIClick", root, function () local acc = guiGetText (email_txt) local pw = guiGetText (password_txt) if (source == Login_btn) then if acc == "" or pw == "" then outputChatBox("--",0,255,0) return end triggerServerEvent ("login",localPlayer,acc,pw) end end ) --------------------------------------- ---Server addEvent ("login",true) addEventHandler( "login",root, function (acc,pw) local accc = getAccount(acc,pw) if accc then logIn ( source,accc, pw ) outputChatBox ("Exsiting",source,0,255,0) spawnPlayer ( source, -2172.79419, 500.00000, 35.17188 ) setCameraTarget ( source,source ) triggerClientEvent ("hide",source) else outputChatBox ("Not Exsiting",source,0,255,0) end end ) 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