Enargy, Posted February 23, 2014 Share Posted February 23, 2014 why? WARNING: Access Denied @ 'setPlayerMuted' localTime = {} addEventHandler("onPlayerChat", root, function (player) if isTimer(localTime[player]) then cancelEvent() outputChatBox(getPlayerName(source).."has been muted 60 seconds[Flooding]", getRootElement(), 255, 255, 0,true) setPlayerMuted(player, true) setTimer ( removeMute, 60000, 1, player) else localTime[player] = setTimer(function(player) localTime[player] = nil end, 2000, 1, player) end end ) function removeMute ( player ) if ( isElement ( player ) and isPlayerMuted ( player ) ) then setPlayerMuted ( player, false ) outputChatBox (getPlayerName ( player ).." has been unmute.",getRootElement(), 0, 255, 0,true ) end end Link to comment
DNL291 Posted February 23, 2014 Share Posted February 23, 2014 Add your anti-flood to the ACL. Link to comment
Noki Posted February 23, 2014 Share Posted February 23, 2014 Make sure the resource has ACL permissions to mute a player. In acl.xml, add Link to comment
TAPL Posted February 23, 2014 Share Posted February 23, 2014 Event onPlayerChat doesn't have player parameter, use source instead. 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