-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
local mute = TalkAction("/mute") | ||
|
||
function mute.onSay(player, words, param) | ||
-- create log | ||
logCommand(player, words, param) | ||
|
||
if param == "" then | ||
player:sendCancelMessage("You must specify a player. Usage: /mute playerName.") | ||
return true | ||
end | ||
|
||
local split = param:split(",") | ||
local targetName = split[1]:trim() | ||
local target = Player(targetName) | ||
|
||
if not target then | ||
player:sendCancelMessage("A player with that name is not online.") | ||
return true | ||
end | ||
|
||
if target:getGroup():getId() >= GROUP_TYPE_GAMEMASTER then | ||
player:sendCancelMessage("You cannot mute this character.") | ||
return true | ||
end | ||
|
||
target:setFeature(Features.MutePlayer, 1) | ||
player:popupFYI(target:getName() .. " has been muted.") | ||
return true | ||
end | ||
|
||
mute:separator(" ") | ||
mute:groupType("god") | ||
mute:register() | ||
|
||
-- Unmute player | ||
local unmute = TalkAction("/unmute") | ||
|
||
function unmute.onSay(player, words, param) | ||
-- create log | ||
logCommand(player, words, param) | ||
|
||
if param == "" then | ||
player:sendCancelMessage("You must specify a player. Usage: /unmute playerName.") | ||
return true | ||
end | ||
|
||
local targetName = param:trim() | ||
local target = Player(targetName) | ||
|
||
if not target then | ||
player:sendCancelMessage("A player with that name is not online.") | ||
return true | ||
end | ||
|
||
target:setFeature(Features.MutePlayer, 0) | ||
player:popupFYI(target:getName() .. " has been unmuted.") | ||
return true | ||
end | ||
|
||
unmute:separator(" ") | ||
unmute:groupType("god") | ||
unmute:register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters