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)