Jump to content

Issue with logIn function


GTX

Recommended Posts

Posted

Hello! I'll explain: When a player with the serial where the serial variable is written joins then the logIn function log in the player automatically.

I can't explain better but here is the script:

local serial = "serial" 
local account = "gtx" 
local password = "password" -- I will not show all the details here 
  
function connect() 
if getPlayerSerial(source) == serial then 
logIn(source, account, password) 
else 
outputChatBox("WELCOME!") 
end 
end 
addEventHandler("onPlayerJoin", getRootElement(), connect) 
  

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted

Ah, I forgot to write debug here.

Bad argument @ 'logIn' [Expected account at argument 2, got string 'gtx'] - Line 8

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
Posted

Try

local serial = "serial" 
local account = "gtx" 
local password = "password" -- I will not show all the details here 
  
function connect() 
    if getPlayerSerial(source) == serial then 
        local acc = getAccount( account,password ) 
        if acc then 
            logIn(source, acc, password) 
        else 
            outputChatBox( "can't get account" ) 
        end 
    else 
        outputChatBox("WELCOME!") 
    end 
end 
addEventHandler("onPlayerJoin", root, connect ) 
  
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

It works! Thank you

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast

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...