Frank-De-Ruiter Posted January 22, 2008 Share Posted January 22, 2008 Hello all, I want to know how to maken an script work only with moderator so that the admin makes you can moderator and when you login with your moderator something pops up and then you can use it but so that normal players cant use it. Is this possible to or cant this be done? Greatings Frank Link to comment
danifer Posted January 23, 2008 Share Posted January 23, 2008 for instance you could create commands with addCommandHandler() that only accepted special commands from only a certain account, using the getPlayerAccount(), that is you, the admin.....maybe? I haven't looked into this so I don't if this is the best way to go, but it would work. Link to comment
Woovie Posted January 24, 2008 Share Posted January 24, 2008 Yes, this is very possible with the GUI commands available on http://development.mtasa.com/ Link to comment
eAi Posted January 25, 2008 Share Posted January 25, 2008 Use the ACL. You can specify what users can access what console commands very easily. Link to comment
tma Posted January 25, 2008 Share Posted January 25, 2008 Use the ACL. You can specify what users can access what console commands very easily. The only trouble with that is the server ACL must have the commands in to block the user from using them for every game mode installed on the server. This is the reason I added my own account level checks to commands to make sure they wouldn't fire at all by normal users. function playerInACLGroup(player,groupName) local et = getElementType(player) if (et == "player") or (et == "console") then local account = getClientAccount(player) if not isGuestAccount(account) then local un = "user." .. getAccountName(account) local group = aclGetGroup (groupName) for id, object in ipairs(aclGroupListObjects(group)) do if object == un then return true end end end end return false end function playerHasPower(player) -- Return true if the player belongs to any of the priveledged users for i,groupName in pairs({"Moderator","SuperModerator","Admin","Console"}) do if playerInACLGroup(player,groupName) then return true end end return false end 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