AMARANT Posted May 16, 2012 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)
Guest Guest4401 Posted May 16, 2012 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.
AMARANT Posted May 16, 2012 Author 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>
Moderators IIYAMA Posted May 16, 2012 Moderators 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()
AMARANT Posted May 16, 2012 Author 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?
X-SHADOW Posted May 16, 2012 Posted May 16, 2012 function onLogout () kickPlayer ( source, "Logging out is disallowed!" ) end addEventHandler ("onPlayerLogout", getRootElement(), onLogout)
PhantomDamn Posted January 14, 2014 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)
isa_Khamdan Posted January 14, 2014 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)
xXMADEXx Posted January 14, 2014 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.
Quited Posted January 14, 2014 Posted January 14, 2014 Maybe admin group doesn't have kickPlayer access try replace your acl.xml
PhantomDamn Posted January 15, 2014 Posted January 15, 2014 see it https://community.multitheftauto.com/index.php?p=resources&s=details&id=8530
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