Jump to content

Custom mute


itHyperoX

Recommended Posts

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

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