Jump to content

disallow /ss (setskin)


5150

Recommended Posts

while i have you here, this is correct? it is suppost to dissallow the default command: /ss (setskin) but keep the skin GUI:

local AllowedGroups = { 
    "Admin", 
    "SuperModerator", 
    "Moderator" 
} 
  
addEventHandler("onPlayerCommand", root, 
function(cmd) 
    if cmd == "ss" then 
        local account = getPlayerAccount(source) 
        local hasPermission 
        if account and not isGuestAccount(account) then 
            local accName = getAccountName(account) 
            for _, groupName in ipairs(AllowedGroups) do 
                local group = aclGetGroup(groupName) 
                if group then 
                    if isObjectInACLGroup("user."..accName, group) then 
                        hasPermission = true 
                        break 
                    end 
                end 
            end 
        end 
        if not hasPermission then 
            cancelEvent() 
        end 
    end 
end) 

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