ImportBot Posted March 29, 2016 Author Share Posted March 29, 2016 Originally Posted by El-aFreak*: Where exactly? This code line is more than once ^^ and yes i mean that. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 29, 2016 Author Share Posted March 29, 2016 Originally Posted by Grovax*: @El$aFreak: Thats are many lines Code#2 Line 84,90,96,102 for Sniperlimit > TeamSay > (xx) name has lost his SNIPER/DMR slot! Line 86,92,98,104 for Sniperlimit > PlayerYell[10] > name > You have lost your SNIPER/DMR slot! Line 118 for Sniperlimit > TeamSay > (xx) name has now a SNIPER/DMR Slot! (x/x) Line 120 for Sniperlimit > PlayerYell[10] > name > You have now a SNIPER/DMR slot! (x/x) Line 131 for Sniperlimit > PlayerSay/Yell[10] > name > You are killed by SNIPER/DMR LIMIT! Warning (x/x) Type !sinfo for more information * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 29, 2016 Author Share Posted March 29, 2016 Originally Posted by El-aFreak*: moment... * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 29, 2016 Author Share Posted March 29, 2016 Originally Posted by Grovax*: thats a wrong line, you can only deactivate the called lines in my last post. all others are ingame messages PS: all proconchatframework messages start with plugin.PRoConChat * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 29, 2016 Author Share Posted March 29, 2016 Originally Posted by El-aFreak*: Yes, I saw the bug, but I tried now in line 118 //plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")"; privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")"; plugin.SendTeamMessage(killer.TeamId, globalMessage); Line 118 //plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); return false; It still shows the chat on left top that they get slots? What did I wrong? ^^ * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 29, 2016 Author Share Posted March 29, 2016 Originally Posted by Grovax*: original: Code: globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")"; privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")"; plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); new:Code: globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")"; privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")"; plugin.SendTeamMessage(killer.TeamId, globalMessage); [b]//[/b]plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); [b]//[/b]plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage);the player get the message but you dont see it at procon * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 30, 2016 Author Share Posted March 30, 2016 Originally Posted by El-aFreak*: Unfortunately that does not work. I exactly pasted this with // in Line 118 & 120, but it still shows in chat that someone has a SNIPER/DMR Slot. 22:40:14] Sniperlimit > PlayerSay > Slot (1/8) is SubUrbanSouljah [22:40:14] Sniperlimit > PlayerSay > Slot (2/8) is MonoStereoAudio * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 30, 2016 Author Share Posted March 30, 2016 Originally Posted by steep100*: Good day. Can I change the script so that he was off for the mode Gunmaster,on our server the plugin Votemap and mixed maplist(rush,conquest,TDM,domination,destruction,c apture the flag,carrier assault and the GM) * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 30, 2016 Author Share Posted March 30, 2016 Originally Posted by Grovax*: Good day. Can I change the script so that he was off for the mode Gunmaster,on our server the plugin Votemap and mixed maplist(rush,conquest,TDM,domination,destruction,c apture the flag,carrier assault and the GM)Add this code in CODE#2, CODE#3 and CODE#4 at line 1 Code: if (Regex.Match(server.Gamemode, @"(GunMaster)").Success) { return false; } * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 30, 2016 Author Share Posted March 30, 2016 Originally Posted by steep100*: Add this code in CODE#2, CODE#3 and CODE#4 at line 1 Code: if (Regex.Match(server.Gamemode, @"(Gunmaster0)").Success) { return false; } (((Dont work * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 30, 2016 Author Share Posted March 30, 2016 Originally Posted by Grovax*: try the new code @ last post * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 2, 2016 Author Share Posted April 2, 2016 Originally Posted by steep100*: try the new code @ last post(( dont work * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 3, 2016 Author Share Posted April 3, 2016 Originally Posted by Grovax*: (( dont workthen you add it to the wrong place, this code must work. first line on all codes * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 4, 2016 Author Share Posted April 4, 2016 Originally Posted by steep100*: then you add it to the wrong place, this code must work. first line on all codes // Insane Limits - Sniperlimit by Grovax v1.5 if (Regex.Match(server.Gamemode, @"(Gunmaster0)").Success) { return false; } // Set max. snipers/dmrs each team int maxSnipers = 3; // Set kills for timeban // Info: at 3 the user get 2 warnings before being timebanned int warnKick = 2; // ReservedSlots Player can use sr/dmr without sniperslot // 0 = not allowed | 1 = allowed int vipAllowed = 1; // Admins can use sr/dmr without sniperslot // 0 = not allowed | 1 = allowed int adminAllowed = 1; // Certain players can use sr/dmr without sniperslot // For activate remove slashes in the next two rows and insert playername without clantags //bool playerAllowed = (Regex.Match(kill.Name, @"(_:biggrin:GV130)" , RegexOptions.IgnoreCase).Success); //if (playerAllowed) return false; // Set (main) allowed weapons and weaponcategory bool sniperLimit = (kill.Category == "SniperRifle" || kill.Category == "DMR"); // Set (second) allowed weapons and weaponcategory bool sniperAllowed = (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee" || Regex.Match(kill.Weapon, @"(_:Shorty)").Success); // Allowed all vehicles bool vehiclesAllowed = (Regex.Match(kill.Weapon, @"(_:biggrin:eath|Roadkill|AMTRAC|Vehicle|Jeep|Growler|MRAP|Bug gy|Venom|APC|Anti-Air|PGZ-95|HIMARS|MBT|Tank|Jet|Heli|AC-130|Lancer|Xian|Global|CB90|DV-15|RHIB|Bird)", RegexOptions.IgnoreCase).Success); // Dont edit if (vipAllowed == 1) { List ReservervedSlots = plugin.GetReservedSlotsList(); if (ReservervedSlots.Contains(killer.Name)) return false; } if (adminAllowed == 1) { bool isAdmin = false; bool bKill = false; bool bKick = false; bool bBan = false; bool bMove = false; bool bLevel = false; if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel)) { if (bKill && bKick && bBan) return false; } } String globalMessage = null; String globalMessage2 = null; String privateMessage = null; String playerKey = "sl_" + killer.Name; String factionName = null; int warnings = 0; int countSnipers = 0; if (plugin.RoundData.issetInt(playerKey)) warnings = plugin.RoundData.getInt(playerKey); if (!plugin.RoundData.issetInt("sniperSlots")) plugin.RoundData.setInt("sniperSlots", maxSnipers); if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List()); if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List()); List sniperTeam1 = (List)plugin.RoundData.getObject("slEntrie s1"); List sniperTeam2 = (List)plugin.RoundData.getObject("slEntrie s2"); if (killer.TeamId == 1) countSnipers = sniperTeam1.Count; else if (killer.TeamId == 2) countSnipers = sniperTeam2.Count; if (server.GetFaction(player.TeamId) == 0) factionName = "US"; else if (server.GetFaction(player.TeamId) == 1) factionName = "RU"; else if (server.GetFaction(player.TeamId) == 2) factionName = "CN"; if (sniperTeam1.Contains(killer.Name) || sniperTeam2.Contains(killer.Name)) { if (!sniperLimit && !sniperAllowed && !vehiclesAllowed) { globalMessage = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (used "+ plugin.FriendlyWeaponName(kill.Weapon).Name + ")"; globalMessage2 = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (change team)"; privateMessage = "You have lost your SNIPER/DMR slot!"; if (killer.TeamId == 1 && sniperTeam1.Contains(killer.Name)) { sniperTeam1.Remove(killer.Name); plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 1 && sniperTeam2.Contains(killer.Name)) { sniperTeam2.Remove(killer.Name); plugin.SendTeamMessage(2, globalMessage2); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 2 && sniperTeam2.Contains(killer.Name)) { sniperTeam2.Remove(killer.Name); plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 2 && sniperTeam1.Contains(killer.Name)) { sniperTeam1.Remove(killer.Name); plugin.SendTeamMessage(1, globalMessage2); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } return false; } return false; } else if (sniperLimit) { if (countSnipers if (killer.TeamId == 1) sniperTeam1.Add(killer.Name); else if (killer.TeamId == 2) sniperTeam2.Add(killer.Name); countSnipers += 1; warnings = 0; globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")"; privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")"; plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); return false; } else { if (limit.Activations(killer.Name, TimeSpan.FromSeconds(2)) > 1) return false; warnings += 1; plugin.RoundData.setInt(playerKey, warnings); if (warnings privateMessage = "You are killed by SNIPER/DMR LIMIT! Warning (" + warnings + "/" + warnKick +") Type !sinfo for more information"; plugin.SendPlayerMessage(killer.Name, privateMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.KillPlayer(killer.Name, 1); plugin.PRoConChat("Sniperlimit > PlayerSay/Yell[10] > " + killer.Name + " > " + privateMessage); return false; } else if (warnings == warnKick) { globalMessage = "Timeban for ignoring warnings of SNIPER/DMR LIMIT!"; plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 20, globalMessage); return false; } } } return false; This is my code * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 4, 2016 Author Share Posted April 4, 2016 Originally Posted by Grovax*: Thats not correct, you must use the code of this post: myrcon.net/...insane-limits-sniperlimit#entry51480 * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 5, 2016 Author Share Posted April 5, 2016 Originally Posted by steep100*: Thats not correct, you must use the code of this post: myrcon.net/...insane-limits-sniperlimit#entry51480OK I will try this code. Another question,how to enable whitelist players? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 5, 2016 Author Share Posted April 5, 2016 Originally Posted by Grovax*: OK I will try this code. Another question,how to enable whitelist players?you can use this code @ Code#2 Code: // Certain players can use sr/dmr without sniperslot // For activate remove slashes in the next two rows and insert playername without clantags //bool playerAllowed = (Regex.Match(kill.Name, @"(_:Playername1|Playername2|Playername3)", RegexOptions.IgnoreCase).Success); //if (playerAllowed) return false;when you use the insane limits whitelist then replace this code with Code: //Whitelist if (plugin.isInWhitelist(player.Name)) return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 5, 2016 Author Share Posted April 5, 2016 Originally Posted by steep100*: OK I will try this code. but sniper limit still work in gunmaster((( // Insane Limits - Sniperlimit by Grovax v1.5 if (Regex.Match(server.Gamemode, @"(Gunmaster0)").Success) { return false; } // Set max. snipers/dmrs each team int maxSnipers = 3; // Set kills for timeban // Info: at 3 the user get 2 warnings before being timebanned int warnKick = 2; // ReservedSlots Player can use sr/dmr without sniperslot // 0 = not allowed | 1 = allowed int vipAllowed = 1; // Admins can use sr/dmr without sniperslot // 0 = not allowed | 1 = allowed int adminAllowed = 1; // Certain players can use sr/dmr without sniperslot // For activate remove slashes in the next two rows and insert playername without clantags //bool playerAllowed = (Regex.Match(kill.Name, @"(_:biggrin:GV130)" , RegexOptions.IgnoreCase).Success); //if (playerAllowed) return false; // Set (main) allowed weapons and weaponcategory bool sniperLimit = (kill.Category == "SniperRifle" || kill.Category == "DMR"); // Set (second) allowed weapons and weaponcategory bool sniperAllowed = (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee" || Regex.Match(kill.Weapon, @"(_:Shorty)").Success); // Allowed all vehicles bool vehiclesAllowed = (Regex.Match(kill.Weapon, @"(_:biggrin:eath|Roadkill|AMTRAC|Vehicle|Jeep|Growler|MRAP|Bug gy|Venom|APC|Anti-Air|PGZ-95|HIMARS|MBT|Tank|Jet|Heli|AC-130|Lancer|Xian|Global|CB90|DV-15|RHIB|Bird)", RegexOptions.IgnoreCase).Success); // Dont edit if (vipAllowed == 1) { List ReservervedSlots = plugin.GetReservedSlotsList(); if (ReservervedSlots.Contains(killer.Name)) return false; } if (adminAllowed == 1) { bool isAdmin = false; bool bKill = false; bool bKick = false; bool bBan = false; bool bMove = false; bool bLevel = false; if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel)) { if (bKill && bKick && bBan) return false; } } String globalMessage = null; String globalMessage2 = null; String privateMessage = null; String playerKey = "sl_" + killer.Name; String factionName = null; int warnings = 0; int countSnipers = 0; if (plugin.RoundData.issetInt(playerKey)) warnings = plugin.RoundData.getInt(playerKey); if (!plugin.RoundData.issetInt("sniperSlots")) plugin.RoundData.setInt("sniperSlots", maxSnipers); if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List()); if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List()); List sniperTeam1 = (List)plugin.RoundData.getObject("slEntrie s1"); List sniperTeam2 = (List)plugin.RoundData.getObject("slEntrie s2"); if (killer.TeamId == 1) countSnipers = sniperTeam1.Count; else if (killer.TeamId == 2) countSnipers = sniperTeam2.Count; if (server.GetFaction(player.TeamId) == 0) factionName = "US"; else if (server.GetFaction(player.TeamId) == 1) factionName = "RU"; else if (server.GetFaction(player.TeamId) == 2) factionName = "CN"; if (sniperTeam1.Contains(killer.Name) || sniperTeam2.Contains(killer.Name)) { if (!sniperLimit && !sniperAllowed && !vehiclesAllowed) { globalMessage = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (used "+ plugin.FriendlyWeaponName(kill.Weapon).Name + ")"; globalMessage2 = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (change team)"; privateMessage = "You have lost your SNIPER/DMR slot!"; if (killer.TeamId == 1 && sniperTeam1.Contains(killer.Name)) { sniperTeam1.Remove(killer.Name); plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 1 && sniperTeam2.Contains(killer.Name)) { sniperTeam2.Remove(killer.Name); plugin.SendTeamMessage(2, globalMessage2); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 2 && sniperTeam2.Contains(killer.Name)) { sniperTeam2.Remove(killer.Name); plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 2 && sniperTeam1.Contains(killer.Name)) { sniperTeam1.Remove(killer.Name); plugin.SendTeamMessage(1, globalMessage2); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } return false; } return false; } else if (sniperLimit) { if (countSnipers if (killer.TeamId == 1) sniperTeam1.Add(killer.Name); else if (killer.TeamId == 2) sniperTeam2.Add(killer.Name); countSnipers += 1; warnings = 0; globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")"; privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")"; plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); return false; } else { if (limit.Activations(killer.Name, TimeSpan.FromSeconds(2)) > 1) return false; warnings += 1; plugin.RoundData.setInt(playerKey, warnings); if (warnings privateMessage = "You are killed by SNIPER/DMR LIMIT! Warning (" + warnings + "/" + warnKick +") Type !sinfo for more information"; plugin.SendPlayerMessage(killer.Name, privateMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.KillPlayer(killer.Name, 1); plugin.PRoConChat("Sniperlimit > PlayerSay/Yell[10] > " + killer.Name + " > " + privateMessage); return false; } else if (warnings == warnKick) { globalMessage = "Timeban for ignoring warnings of SNIPER/DMR LIMIT!"; plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 20, globalMessage); return false; } } } return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 5, 2016 Author Share Posted April 5, 2016 Originally Posted by Grovax*: you still using the wrong code, use the last posted code for gunmaster * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 6, 2016 Author Share Posted April 6, 2016 Originally Posted by steep100*: My code if (Regex.Match(server.Gamemode, @"(Gunmaster0)").Success) { return false; } Your code if (Regex.Match(server.Gamemode, @"(GunMaster)").Success) { return false; } how do they differ? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 6, 2016 Author Share Posted April 6, 2016 Originally Posted by Grovax*: there are two gunmaster modes, GunMaster0 and GunMaster1. the second command looking for "GunMaster" * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 6, 2016 Author Share Posted April 6, 2016 Originally Posted by ColColonCleaner*: In other words it just looks for GunMaster, regardless of the number afterwards, it matches both GunMaster1 and GunMaster0. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 6, 2016 Author Share Posted April 6, 2016 Originally Posted by Grovax*: Thanks ColColonCleaner * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 7, 2016 Author Share Posted April 7, 2016 Originally Posted by steep100*: Thats not correct, you must use the code of this post: myrcon.net/...insane-limits-sniperlimit#entry51480 // Insane Limits - Sniperlimit by Grovax v1.5 if (Regex.Match(server.Gamemode, @"(Gunmaster)").Success) { return false; } // Set max. snipers/dmrs each team int maxSnipers = 3; // Set kills for timeban // Info: at 3 the user get 2 warnings before being timebanned int warnKick = 2; // ReservedSlots Player can use sr/dmr without sniperslot // 0 = not allowed | 1 = allowed int vipAllowed = 1; // Admins can use sr/dmr without sniperslot // 0 = not allowed | 1 = allowed int adminAllowed = 1; //Whitelist if (plugin.isInWhitelist(player.Name)) return false;; // Set (main) allowed weapons and weaponcategory bool sniperLimit = (kill.Category == "SniperRifle" || kill.Category == "DMR"); // Set (second) allowed weapons and weaponcategory bool sniperAllowed = (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee" || Regex.Match(kill.Weapon, @"(_:Shorty)").Success); // Allowed all vehicles bool vehiclesAllowed = (Regex.Match(kill.Weapon, @"(_:biggrin:eath|Roadkill|AMTRAC|Vehicle|Jeep|Growler|MRAP|Bug gy|Venom|APC|Anti-Air|PGZ-95|HIMARS|MBT|Tank|Jet|Heli|AC-130|Lancer|Xian|Global|CB90|DV-15|RHIB|Bird)", RegexOptions.IgnoreCase).Success); // Dont edit if (vipAllowed == 1) { List ReservervedSlots = plugin.GetReservedSlotsList(); if (ReservervedSlots.Contains(killer.Name)) return false; } if (adminAllowed == 1) { bool isAdmin = false; bool bKill = false; bool bKick = false; bool bBan = false; bool bMove = false; bool bLevel = false; if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel)) { if (bKill && bKick && bBan) return false; } } String globalMessage = null; String globalMessage2 = null; String privateMessage = null; String playerKey = "sl_" + killer.Name; String factionName = null; int warnings = 0; int countSnipers = 0; if (plugin.RoundData.issetInt(playerKey)) warnings = plugin.RoundData.getInt(playerKey); if (!plugin.RoundData.issetInt("sniperSlots")) plugin.RoundData.setInt("sniperSlots", maxSnipers); if (!plugin.RoundData.issetObject("slEntries1")) plugin.RoundData.setObject("slEntries1", new List()); if (!plugin.RoundData.issetObject("slEntries2")) plugin.RoundData.setObject("slEntries2", new List()); List sniperTeam1 = (List)plugin.RoundData.getObject("slEntrie s1"); List sniperTeam2 = (List)plugin.RoundData.getObject("slEntrie s2"); if (killer.TeamId == 1) countSnipers = sniperTeam1.Count; else if (killer.TeamId == 2) countSnipers = sniperTeam2.Count; if (server.GetFaction(player.TeamId) == 0) factionName = "US"; else if (server.GetFaction(player.TeamId) == 1) factionName = "RU"; else if (server.GetFaction(player.TeamId) == 2) factionName = "CN"; if (sniperTeam1.Contains(killer.Name) || sniperTeam2.Contains(killer.Name)) { if (!sniperLimit && !sniperAllowed && !vehiclesAllowed) { globalMessage = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (used "+ plugin.FriendlyWeaponName(kill.Weapon).Name + ")"; globalMessage2 = "(" + factionName + ") " + killer.Name + " has lost his SNIPER/DMR slot! (change team)"; privateMessage = "You have lost your SNIPER/DMR slot!"; if (killer.TeamId == 1 && sniperTeam1.Contains(killer.Name)) { sniperTeam1.Remove(killer.Name); plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 1 && sniperTeam2.Contains(killer.Name)) { sniperTeam2.Remove(killer.Name); plugin.SendTeamMessage(2, globalMessage2); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 2 && sniperTeam2.Contains(killer.Name)) { sniperTeam2.Remove(killer.Name); plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } else if (killer.TeamId == 2 && sniperTeam1.Contains(killer.Name)) { sniperTeam1.Remove(killer.Name); plugin.SendTeamMessage(1, globalMessage2); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage2); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); } return false; } return false; } else if (sniperLimit) { if (countSnipers if (killer.TeamId == 1) sniperTeam1.Add(killer.Name); else if (killer.TeamId == 2) sniperTeam2.Add(killer.Name); countSnipers += 1; warnings = 0; globalMessage = "(" + factionName + ") " + killer.Name + " has now a SNIPER/DMR Slot! (" + countSnipers + "/" + maxSnipers + ")"; privateMessage = "You have now a SNIPER/DMR slot! (" + countSnipers + "/" + maxSnipers + ")"; plugin.SendTeamMessage(killer.TeamId, globalMessage); plugin.PRoConChat("Sniperlimit > TeamSay > " + globalMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.PRoConChat("Sniperlimit > PlayerYell[10] > " + killer.Name + " > " + privateMessage); return false; } else { if (limit.Activations(killer.Name, TimeSpan.FromSeconds(2)) > 1) return false; warnings += 1; plugin.RoundData.setInt(playerKey, warnings); if (warnings privateMessage = "You are killed by SNIPER/DMR LIMIT! Warning (" + warnings + "/" + warnKick +") Type !sinfo for more information"; plugin.SendPlayerMessage(killer.Name, privateMessage); plugin.SendPlayerYell(killer.Name, privateMessage, 10); plugin.KillPlayer(killer.Name, 1); plugin.PRoConChat("Sniperlimit > PlayerSay/Yell[10] > " + killer.Name + " > " + privateMessage); return false; } else if (warnings == warnKick) { globalMessage = "Timeban for ignoring warnings of SNIPER/DMR LIMIT!"; plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 20, globalMessage); return false; } } } return false; This code not work in ganmaster * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 9, 2016 Author Share Posted April 9, 2016 Originally Posted by Grovax*: test this line: Code: if (Regex.Match(server.Gamemode, @"(Gunmaster0|Gunmaster1)").Success) return false;if that does not work. then i have no idea * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 9, 2016 Author Share Posted April 9, 2016 Originally Posted by Chilace*: test this line: Code: if (Regex.Match(server.Gamemode, @"(Gunmaster0|Gunmaster1)").Success) return false;if that does not work. then i have no idea Maybe it would be better to ignore the case?Code: if (Regex.Match(server.Gamemode, @"(GunMaster0|GunMaster1)", RegexOptions.IgnoreCase).Success) return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 10, 2016 Author Share Posted April 10, 2016 Originally Posted by steep100*: GunMaster0|GunMaster1-this is GM presets? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 10, 2016 Author Share Posted April 10, 2016 Originally Posted by Grovax*: -this is GM presets?no, thats are Gamemodes * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 11, 2016 Author Share Posted April 11, 2016 Originally Posted by steep100*: if (Regex.Match(server.Gamemode, @"(GunMaster0|GunMaster1)", RegexOptions.IgnoreCase).Success) return false;This script work fine, thank you man!!! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 11, 2016 Author Share Posted April 11, 2016 Originally Posted by Grovax*: Very good * Restored post. It could be that the author is no longer active. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.