daKillar2000 Posted September 6, 2010 Share Posted September 6, 2010 hi i create a login system but he gives 2 warning in this lines account = addAccount(username, password) if (logIn(player, account, password) == true) then warning bad argument the line: acces denied addAcount | i put this in acl <object name="resource.newlogin" /> ; warning bad arguemnt the line : logIn Edit by varez: added lua and code tags. I know you won´t but.. Use them next time Link to comment
BinSlayer1 Posted September 6, 2010 Share Posted September 6, 2010 u probably have to post the entire script or at least a bigger part of it.. just because debugging says the error is in a specific line, it could actually be way before it Link to comment
daKillar2000 Posted September 6, 2010 Author Share Posted September 6, 2010 function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then triggerClientEvent (player, "hideLoginWindow", getRootElement()) else triggerClientEvent (player, "unknownError", getRootElement()) end else triggerClientEvent (player, "loginWrong", getRootElement()) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then outputChatBox("If you want to change your password, use /changepw", player) triggerClientEvent(player, "hideLoginWindow", getRootElement()) else triggerClientEvent(player, "unknownError", getRootElement()) end end end addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler) edit by guess who: same reason Link to comment
Castillo Posted September 6, 2010 Share Posted September 6, 2010 use [lua][/lua] tags please, it makes the code more redeable. Link to comment
daKillar2000 Posted September 6, 2010 Author Share Posted September 6, 2010 ok thx i whill test it Link to comment
BinSlayer1 Posted September 7, 2010 Share Posted September 7, 2010 My idea is to make command handlers instead of the event handlers for login and register Link to comment
daKillar2000 Posted September 7, 2010 Author Share Posted September 7, 2010 nah a command is not very nice login register only does it perfectly but gives the same warning and [lua] [/ lua] does not work help me please Link to comment
dzek (varez) Posted September 7, 2010 Share Posted September 7, 2010 he said - use [lua][/lua] tags in your posts, not in your script Link to comment
daKillar2000 Posted September 7, 2010 Author Share Posted September 7, 2010 yea i know but can anny help me and i not say if i put in me script haha but tekst now works for me on forum';) Link to comment
dzek (varez) Posted September 7, 2010 Share Posted September 7, 2010 i was always working (except for 3 days around 20th of Aug), and this is your first time you successfully used it - congratulations! Link to comment
daKillar2000 Posted September 7, 2010 Author Share Posted September 7, 2010 haha:P and can u help me now:P Link to comment
daKillar2000 Posted September 7, 2010 Author Share Posted September 7, 2010 Can Any Help Me Please Link to comment
dzek (varez) Posted September 8, 2010 Share Posted September 8, 2010 Don't Be lazy, do a little debug.. Just before login line output some debug strings with informations such as if your player element is valid, his nickname, given username and password, name of account that you are trying to log player into. That's debugging. I cannot tell you more without gui part, but i think it's not a problem to output some values, right? Link to comment
daKillar2000 Posted September 8, 2010 Author Share Posted September 8, 2010 this made the register not works login works fine:) -------Warnings WARNING: login\script.lua:20: Access denied @ 'addAccount' WARNING:login\script.lua:21: Bad argument @ 'logIn' -------the lines line20: account = addAccount(username, password) line21: if (logIn(player, account, password) == true) then Link to comment
dzek (varez) Posted September 8, 2010 Share Posted September 8, 2010 post whole acl.xml Link to comment
daKillar2000 Posted September 8, 2010 Author Share Posted September 8, 2010 i know i most put this but not works:O Link to comment
dzek (varez) Posted September 8, 2010 Share Posted September 8, 2010 again, but bigger letters for better understanding post whole acl.xml and one more thing: tell us your resource name (newlogin ?) Link to comment
Discord Moderators Zango Posted September 8, 2010 Discord Moderators Share Posted September 8, 2010 unless your group 'Everyone' has permissions to addAccount it wont work. Instead, do this: <group name="Admin"> <acl name="Moderator" /> <acl name="SuperModerator" /> <acl name="Admin" /> <acl name="RPC" /> <object name="resource.admin" /> <object name="resource.webadmin" /> <object name="resource.login" /> </group> Link to comment
daKillar2000 Posted September 8, 2010 Author Share Posted September 8, 2010 not works:( can i send it to mail for look in script? Link to comment
daKillar2000 Posted September 8, 2010 Author Share Posted September 8, 2010 <group name="Admin"> <acl name="Moderator" /> <acl name="SuperModerator" /> <acl name="Admin" /> <acl name="RPC" /> <object name="resource.admin" /> <object name="resource.webadmin" /> <object name="resource.login" /> <object name="user.Snaky" /> </group> Link to comment
Discord Moderators Zango Posted September 8, 2010 Discord Moderators Share Posted September 8, 2010 I must ask, are you sure the resource which your register/login code is in, is called 'login' and not something else? Link to comment
daKillar2000 Posted September 8, 2010 Author Share Posted September 8, 2010 nop the name is login:O Link to comment
dzek (varez) Posted September 8, 2010 Share Posted September 8, 2010 attach WHOLE resource here. we will say what you did wrong 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