Bad arguement @ 'getAccount' [Expected string at argument 1, got player]
Hey, i'm very new to scripting and I can already read scripts but I have trouble with debugging.
I have a problem with a simple login panel I made. The debug is above.
My code is here:
function loginPlayer(username,password)
if not (username == "") then
if not (password == "") then
local account = getAccount ( username, password )
if ( account ~= false ) then
logIn (source, account, password)
triggerClientEvent (source,"hideWindow1",getRootElement())
end
end
else
outputChatBox ("Insert your password/username",source,255,255,255,true)
end
end
addEvent("onPlayerLogin", true)
addEventHandler("onPlayerLogin", getRootElement(), loginPlayer)