Tekken Posted June 7, 2015 Share Posted June 7, 2015 Why i get this error? Error: WARNING: login\login_s.lua:6: Bad argument @ 'logIn' [Expected account at argument 2, got string 'username'] Code: Server: addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), function(username,password) local acc = getAccount(username,password) if acc then logIn(source, username, password) else outputChatBox("[Login] Check username and password!", source, 255, 0, 0, true) return end end) Client: addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), function() if (source == login_but) then username = guiGetText(the_user) password = guiGetText(the_pass) if username ~= "" and password ~= "" then triggerServerEvent("loginPlayer", localPlayer, username, password) else outputChatBox("[Login] Please complet username and password!", 255, 0, 0) return end end end) Link to comment
Walid Posted June 7, 2015 Share Posted June 7, 2015 -- Client side addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), function() if (source == login_but) then username = guiGetText(the_user) password = guiGetText(the_pass) if username ~= "" and password ~= "" then triggerServerEvent("loginPlayer", localPlayer, username, password) else outputChatBox("[Login] Please complet username and password!", 255, 0, 0) return end end end) -- Server side addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), function(username,password) local acc = getAccount(username,password) if acc then logIn(source, acc, password) else outputChatBox("[Login] Check username and password!", source, 255, 0, 0, true) return 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