itHyperoX Posted March 13, 2017 Share Posted March 13, 2017 (edited) Hi, i want to make a custom mute system, i tried a weeks ago. Can anybody give me "functions" what i need? i want to make like this: mute player for x y minutes with reason like /mute bignick 50 Test Edited March 13, 2017 by TheMOG Link to comment
NeXuS™ Posted March 13, 2017 Share Posted March 13, 2017 addEventHandler("onPlayerChat", getRootElement(), function() if getElementData(source, "muted") then cancelEvent() end end) And add just a command (addCommandHandler) to admins and use setElementDatas for the mute. If you need further help, feel free to ask here. Link to comment
itHyperoX Posted March 13, 2017 Author Share Posted March 13, 2017 I want to create this script with timer, so i mute the player with like : /mute Patrik91 5 Test And when the 5 minutes gone, unmute the player Link to comment
NeXuS™ Posted March 13, 2017 Share Posted March 13, 2017 Use a setTimer with a 60000ms interval to decrease everyone's mute time by 1. Link to comment
Fist Posted March 13, 2017 Share Posted March 13, 2017 12 minutes ago, TheMOG said: I want to create this script with timer, so i mute the player with like : /mute Patrik91 5 Test And when the 5 minutes gone, unmute the player not tested but should work. to mute use /pmute player minutes reason addCommandHandler("pmute",function(source,cmd,player,minutes,reason) local target = getPlayerFromName(player); if (target) then if not isPlayerMuted(target) then setPlayerMuted(target,true) outputChatBox("player "..player.." has been muted by "..getPlayerName(source).." (duration: "..minutes.." minutes) (reason: "..reason..")",root,255,0,0); setTimer(function() setPlayerMuted(target,false) outputChatBox("player's "..player.." mute has expired",root,255,0,0); end,tonumber(minutes)*60000,1) else outputChatBox("player is already muted",source,255,0,0); end end 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