Jump to content

Kick player access


AMARANT

Recommended Posts

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

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

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

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
  • 1 year later...
Hi, i have it script.. but i want to add Fuction outputchatbox and setTimer.. help :D
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

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