ほぼ某Noob鯖で使用しているInsane Limitsのスクリプトです。
BFV終了のお知らせと共に新規プレイヤーが増えたため、そんなNoob様達を守るために作成しました。
仕様
- Joinで判定
- 合計キル数が100以上で評価開始 ※それまでの間はKPM0.9で制限
- K/D1.2以上でキック
- KD2以上のプレイヤーはWebhookに晒し投稿機能有り
- KD2以上、ランク110以上は永久BAN+Twitterに晒し投稿機能有り
- KD1.2以上なのにStats Resetでごまかすプレイヤーも永久BAN
※設定は変更可能です。
プレイ中にKDが設定値を超してしまうこともありますが、On Spawnにも同じコードを追加することにより次のラウンドでキックすることが可能です。
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
/* KD Limitter Ver.1.3 by DA-xx-V */ // evalution: On Join // first_check: Code // limit_action: none double limtiKdr = 1.2; double limitStartValue = 100; double limitKpm = 0.9; double trashKdr = 2; double trashRank = 110; double playerKpm= Math.Round(player.Kills / (player.Time / 60), 2, MidpointRounding.AwayFromZero); double playerKdr = Math.Round(player.Kills / player.Deaths, 2, MidpointRounding.AwayFromZero); string playerName = player.Name; string discordPlayerName = playerName.Replace("_", "\\_"); //double playerKillsDeaths = player.Kills + player.Deaths; bool tweet = false; bool webhook = false; string webhookUrl = "https://"; if (!player.RoundData.issetBool("Statschecked")) player.RoundData.setBool("Statschecked", false); if (player.RoundData.getBool("Statschecked")) return false; else { if (player.Kills >= limitStartValue && player.Role == 0) { if(playerKdr >= limtiKdr || player.Kdr >= limtiKdr) { if(playerKdr >= trashKdr || player.Kdr >= limtiKdr) { plugin.ConsoleWrite("[DAs Stats Limitter] " + player.Name + ", Trash Limitter."); if (webhook == true) { using(WebClient webClient = new WebClient()) { string str = webClient.DownloadString("http://battlelog.battlefield.com/bf4/user/" + player.Name +"/"); MatchCollection pid = Regex.Matches(str, @"/soldier/" + player.Name + @"/stats/(\d+)(/\w*)?/", RegexOptions.IgnoreCase | RegexOptions.Singleline); string personaId = ""; foreach (Match m in pid) { if (m.Success && m.Groups[2].Value.Trim() != "/ps3" && m.Groups[2].Value.Trim() != "/xbox" && m.Groups[2].Value.Trim() != "/xbox360" && m.Groups[2].Value.Trim() != "/xboxone" && m.Groups[2].Value.Trim() != "/ps4") { personaId = m.Groups[1].Value.Trim(); } } string battlelogLink = "https://battlelog.battlefield.com/bf4/ja/user/" + player.Name; string bf4dblink = "https://bf4db.com/player/" + personaId; WebRequest request = WebRequest.Create(webhookUrl); request.Method = "POST"; request.ContentType = "application/json"; string webhookString = "{\"username\": \"PRoCon\", \"avatar_url\": \"https:\\/\\/avatars1.githubusercontent.com\\/u\\/1633311\", \"content\": \"**```diff\\n- New report -```**\\n**Report for server:** " + server.Name + "\\n**Reported from:** Stats checker" +"\\n**Reported player tag:** " + player.Tag + "\\n**Reported player:** " + discordPlayerName + "\\n**Reason:** High KDR " + playerKdr + "\\n**Battlelog:** "+ battlelogLink + "\\n**BF4DB:** " + bf4dblink + "\"}"; byte[] byteArray = Encoding.UTF8.GetBytes(webhookString); request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); } } } if (player.Rank >= trashRank && playerKdr >= trashKdr || player.Kdr == 0) { plugin.SendGlobalMessage("[DAs Stats Limitter] "+ player.Name + ", Banned by Stats Limitter... KDR / Limit " + playerKdr + " / " + limtiKdr); plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Permanent, player.Name, 0, player.Rank + " " + player.Name + ", Banned by Stats Limitter... Your KDR / Limit KDR " + playerKdr + " / " + limtiKdr); plugin.ConsoleWrite("[DAs Stats Limitter] " + player.Name + ", Banned by Stats Limitter... KDR/Limit " + playerKdr + " / " + limtiKdr + " Rank: " + player.Rank); if(tweet == true) { plugin.Tweet(player.Name + ", Banned by Stats Limitter... KDR/Limit " + playerKdr + " / " + limtiKdr); } } else { plugin.SendGlobalMessage("[DAs Stats Limitter] "+ player.Name + ", Kicked by Stats Limitter... KDR / Limit " + playerKdr + " / " + limtiKdr); plugin.KickPlayerWithMessage(player.Name, player.Rank + " " + player.Name + ", Kicked by Stats Limitter... Your KDR / Limit KDR " + playerKdr + " / " + limtiKdr); plugin.ConsoleWrite("[DAs Stats Limitter] " + player.Name + ", Kicked by Stats Limitter... KDR/Limit " + playerKdr + " / " + limtiKdr + " Rank: " + player.Rank); if(tweet == true) { plugin.Tweet(player.Name + ", Kicked by Stats Limitter... KDR/Limit " + playerKdr + " / " + limtiKdr); } } } } else if (player.Kills < limitStartValue && playerKpm >= limitKpm && player.Role == 0) { plugin.SendGlobalMessage("[DAs Stats Limitter] "+ player.Name + ", Kicked by Stats Limitter... KPM / Limit " + playerKdr + " / " + limtiKdr); plugin.KickPlayerWithMessage(player.Name, player.Rank + " " + player.Name + ", Kicked by Stats Limitter... KPM / Limit " + playerKdr + " / " + limtiKdr); plugin.ConsoleWrite("[DAs Stats Limitter] " + player.Name + ", Kicked by Stats Limitter... KPM / Limit " + playerKdr + " / " + limtiKdr + " Rank: " + player.Rank); } } player.RoundData.setBool("Statschecked", true); |