Jump to content

Some trouble with logIn


sos

Recommended Posts

function lg ( thePlayer, commandName,ac,ps) 
p = tostring(ps) 
logIn( thePlayer,ac,ps) 
outputChatBox(ac.."  "..ps)  
end  
addCommandHandler ( "lg", lg ) 

-----

WARNING: commands.lua: Bad argument @ 'logIn' - Line: 109

Please help

That I do not so?

Link to comment

In your function you have "commandName" which is never used. Assuming that you type "/lg user pass" in the chatbox, that will set: commandName = user, ac = pass, leaving "ps" empty. Try removing commandName from your function

Edit: Nevermind, commandName is the name of the command my bad :P

Edited by Guest
Link to comment

logIn ( player thePlayer, account theAccount, string thePassword )

Okay I had a go with this only yesterday, and got it to work once (then it broke itself) :D

What I did was I made an auto-login function which was to auto ban people. all the function did was:

function logMeIn()

login Console, Console, Password

end

addEventHandler "onResourceStart", getRootElement

Now for this to work it needs to have an account. So I edited the accounts.xml file and added a password to the Console user. Then tested it on the server, and it did work (once).

I then went back and discovered it had added another user called Console without a password, hence why it had stopped working.

Therefore I would try something similar but with a static made account, and see what happens (in my case I think I pretty much made an everyone is admin script by mistake).

Chief.

Link to comment

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