ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPlayerMuted

Function

setPlayerMuted

ServerPlayersIdentical to MTA:SA

Mutes or unmutes a player in chat.

Syntax

bool setPlayerMuted(player thePlayer, bool state)

Arguments

thePlayerplayer
The player.
statebool
true mutes.

Returns

true on success.

Example

addCommandHandler("mute", function(admin, cmd, name, minutes)
    local target = name and getPlayerFromName(name)
    if not target then return end
    setPlayerMuted(target, true)
    setTimer(function()
        if isElement(target) then setPlayerMuted(target, false) end
    end, (tonumber(minutes) or 5) * 60000, 1)
end)

See also