itHyperoX Posted February 2, 2017 Share Posted February 2, 2017 (edited) Hello guys. I made a script, which is mute player for x minutes. The script is working, but not unmute the player after the timer. Here is the script: addCommandHandler("muteplayer", function(player, cmd, name, minutes, ...) if (tonumber(getElementData(player, "account:admin")) >= 2) then local message = table.concat({ ... }, " ") if name and minutes then if tonumber(minutes) then if tonumber(minutes) > 0 then local target = exports.serverExport:findPlayer(name, player) if target then if message and #message > 0 then outputChatBox("#DC143C[Mute]:#7CC576 "..getPlayerName(target).." #ffffff has been muted by #7CC576"..getPlayerName(player).."#ffffff. #7CC576("..minutes.." Minutes)", cRoot, 255, 0, 0, true) outputChatBox("#DC143C[Mute]:#7CC576 Reason:#ffffff "..tostring(message), cRoot, 255, 0, 0, true) setPlayerMuted(target, true) setPlayerMuted(target, true, false, true, player, message, minutes * 60) else outputChatBox("#DC143C[Mute]:#6CB8FD "..getPlayerName(target).."#ffffff has been muted by #6CB8FD"..getPlayerName(player).."#ffffff. #7CC576("..minutes.." Minutes)", cRoot, 255, 0, 0, true) setPlayerMuted(target, true) setPlayerMuted(target, true, false, true, player, nil, minutes * 60) -- if no reason end else outputChatBox("Player not found.", player, 255, 0, 0, true) end else end else outputChatBox("Only numbers", player, 255, 0, 0, true) end else outputChatBox("/" ..cmd .. " [Player] [Minutes] [Reason]", player, 220, 220, 0, true) end else outputChatBox("You dont have permission.", player, 255, 255, 255,true) end end ) Whats the problem? Thanks any help! Edited February 2, 2017 by TheMOG Link to comment
Hoffmann Posted February 2, 2017 Share Posted February 2, 2017 setTimer(setPlayerMuted, minutes*60000, 1, target, false) setPlayerMuted has only two arguments. Look https://wiki.multitheftauto.com/wiki/SetPlayerMuted So you have to make unmute with timer yourself. 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