Tando Posted February 2, 2019 Share Posted February 2, 2019 addCommandHandler("muteall", function(thePlayer, _, ...) if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Staff"))) then ----what i have to put outputChatBox ("Staff Team has been mute all") end end) how to make when i type this command all players get mute exept Who in Staff acl and unmute too Link to comment
AncienT Posted February 2, 2019 Share Posted February 2, 2019 addCommandHandler("muteall", function(thePlayer, _, ...) if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Staff"))) then for ID,player in ipairs(getElementsByType("player")) do if not isPlayerInACL(player, "Staff") then setPlayerMuted (player, true) end end end end) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end Link to comment
Tando Posted February 2, 2019 Author Share Posted February 2, 2019 7 minutes ago, AncienT said: addCommandHandler("muteall", function(thePlayer, _, ...) if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Staff"))) then for ID,player in ipairs(getElementsByType("player")) do if not isPlayerInACL(player, "Staff") then setPlayerMuted (player, true) end end end end) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end What about unmute? Link to comment
AncienT Posted February 2, 2019 Share Posted February 2, 2019 1 minute ago, (SAUG)Tando said: What about unmute? addCommandHandler("unmuteall", function(thePlayer, _, ...) if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Staff"))) then for ID,player in ipairs(getElementsByType("player")) do if not isPlayerInACL(player, "Staff") then setPlayerMuted (player, false) end end end end) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end Link to comment
Tando Posted February 2, 2019 Author Share Posted February 2, 2019 11 hours ago, AncienT said: addCommandHandler("unmuteall", function(thePlayer, _, ...) if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Staff"))) then for ID,player in ipairs(getElementsByType("player")) do if not isPlayerInACL(player, "Staff") then setPlayerMuted (player, false) end end end end) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end what about acses Denied? 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