Делаем через Insane limits.
Mute/Unmute Player без Adkats - Limit 1 of 2
Создайте новый лимит evluation - OnAnyChat.
В first_check указываем Code:
Mute/Unmute Player без Adkats - Limit 2 of 2
Создаем новый лимит evaluate -OnJoin.
В first_check указываем Code:
Судя по описанию работает следующим образом. Основные комманды !mute (никнейм) (причина), !unmute. Можно не указывать причину, по умолчанию причина будет указана СПАМ. Если вы "замутили" игрока при каждом его сообщении его будет автоматически убивать с надписью "вы убиты за спам" на английском. После окончания раунда список обнуляется. Перевод сообщений не делал, кому нада переведете. Пробуем отписумся о результатах
Mute/Unmute Player без Adkats - Limit 1 of 2
Создайте новый лимит evluation - OnAnyChat.
В first_check указываем Code:
// Mute/Unmute without AdKats (for GR101) - Limit 1 of 2
// v1.3 - OnAnyChat - first_check
//
// Variables
Dictionary<String, bool> muList = null;
String sv_muList = "_MUTED_PLAYERS_";
String[] cmdLn = new String[3];
PlayerInfoInterface muPlayer;
bool muState = false;
String[] logMsgs = { "^b^1Mute^0^n: ",
"^b^1Unmute^0^n: ",
"Mute: ",
"Unmute: ",
" has been ",
"muted by ",
"unmuted by ",
" for " };
bool isAdmin = false;
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;
// Code
if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
{
if (bKill && bKick && bBan) isAdmin = true;
}
if (server.RoundData.issetObject(sv_muList))
{
muList = (Dictionary<String, bool>)server.RoundData.getObject(sv_muList);
}
else
{
muList = new Dictionary<String, bool>();
}
if (isAdmin)
{
if (!plugin.IsInGameCommand(player.LastChat)) return false;
cmdLn[0] = plugin.ExtractInGameCommand(player.LastChat);
if ((cmdLn[0].Length != 0) && (plugin.ExtractCommandPrefix(cmdLn[0]).Length != 0)) cmdLn[0] = plugin.ExtractInGameCommand(cmdLn[0]);
if (null == cmdLn[0] || cmdLn[0].Length == 0) return false;
if (!Regex.Match(cmdLn[0], @"^\b(MUTE|UNMUTE)\b", RegexOptions.IgnoreCase).Success) return false;
if (cmdLn[0].IndexOf(" ") > 0)
{
cmdLn[1] = cmdLn[0].Remove(0, cmdLn[0].IndexOf(" ")).Trim();
cmdLn[0] = cmdLn[0].Substring(0, cmdLn[0].IndexOf(" ")).ToLower().Trim();
if (cmdLn[0] == "mute" && cmdLn[1].IndexOf(" ") <= 0)
{
cmdLn[2] = "You\'re muted, further message spamming results in being killed or kicked, stop now!";
}
else if (cmdLn[0] == "mute" && cmdLn[1].IndexOf(" ") > 0)
{
cmdLn[2] = cmdLn[1].Remove(0, cmdLn[1].IndexOf(" ")).Trim();
cmdLn[1] = cmdLn[1].Substring(0, cmdLn[1].IndexOf(" ")).Trim();
}
else if (cmdLn[0] != "unmute")
{
plugin.SendPlayerMessage(player.Name, "ERROR: Too many arguments!");
return false;
}
}
else
{
plugin.SendPlayerMessage(player.Name, "ERROR: Missing argument(s)!");
return false;
}
muPlayer = plugin.GetPlayer(cmdLn[1], true);
if ((muPlayer == null) || (!Regex.Match(muPlayer.Name, @"^" + cmdLn[1], RegexOptions.IgnoreCase).Success))
{
plugin.SendPlayerMessage(player.Name, "ERROR: Player does not exist!");
return false;
}
cmdLn[1] = muPlayer.Name;
switch (cmdLn[0])
{
case "mute":
if (muList.ContainsKey(cmdLn[1]))
{
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " is already muted!");
return false;
}
muList.Add(cmdLn[1], false);
plugin.SendPlayerYell(cmdLn[1], "\n" + cmdLn[2], 8);
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " has been muted!");
logMsgs[0] = logMsgs[0] + cmdLn[1] + logMsgs[4] + logMsgs[5] + player.Name + logMsgs[7] + cmdLn[2];
logMsgs[2] = logMsgs[2] + cmdLn[1] + logMsgs[4] + logMsgs[5] + player.Name + logMsgs[7] + cmdLn[2];
plugin.ConsoleWrite(logMsgs[0]);
plugin.PRoConChat(logMsgs[0]);
plugin.PRoConEvent(logMsgs[2], "Insane Limits");
break;
case "unmute":
if (!muList.ContainsKey(cmdLn[1]))
{
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " is not muted!");
return false;
}
muList.Remove(cmdLn[1]);
plugin.SendPlayerYell(cmdLn[1], "\nYou are now unmuted!", 5);
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " has been unmuted!");
logMsgs[1] = logMsgs[1] + cmdLn[1] + logMsgs[4] + logMsgs[6] + player.Name;
logMsgs[3] = logMsgs[3] + cmdLn[1] + logMsgs[4] + logMsgs[6] + player.Name;
plugin.ConsoleWrite(logMsgs[1]);
plugin.PRoConChat(logMsgs[1]);
plugin.PRoConEvent(logMsgs[3], "Insane Limits");
break;
}
server.RoundData.setObject(sv_muList, muList);
}
else
{
if (muList.ContainsKey(player.Name))
{
muState = muList[player.Name];
if (muState)
{
if (player.Role > 0)
{
plugin.SendPlayerYell(player.Name, "\nYou\'re muted, further message spamming results in being kicked, stop now!", 8);
}
else
{
plugin.SendPlayerYell(player.Name, "\nYou\'re muted, further message spamming results in being killed, stop now!", 8);
}
muList[player.Name] = false;
server.RoundData.setObject(sv_muList, muList);
}
else
{
if (player.Role > 0)
{
plugin.KickPlayerWithMessage(player.Name, "Talking excessively while muted!");
}
else
{
plugin.SendPlayerYell(player.Name, "\nYou\'ve been muted due to excessive message spamming!", 8);
plugin.KillPlayer(player.Name);
}
}
}
}
return false;
// v1.3 - OnAnyChat - first_check
//
// Variables
Dictionary<String, bool> muList = null;
String sv_muList = "_MUTED_PLAYERS_";
String[] cmdLn = new String[3];
PlayerInfoInterface muPlayer;
bool muState = false;
String[] logMsgs = { "^b^1Mute^0^n: ",
"^b^1Unmute^0^n: ",
"Mute: ",
"Unmute: ",
" has been ",
"muted by ",
"unmuted by ",
" for " };
bool isAdmin = false;
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;
// Code
if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
{
if (bKill && bKick && bBan) isAdmin = true;
}
if (server.RoundData.issetObject(sv_muList))
{
muList = (Dictionary<String, bool>)server.RoundData.getObject(sv_muList);
}
else
{
muList = new Dictionary<String, bool>();
}
if (isAdmin)
{
if (!plugin.IsInGameCommand(player.LastChat)) return false;
cmdLn[0] = plugin.ExtractInGameCommand(player.LastChat);
if ((cmdLn[0].Length != 0) && (plugin.ExtractCommandPrefix(cmdLn[0]).Length != 0)) cmdLn[0] = plugin.ExtractInGameCommand(cmdLn[0]);
if (null == cmdLn[0] || cmdLn[0].Length == 0) return false;
if (!Regex.Match(cmdLn[0], @"^\b(MUTE|UNMUTE)\b", RegexOptions.IgnoreCase).Success) return false;
if (cmdLn[0].IndexOf(" ") > 0)
{
cmdLn[1] = cmdLn[0].Remove(0, cmdLn[0].IndexOf(" ")).Trim();
cmdLn[0] = cmdLn[0].Substring(0, cmdLn[0].IndexOf(" ")).ToLower().Trim();
if (cmdLn[0] == "mute" && cmdLn[1].IndexOf(" ") <= 0)
{
cmdLn[2] = "You\'re muted, further message spamming results in being killed or kicked, stop now!";
}
else if (cmdLn[0] == "mute" && cmdLn[1].IndexOf(" ") > 0)
{
cmdLn[2] = cmdLn[1].Remove(0, cmdLn[1].IndexOf(" ")).Trim();
cmdLn[1] = cmdLn[1].Substring(0, cmdLn[1].IndexOf(" ")).Trim();
}
else if (cmdLn[0] != "unmute")
{
plugin.SendPlayerMessage(player.Name, "ERROR: Too many arguments!");
return false;
}
}
else
{
plugin.SendPlayerMessage(player.Name, "ERROR: Missing argument(s)!");
return false;
}
muPlayer = plugin.GetPlayer(cmdLn[1], true);
if ((muPlayer == null) || (!Regex.Match(muPlayer.Name, @"^" + cmdLn[1], RegexOptions.IgnoreCase).Success))
{
plugin.SendPlayerMessage(player.Name, "ERROR: Player does not exist!");
return false;
}
cmdLn[1] = muPlayer.Name;
switch (cmdLn[0])
{
case "mute":
if (muList.ContainsKey(cmdLn[1]))
{
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " is already muted!");
return false;
}
muList.Add(cmdLn[1], false);
plugin.SendPlayerYell(cmdLn[1], "\n" + cmdLn[2], 8);
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " has been muted!");
logMsgs[0] = logMsgs[0] + cmdLn[1] + logMsgs[4] + logMsgs[5] + player.Name + logMsgs[7] + cmdLn[2];
logMsgs[2] = logMsgs[2] + cmdLn[1] + logMsgs[4] + logMsgs[5] + player.Name + logMsgs[7] + cmdLn[2];
plugin.ConsoleWrite(logMsgs[0]);
plugin.PRoConChat(logMsgs[0]);
plugin.PRoConEvent(logMsgs[2], "Insane Limits");
break;
case "unmute":
if (!muList.ContainsKey(cmdLn[1]))
{
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " is not muted!");
return false;
}
muList.Remove(cmdLn[1]);
plugin.SendPlayerYell(cmdLn[1], "\nYou are now unmuted!", 5);
plugin.SendPlayerMessage(player.Name, cmdLn[1] + " has been unmuted!");
logMsgs[1] = logMsgs[1] + cmdLn[1] + logMsgs[4] + logMsgs[6] + player.Name;
logMsgs[3] = logMsgs[3] + cmdLn[1] + logMsgs[4] + logMsgs[6] + player.Name;
plugin.ConsoleWrite(logMsgs[1]);
plugin.PRoConChat(logMsgs[1]);
plugin.PRoConEvent(logMsgs[3], "Insane Limits");
break;
}
server.RoundData.setObject(sv_muList, muList);
}
else
{
if (muList.ContainsKey(player.Name))
{
muState = muList[player.Name];
if (muState)
{
if (player.Role > 0)
{
plugin.SendPlayerYell(player.Name, "\nYou\'re muted, further message spamming results in being kicked, stop now!", 8);
}
else
{
plugin.SendPlayerYell(player.Name, "\nYou\'re muted, further message spamming results in being killed, stop now!", 8);
}
muList[player.Name] = false;
server.RoundData.setObject(sv_muList, muList);
}
else
{
if (player.Role > 0)
{
plugin.KickPlayerWithMessage(player.Name, "Talking excessively while muted!");
}
else
{
plugin.SendPlayerYell(player.Name, "\nYou\'ve been muted due to excessive message spamming!", 8);
plugin.KillPlayer(player.Name);
}
}
}
}
return false;
Создаем новый лимит evaluate -OnJoin.
В first_check указываем Code:
// Mute/Unmute without AdKats (for GR101) - Limit 2 of 2
// v1.3 - OnJoin - first_check
//
// Variables
Dictionary<String, bool> muList = null;
String sv_muList = "_MUTED_PLAYERS_";
// Code
if (server.RoundData.issetObject(sv_muList))
{
muList = (Dictionary<String, bool>)server.RoundData.getObject(sv_muList);
if (muList.ContainsKey(player.Name))
{
muList[player.Name] = true;
server.RoundData.setObject(sv_muList, muList);
}
}
return false;
// v1.3 - OnJoin - first_check
//
// Variables
Dictionary<String, bool> muList = null;
String sv_muList = "_MUTED_PLAYERS_";
// Code
if (server.RoundData.issetObject(sv_muList))
{
muList = (Dictionary<String, bool>)server.RoundData.getObject(sv_muList);
if (muList.ContainsKey(player.Name))
{
muList[player.Name] = true;
server.RoundData.setObject(sv_muList, muList);
}
}
return false;
Последнее редактирование: