GTX Posted January 4, 2012 Posted January 4, 2012 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
Kenix Posted January 4, 2012 Posted January 4, 2012 And what the problem?I not understand. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
GTX Posted January 4, 2012 Author Posted January 4, 2012 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
Kenix Posted January 4, 2012 Posted January 4, 2012 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.
GTX Posted January 4, 2012 Author Posted January 4, 2012 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
Kenix Posted January 4, 2012 Posted January 4, 2012 No problem! http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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