Stylez Posted July 5, 2013 Share Posted July 5, 2013 Heyo, so i spent an hour on trying to figure out whats the problem in this little script function meAdminAllTheTime(user, pass) local acc = getAccount(user, pass) if (acc ~= false) then outputChatBox("volia") end end addEventHandler("onPlayerJoin", getRootElement(), meAdminAllTheTime) It says : bad arg @ getAccount expected string at arg. 1 got nil. i tryed to fix it in many different ways. but i couldnt Link to comment
Jesseunit Posted July 5, 2013 Share Posted July 5, 2013 Heyo, so i spent an hour on trying to figure out whats the problem in this little script function meAdminAllTheTime(user, pass) local acc = getAccount(user, pass) if (acc ~= false) then outputChatBox("volia") end end addEventHandler("onPlayerJoin", getRootElement(), meAdminAllTheTime) It says : bad arg @ getAccount expected string at arg. 1 got nil. i tryed to fix it in many different ways. but i couldnt Perhaps he's not logged in? oh oh oh also, you're trying to get the user and pass when a player joins the server. mhm? Link to comment
Stylez Posted July 5, 2013 Author Share Posted July 5, 2013 Yea, i tried to make simple auto login script when player joins server and this was begining of it.. Link to comment
Jesseunit Posted July 5, 2013 Share Posted July 5, 2013 Yea, i tried to make simple auto login script when player joins server and this was begining of it.. You do know that there is an auto-login option in the mtaserver config file? You do now. EDIT: I wrote this piece of shat for you, perhaps you could learn something out of it. function admin_check ( p ) if not isGuestAccount ( getPlayerAccount ( p ) ) then local account = getPlayerAccount ( p ) local name = getAccountName ( account ) if name == "accountnamehere" then outputChatBox ( "* Hai " .. name .. "!", p, 0, 255, 0, false ) else outputChatBox ( "* You're not an admin.", p, 255, 0, 0, false ) end else outputChatBox ( "* Yo you ain't logged in.", p, 255, 0, 0, false ) end end addCommandHandler ( "admin", admin_check ) Link to comment
Stylez Posted July 5, 2013 Author Share Posted July 5, 2013 Thanks i did not knew that there is an auto login option in mtaserver cfg file... and that was not what i needed, but thanks. Ofc. i learned something from dat Link to comment
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