AMARANT Posted May 16, 2012 Share Posted May 16, 2012 I tried to make anti-logout function that blocks /logout command and kicks the player from the server but it always shows a warning in the console "Access denied @ 'kickPlayer'". How come does it happen if in acl.xml I added my resource to Admin group? Here's that very function: function onLogout () kickPlayer ( source, nil, "Logging out is disallowed!" ) cancelEvent() end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 This error occurs only when the resource doesn't have access. In other words, you haven't added resource name to ACL Group 'Admin'. If you have added in acl.xml, you might have a spelling mistake or you added in the wrong place. Link to comment
AMARANT Posted May 16, 2012 Author Share Posted May 16, 2012 Is this wrong adding? <group name="Admin"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="resource.admin"></object> <object name="resource.webadmin"></object> <object name="resource.driver"></object> <object name="resource.farmer"></object> [color=#FF0000]<object name="resource.login"></object>[/color] <object name="user.AMARANT"></object> </group> Link to comment
Moderators IIYAMA Posted May 16, 2012 Moderators Share Posted May 16, 2012 I don't know what the name of the resource is, but X will be your resource name. So no it is not a wrong adding. --> -------------------- Players will be automatic logout when they got kicked. --> cancelEvent() Link to comment
AMARANT Posted May 16, 2012 Author Share Posted May 16, 2012 Resource name is "login". But if you're saying that I do it right then why it isn't still working? Link to comment
X-SHADOW Posted May 16, 2012 Share Posted May 16, 2012 function onLogout () kickPlayer ( source, "Logging out is disallowed!" ) end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) Link to comment
PhantomDamn Posted January 14, 2014 Share Posted January 14, 2014 Hi, i have it script.. but i want to add Fuction outputchatbox and setTimer.. help function onLogout () kickPlayer ( source, "Prohibido dar logout!" ) end setTimer ( onLogout, 8000 ) ---i thinnk!--- addEventHandler ("onPlayerLogout", getRootElement(), onLogout) Link to comment
isa_Khamdan Posted January 14, 2014 Share Posted January 14, 2014 Hi, i have it script.. but i want to add Fuction outputchatbox and setTimer.. help function onLogout () kickPlayer ( source, "Prohibido dar logout!" ) end setTimer ( onLogout, 8000 ) ---i thinnk!--- addEventHandler ("onPlayerLogout", getRootElement(), onLogout) No that's not correct. Try this function onLogout () setTimer ( kickPlayer , 8000 , 1 , source , "Prohibido dar logout!") end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) Link to comment
xXMADEXx Posted January 14, 2014 Share Posted January 14, 2014 When you edit acl.xml, make sure that the server is stopped. If that still doesn't work, then stop your server, open acl.xml, find where it says and right below that, put: save acl, start server. Link to comment
Quited Posted January 14, 2014 Share Posted January 14, 2014 Maybe admin group doesn't have kickPlayer access try replace your acl.xml Link to comment
PhantomDamn Posted January 15, 2014 Share Posted January 15, 2014 see it https://community.multitheftauto.com/index.php?p=resources&s=details&id=8530 Link to comment
Sasu Posted January 15, 2014 Share Posted January 15, 2014 Guys, this post is from 2012 ._. 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