Jump to content

logIn


Tekken

Recommended Posts

Posted

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) 

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted
-- 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) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...