ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by QUACK-Major-Pain*: yeah i heard that issue with some of our members.. will try to scout some information for you bro... will let you know.Only fix - uninstall and reinstall.5+ hrs to download. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by Mootart*: This limit kills for RPG/SMAW/M320 on first violation, kicks on second violation, if player comes back, and uses it again one more time, player is banned. Set limit to evaluate OnKill, set action to None Set first_check to this Expression: Code: Regex.Match(kill.Weapon, @"(m320|smaw|rpg)", RegexOptions.IgnoreCase).SuccessSet second_check to this Code: Code: if (limit.Data.issetBool(player.Name)) { plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!")); plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); limit.Data.unsetBool(player.Name); } int count = (int) limit.Activations(player.Name); if (count == 1) { plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!")); plugin.KillPlayer(player.Name); } else if (count == 2) { plugin.SendGlobalMessage(plugin.R("%p_n% has been kicked for using %w_n%")); plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using %w_n%")); if (!limit.Data.issetBool(player.Name)) limit.Data.setBool(player.Name, true); } Hi micovery/papacharlie9 im using this limit for long time... i just want to ask how you change the code to kick by ea player name temporary 15mins i tried to change the plugin.PBBanPlayerWithMessage(PBBanDuration.Tempor ary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); to plugin.EaBanPlayerWithMessage(EaBanDuration.Tempor ary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); it doesnt work... can you help me? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by PapaCharlie9*: . - a limit that start a random map of an existing maplist.txt, after the daily server restart. I'll give this one a shot. It's not tested and probably has compilation errors. Since we don't have the full map list available (maybe in 0.9_), we have to use a brute force method of just running the next level a random number of times. You can set the maximum number of "run next level" commands in the first line of the second_check code, variable maxNextLevels. Set it to the number of maps in your map rotation. To determine if a server restart just happened, it uses a fairly lenient test of the total time up being less than 2 minutes and there being 0 or 1 players joined. You can make the test more strict by testing for the current map file name to see if it matches the first one in your map rotation, the current game mode likewise, etc. The interval is set to 60 seconds. If it takes your server longer to load up a level, increase the interval as needed. The interval should be +1 second more than the maximum amount of time it takes your server to load the biggest level (seems to be Grand Bazaar for some reason on our server). Set limit to evaluate OnIntervalServer. Set interval to 60. Set action to None. Set first_check to this Expression: Code: ( (server.TimeUp < 2*60 && server.PlayerCount < 2) || server.Data.issetInt("ango_random") )Set second_check to this Code: Code: int maxNextLevels = 10; // Change this to the number of maps in your rotation String kRandomized = "ango_random"; int randomLevels = -1; if (server.Data.issetInt(kRandomized)) randomLevels = server.Data.getInt(kRandomized); if (randomLevels == 0) { // We're done, forget the counter server.Data.unsetInt(kRandomized); plugin.ConsoleWrite("^b[Map Randomizer]^n: Done!"); return false; } else if (randomLevels == -1) { // Generate a random number Random rand = new Random(); randomLevels = rand.Next(maxNextLevels); plugin.ConsoleWrite("^b[Map Randomizer]^n: Active, will advance " + randomLevels + " levels"); } // Otherwise, we are still working on changing levels if (randomLevels > 0) { // Advance to the next level plugin.ServerCommand("mapList.runNextRound"); randomLevels -= 1; plugin.ConsoleWrite("^b[Map Randomizer]^n: Active, " + randomLevels + " levels remaining"); } // Remember the counter server.Data.setInt(kRandomized, randomLevels); return false;Note that a random number of 0 is possible and correct: it means start with the first map in the normal rotation. Your console may say something silly like, "Active, will advance 0 levels", but that's accurate. It's telling you that the normal first map will run. When the full map list is available from Insane Limits, remind me and I'll write up a real example that will be much more direct than this brute force method. Really, all I need is the length of the map list, I don't even need the actual map names. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by kayjay*: Quick question. Anyone here able to tell me if I can somehow change this line in "Rules on request" in order for it to display the rules to everyone instead of just the squad of the player requesting them? "plugin.SendSquadMessage(player.TeamId, player.SquadId, Rule);" Cheers * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by Bl1ndy*: Quick question. Anyone here able to tell me if I can somehow change this line in "Rules on request" in order for it to display the rules to everyone instead of just the squad of the player requesting them? "plugin.SendSquadMessage(player.TeamId, player.SquadId, Rule);" Cheers Try changing it to: plugin.SendGlobalMessage(Rule); * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by ango*: I'll give this one a shot. It's not tested and probably has compilation errors. ... Thx PapaCharlie9. I´ve tested the limit and its working.A liitle bit slowly, because ever map is loading, till the random number is ok. So we have to wait till a full maplist is available. Also every round of a map is counting for the random number. For example rush maps have two rounds (attacker, defender). * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by PapaCharlie9*: Also every round of a map is counting for the random number. For example rush maps have two rounds (attacker, defender).I wasn't sure whether the command did rounds or levels, looks like rounds. However, there is a fix, see below. To speed it up, try reducing the interval to 30 seconds. I wouldn't go much lower than that, though. In fact, Insane Limits won't let you. Here is a new version that should handle your two round rush maps correctly. I tested this, so I'm sure it will work. This is just the second_check code. The first_check is the same as before. In fact, I only added one line of code, the setNextMapIndex command. Code: int maxNextLevels = 10; // Change this to the number of maps in your rotation String kRandomized = "ango_random"; int randomLevels = -1; if (server.Data.issetInt(kRandomized)) randomLevels = server.Data.getInt(kRandomized); if (randomLevels == 0) { // We're done, forget the counter server.Data.unsetInt(kRandomized); plugin.ConsoleWrite("^b[Map Randomizer]^n: Done!"); return false; } else if (randomLevels == -1) { // Generate a random number Random rand = new Random(); randomLevels = rand.Next(maxNextLevels); plugin.ConsoleWrite("^b[Map Randomizer]^n: Active, will advance " + randomLevels + " levels"); } // Otherwise, we are still working on changing levels if (randomLevels > 0) { // Advance to the next level by setting the next map index plugin.ServerCommand("mapList.setNextMapIndex", server.NextMapIndex.ToString()); plugin.ServerCommand("mapList.runNextRound"); randomLevels -= 1; plugin.ConsoleWrite("^b[Map Randomizer]^n: Active, " + randomLevels + " levels remaining"); } // Remember the counter server.Data.setInt(kRandomized, randomLevels); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by Singh400*: This limit will say server rules to the player on request when the player type !rules Set limit to evaluate OnAnyChat and set action to None Set first_check to Expression Code: player.LastChat.StartsWith("!rules")Set second_check to CodeCode: // Edit rules here List<String> Rules = new List<String>(); Rules.Add("----- SERVER RULES -----"); Rules.Add("No Cheating, Glitching, Statspadding!"); Rules.Add("No Baserape or spawncamping"); Rules.Add("No mainbase camping"); // Try not to add more Rules.Add because it won't fit in the chat box. if(limit.Activations(player.Name) <= 2) foreach(string Rule in Rules) plugin.SendSquadMessage(player.TeamId, player.SquadId, Rule); return false; Is it "bad practice" if I just take this code and use it for @teamspeak instead? I haven't changed anything expect editing the rules to say TeamSpeak details instead of saying rules. It should't conflict if I'm already using the exact same example for @rules. Both the same code, just different triggers. @rules and @teamspeak. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 16, 2012 Author Share Posted February 16, 2012 Originally Posted by PapaCharlie9*: Is it "bad practice" if I just take this code and use it for @teamspeak instead? I haven't changed anything expect editing the rules to say TeamSpeak details instead of saying rules. It should't conflict if I'm already using the exact same example for @rules. Both the same code, just different triggers. @rules and @teamspeak. That's exactly what you are supposed to do with the example code! That's why they are called examples. They are examples of how you might do something similar to what you really need. They are intended to be replicated and modified. Most limits will have no conflicts after modification. However, one thing to be careful about is code that has some sort of persistent data. Using both the original example unchanged and the modified version at the same time might have conflicts. For example, code lines that contain "Data" or "RoundData" use persistent data. The key names (String) used will conflict with the original limit if you end up using both the original and your modified version. When you modify the example, as a best practice, change the key names for Data and RoundData values. Another example, custom lists. If the original uses a custom list and your modified version wants to use the same custom list, great! But if your modified version needs a custom list with a different purpose, e.g., admins vs. vips, you need to modify the list name and code using the list. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by Mootart*: This limit kills for RPG/SMAW/M320 on first violation, kicks on second violation, if player comes back, and uses it again one more time, player is banned. Set limit to evaluate OnKill, set action to None Set first_check to this Expression: Code: Regex.Match(kill.Weapon, @"(m320|smaw|rpg)", RegexOptions.IgnoreCase).SuccessSet second_check to this Code: Code: if (limit.Data.issetBool(player.Name)) { plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!")); plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); limit.Data.unsetBool(player.Name); } int count = (int) limit.Activations(player.Name); if (count == 1) { plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!")); plugin.KillPlayer(player.Name); } else if (count == 2) { plugin.SendGlobalMessage(plugin.R("%p_n% has been kicked for using %w_n%")); plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using %w_n%")); if (!limit.Data.issetBool(player.Name)) limit.Data.setBool(player.Name, true); } Hi micovery/papacharlie9 im using this limit for long time... i just want to ask how you change the code to kick by ea player name temporary 15mins i tried to change the plugin.PBBanPlayerWithMessage(PBBanDuration.Tempor ary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); to plugin.EaBanPlayerWithMessage(EaBanDuration.Tempor ary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); it doesnt work... can you help me? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by QUACK-Major-Pain*: I think tbans can only be pb name or guid bans. EA guid bans are meant to be perm. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by PapaCharlie9*: Hi micovery/papacharlie9 im using this limit for long time... i just want to ask how you change the code to kick by ea player name temporary 15mins i tried to change the plugin.PBBanPlayerWithMessage(PBBanDuration.Tempor ary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); to plugin.EaBanPlayerWithMessage(EaBanDuration.Tempor ary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%")); it doesnt work... can you help me? Step 1: RTFM. That's slang for Read The "Fine" Manual. Look at the Information tab for the Insane Limits plugin in PRoCon or go to the original post for the Insane Limits plugin in this forum (I know you know where that thread is). Always read the provided documentation and get as far as you can with it first. Step 2: Find the function you want to use in the documentation: Code: bool EABanPlayerWithMessage(EABanType type, EABanDuration duration, String name, int minutes, String message);Step 3: Compare your code to what the documentation says. Are there differences? If so, make adjustments. For example, according to the documentation, the first argument to EABanPlayerWithMessage should be a ban type. The second should be a duration code. The ban type and duration codes are not in the main docs, but micovery made a separate post about them, for convenience copied here: Code: public enum EABanType { EA_GUID = 0x01, IPAddress = 0x02, Name = 0x04 }; public enum EABanDuration { Temporary = 0x01, Permanent = 0x02, Round = 0x04 };The usage of the types are EABanType.EA_GUID, EABanType.IPAddress, EABanType.Name. I would use EABanType.Name myself, since I've used that before and know that it works and posts the name to the PRoCon ban list. For the codes, use EABanDuration.Temporary, EABanDuration.Permanent or EABanDuration.Round (which currently appears to do 1 round). The third argument is a name, the fourth is a time, and the last is a reason message. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by Mootart*: Step 1: RTFM. That's slang for Read The "Fine" Manual. Look at the Information tab for the Insane Limits plugin in PRoCon or go to the original post for the Insane Limits plugin in this forum (I know you know where that thread is). Always read the provided documentation and get as far as you can with it first. Step 2: Find the function you want to use in the documentation: Code: bool EABanPlayerWithMessage(EABanType type, EABanDuration duration, String name, int minutes, String message);Step 3: Compare your code to what the documentation says. Are there differences? If so, make adjustments. For example, according to the documentation, the first argument to EABanPlayerWithMessage should be a ban type. The second should be a duration code. The ban type and duration codes are not in the main docs, but micovery made a separate post about them, for convenience copied here: Code: public enum EABanType { EA_GUID = 0x01, IPAddress = 0x02, Name = 0x04 }; public enum EABanDuration { Temporary = 0x01, Permanent = 0x02, Round = 0x04 };The usage of the types are EABanType.EA_GUID, EABanType.IPAddress, EABanType.Name. I would use EABanType.Name myself, since I've used that before and know that it works and posts the name to the PRoCon ban list. For the codes, use EABanDuration.Temporary, EABanDuration.Permanent or EABanDuration.Round (which currently appears to do 1 round). The third argument is a name, the fourth is a time, and the last is a reason message. papacharlie please for give me for double post. didnt know it hit 2 times when i edit it wierd tho. please also forgive me i tried to look. and change but failed me. so i post if here. cuz really have no time i need to work too.. thanks for you time papacharlie.. big help for me.. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by Mootart*: This limit kills for RPG/SMAW/M320 on first violation, kicks on second violation, if player comes back, and uses it again one more time, player is banned. Set limit to evaluate OnKill, set action to None Set first_check to this Expression: Code: Regex.Match(kill.Weapon, @"(m320|smaw|rpg)", RegexOptions.IgnoreCase).SuccessSet second_check to this Code: Code: if (limit.Data.issetBool(player.Name)) { plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!")); [b]plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, player.name, 15, ("%p_n% banned for 15mins for using %w_n%"));[/b] limit.Data.unsetBool(player.Name); } int count = (int) limit.Activations(player.Name); if (count == 1) { plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!")); plugin.KillPlayer(player.Name); } else if (count == 2) { plugin.SendGlobalMessage(plugin.R("%p_n% has been kicked for using %w_n%")); plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using %w_n%")); if (!limit.Data.issetBool(player.Name)) limit.Data.setBool(player.Name, true); } Hi papacharlie the instruction you gave to me is same i saw on the forum. which is give me error. i tried to fix it but failed. like i told you b4 i dont have a lot of time.... that's why i ask your help... i hope you understand. that is the reason why am posting here and asking for your assistance with this codes. because if i have a lot of time i will try and try to fix it. as i do before. thank you so much papacharlie for you patients. hope you can help. i just tried to change the said code above but this give me errors [08:58:04 38] [insane Limits] ERROR: 1 error compiling Expression [08:58:04 38] [insane Limits] ERROR: (CS1010, line: 38, column: 148): Newline in constant Ignore this msg.. i have fix it.... Thank you so much papacharlie.... * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by micovery*: Hi papacharlie the instruction you gave to me is same i saw on the forum. which is give me error. i tried to fix it but failed. like i told you b4 i dont have a lot of time.... that's why i ask your help... i hope you understand. that is the reason why am posting here and asking for your assistance with this codes. because if i have a lot of time i will try and try to fix it. as i do before. thank you so much papacharlie for you patients. hope you can help. i just tried to change the said code above but this give me errors [08:58:04 38] [insane Limits] ERROR: 1 error compiling Expression [08:58:04 38] [insane Limits] ERROR: (CS1010, line: 38, column: 148): Newline in constant Two things. 1. Verify that you have set Expression for the first_check, and Code for the second_check. 2. In the code for EABanPlayerWithMessage, the last argument has a set of parenthesis hanging by themselves. I think it's missing plugin.R in front of it so it would be like this: Code: plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, player.name, 15, [b]plugin.R[/b]("%p_n% banned for 15mins for using %w_n%"));Edit: Also, it should be player.Name, instead of player.name * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by Mootart*: Two things. 1. Verify that you have set Expression for the first_check, and Code for the second_check. 2. In the code for EABanPlayerWithMessage, the last argument has a set of parenthesis hanging by themselves. I think it's missing plugin.R in front of it so it would be like this: Code: plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, player.name, 15, [b]plugin.R[/b]("%p_n% banned for 15mins for using %w_n%"));Edit: Also, it should be player.Name, instead of player.name got it sir.. i have fix it.. yet this is helpful... learning more from you guys.. thank you so much... * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by stufz*: Yes you can. In that case, instead of checking for player count, you just check for what is the current map. Set limit to evaluate OnInterval, and set action to None Set first_check to use this Code snippet: Code: List<String> map_names = new List<String>(); map_names.Add("MP_003"); map_names.Add("MP_011"); if (map_names.Contains(server.MapFileName)) plugin.ServerCommand("vars.vehicleSpawnAllowed", "false"); else plugin.ServerCommand("vars.vehicleSpawnAllowed", "true"); return false;For this example, vehicles will be disabled when map is "MP_003", or "MP_011", which are the files names for Tehran Highway, and Seine Crossing. For all other maps, the vehicles will be allowed. This is the full list of map files names for BF3, (including Back to Karkand expansion) MP_001 - Grand Bazaar MP_003 - Teheran Highway MP_007 - Caspian Border MP_011 - Seine Crossing MP_012 - Operation Firestorm MP_013 - Damavand Peak MP_017 -Noshahr Canals MP_018 - Kharg Island MP_Subway - Operation Metro XP1_001 - Strike At Karkand Xp1_002 - Gulf of Oman XP1_003 - Sharqi Peninsula XP1_004 - Wake Island Note that since this only disables the vehicles after the map has loaded, the first set of vehicles might spawn. But, after that, they should not spawn anymore. I haven't tested it to verify, but I suspect that's what would happen. Finally, this is just a very crude way of doing Per-Map settings. Sure it will work, but if there is already a plugin that specializes on that area, and already does the job well, you should use that. Thanks for this Micovery - works great, but we ran into a weirdness. I had Oman after Seine, which is vehicle limited - no tanks after first use/destroy. But Oman's RU heli & tank would not show. So I put Oman before Seine and now the tank & heli show. I have 2 other maps beside Seine with limited vehicles that come after the Seine map - Teheran followed by Kharg which is not limited, yet all of Kharg's vehicles show; then comes Damavand which has limited vehicles - no heli nor tank after first use/destroy. Wake is then the next map, and its not limited, yet its tanks do not show, which I think everyone will accept on our server ... hopefully. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by ango*: I wasn't sure whether the command did rounds or levels, looks like rounds. However, there is a fix, see below. To speed it up, try reducing the interval to 30 seconds. I wouldn't go much lower than that, though. In fact, Insane Limits won't let you. Here is a new version that should handle your two round rush maps correctly. I tested this, so I'm sure it will work. This is just the second_check code. The first_check is the same as before. In fact, I only added one line of code, the setNextMapIndex command. Code: int maxNextLevels = 10; // Change this to the number of maps in your rotation String kRandomized = "ango_random"; int randomLevels = -1; if (server.Data.issetInt(kRandomized)) randomLevels = server.Data.getInt(kRandomized); if (randomLevels == 0) { // We're done, forget the counter server.Data.unsetInt(kRandomized); plugin.ConsoleWrite("^b[Map Randomizer]^n: Done!"); return false; } else if (randomLevels == -1) { // Generate a random number Random rand = new Random(); randomLevels = rand.Next(maxNextLevels); plugin.ConsoleWrite("^b[Map Randomizer]^n: Active, will advance " + randomLevels + " levels"); } // Otherwise, we are still working on changing levels if (randomLevels > 0) { // Advance to the next level by setting the next map index plugin.ServerCommand("mapList.setNextMapIndex", server.NextMapIndex.ToString()); plugin.ServerCommand("mapList.runNextRound"); randomLevels -= 1; plugin.ConsoleWrite("^b[Map Randomizer]^n: Active, " + randomLevels + " levels remaining"); } // Remember the counter server.Data.setInt(kRandomized, randomLevels); return false; ... nice! Its working. I+ve set the interval to 30. Ok, sometimes it needs some minutes to change to the random map because we have a map cycle with 18 maps. But who cares, the server restarts at 4:00 in the morning * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 17, 2012 Author Share Posted February 17, 2012 Originally Posted by pharbehind*: Does Disable Vehicles based on player count not work on Rush mode? Evalution: OnIntervalPlayers Eval Interval: 30 Code: if (server.PlayerCount plugin.ServerCommand("vars.vehicleSpawnAllowed", "false"); else plugin.ServerCommand("vars.vehicleSpawnAllowed", "true"); All of my other plugins work, any ideas? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by Singh400*: Guys would this work? Using ...* & ...* as a template. I'm trying to announce map and gamemode near the end of the round. Set limit evaluation to OnSpawn, Set action to None. Set first_check to this Expression: Code: ( team1.RemainTicketsPercent < 10 || team2.RemainTicketsPercent < 10 )Set second_check to this Code: Code: if (limit.Activations() > 2) return false; /* BF3 friendly map names, including B2K */ Dictionary<String, String> Maps = new Dictionary<String, String>(); Maps.Add("MP_001", "Grand Bazaar"); Maps.Add("MP_003", "Teheran Highway"); Maps.Add("MP_007", "Caspian Border"); Maps.Add("MP_011", "Seine Crossing"); Maps.Add("MP_012", "Operation Firestorm"); Maps.Add("MP_013", "Damavand Peak"); Maps.Add("MP_017", "Noshahr Canals"); Maps.Add("MP_018", "Kharg Island"); Maps.Add("MP_Subway", "Operation Metro"); Maps.Add("XP1_001", "Strike At Karkand"); Maps.Add("XP1_002", "Gulf of Oman"); Maps.Add("XP1_003", "Sharqi Peninsula"); Maps.Add("XP1_004", "Wake Island"); /* BF3 friendly game modes, including B2K */ Dictionary<String, String> Modes = new Dictionary<String, String>(); Modes.Add("ConquestLarge0", "Conquest64"); Modes.Add("ConquestSmall0", "Conquest"); Modes.Add("ConquestSmall1", "Conquest Assault"); Modes.Add("RushLarge0", "Rush"); Modes.Add("SquadRush0", "Squad Rush"); Modes.Add("SquadDeathMatch0", "Squad Deathmatch"); Modes.Add("TeamDeathMatch0", "Team Deathmatch"); if (Maps.ContainsKey(server.NextMapFileName) && Modes.ContainsKey(server.NextGamemode)) plugin.SendGlobalMessage( " The next map will be " + Maps[server.NextMapFileName]+ " on " + Modes[server.NextGamemode] ); * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by PapaCharlie9*: I make multiple replies in this post, so scan the whole thing to see if your question was answered. Thanks for this Micovery - works great, but we ran into a weirdness.Try changing OnInterval to OnRoundStart. At the very least, you will stop sending 32 to 64 commands to the server every 30 seconds. I don't remember if OnRoundStart was added in 0.8 or not. If you don't have OnRoundStart, you can simulate it by using OnSpawn instead and rewrite the code to have a first_check Expression and second_check Code like this (just added one line of code in blue): first_check Expression: Code: (true) second_check Code:Code: if (limit.Activations() > 1) return false; List<String> map_names = new List<String>(); map_names.Add("MP_003"); map_names.Add("MP_011"); if (map_names.Contains(server.MapFileName)) plugin.ServerCommand("vars.vehicleSpawnAllowed", "false"); else plugin.ServerCommand("vars.vehicleSpawnAllowed", "true"); return false; ... nice! Its working. I+ve set the interval to 30. Ok, sometimes it needs some minutes to change to the random map because we have a map cycle with 18 maps. But who cares, the server restarts at 4:00 in the morning Is your map list always 18 maps? Do you change it often? Remember, I said all I needed to know was the number of maps to make a better example. As long as you remember to change the value of maxNextLevels every time you change the maplist.txt, this third version is better (just the second_check again, first_check is still the same): Code: int maxNextLevels = 18; // Change this to the number of maps in your rotation String kRandomized = "ango_random"; int randomLevels = -1; if (server.Data.issetInt(kRandomized)) randomLevels = server.Data.getInt(kRandomized); if (randomLevels == 0) { if (server.TimeUp < 2*60) return false; // Prevent repetition while in the critical time period // We're done, forget the counter server.Data.unsetInt(kRandomized); plugin.ConsoleWrite("^b[Map Randomizer]^n: Done!"); return false; } else if (randomLevels == -1) { // Generate a random number Random rand = new Random(); randomLevels = rand.Next(maxNextLevels); } if (randomLevels > 0) { // Jump to a random level by setting the next map index plugin.ServerCommand("mapList.setNextMapIndex", randomLevels); plugin.ServerCommand("mapList.runNextRound"); plugin.ConsoleWrite("^b[Map Randomizer]^n: jumped to map index " + randomLevels); randomLevels = 0; } // Prevent repetition of the runNextRound command server.Data.setInt(kRandomized, randomLevels); return false;It's still not the "real" version worth posting in a new example thread, since it requires changing the value of maxNextLevels for anyone else who uses it. When the full map list is available to limits, I'll make the final version. Guys would this work? Using ...* & ...* as a template. I'm trying to announce map and gamemode near the end of the round. Edit* Or perhaps if I just use OnRoundOver and set the action to:- Code: The next map will be" + Maps[server.NextMapFileName]+" on " + Modes[server.NextGamemode] OnRoundOver is too late, no one can see chat at that time. Your original code looks good. I would use 10 instead of 5 as the percentage of tickets. I've noticed that tickets can go from slightly over 5% to nothing in less than an update interval, so you might miss some announcements. I'd also shorten the values in the Mode table to the following: Code: /* BF3 friendly game modes, including B2K */ Dictionary<String, String> Modes = new Dictionary<String, String>(); Modes.Add("ConquestLarge0", "Conquest"); Modes.Add("ConquestSmall0", "Conquest"); Modes.Add("ConquestSmall1", "Conquest Assault"); Modes.Add("RushLarge0", "Rush"); Modes.Add("SquadRush0", "Squad Rush"); Modes.Add("SquadDeathMatch0", "SQDM"); Modes.Add("TeamDeathMatch0", "TDM"); * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by 0mni*: The plugin is working as intended, but for some reason this limit is spitting out errors, I modified it to reduce the spam. Dictionary kmessage = new Dictionary(); kmessage.Add(4, "%p_n% is on a killing SPREE with %r_x% kills!"); kmessage.Add(6, "No one has been able to stop %p_n%'s RAMPAGE!"); kmessage.Add(8, "%p_n% has become UNSTOPPABLE with %r_x% kills!"); kmessage.Add(10, "%p_n% has GODLIKE skill with %r_x% kills!"); kmessage.Add(20, "%p_n% is a GOD or you all suck, %r_x% kills!"); Dictionary vmessage = new Dictionary(); vmessage.Add(4, "%k_n% ended %v_n%'s killing spree!"); vmessage.Add(6, "%k_n% ended %v_n%'s rampant disregard for life!"); vmessage.Add(8, "The unstoppable spree has stopped, %k_n% killed %v_n%!"); vmessage.Add(10, "%k_n% has killed the GODLIKE %v_n% kill streak!"); vmessage.Add(20, "%k_n% is not a newb and ended %v_n%'s GODLY kill streak!"); List vkeys = new List(vmessage.Keys); List kkeys = new List(kmessage.Keys); int kcount = (int) limit.Spree(player.Name); int vcount = 0; /* Send Message if Victim's Kill-Spree Ended */ if ( limit.RoundData.issetInt(victim.Name) && (vcount = limit.RoundData.getInt(victim.Name)) > vkeys[0]) { vcount = Math.Min(vkeys[vkeys.Count-1], vcount); String message = plugin.R(vmessage[vcount]); plugin.ConsoleWrite(message); plugin.SendGlobalMessage(message); limit.RoundData.unsetInt(victim.Name); } /* Send Message if Killer is on a Kill-Spree */ if (kcount >= kkeys[0]) { kcount = Math.Min(kkeys[kkeys.Count-1], kcount); String message = plugin.R(kmessage[kcount]); plugin.ConsoleWrite(message); plugin.SendGlobalMessage(message); limit.RoundData.setInt(killer.Name, kcount); } return false; ----------------------------------------------- Version: InsaneLimits 0.0.0.8-patch-2 Date: 2/17/2012 9:11:35 PM Data: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. Stack Trace: at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(T Key key) at PRoConEvents.LimitEvaluator2.SecondCheck(PlayerInf oInterface player, PlayerInfoInterface killer, KillInfoInterface kill, PlayerInfoInterface victim, ServerInfoInterface server, PluginInterface plugin, TeamInfoInterface team1, TeamInfoInterface team2, TeamInfoInterface team3, TeamInfoInterface team4, LimitInfoInterface limit) MSIL Stack Trace: Void ThrowKeyNotFoundException(), IL: 0x5 TValue get_Item(TKey), IL: 0x0 Boolean SecondCheck(PRoConEvents.PlayerInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.KillInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.ServerInfoInterface, PRoConEvents.PluginInterface, PRoConEvents.TeamInfoInterface, PRoConEvents.TeamInfoInterface, PRoConEvents.TeamInfoInterface, PRoConEvents.TeamInfoInterface, PRoConEvents.LimitInfoInterface), IL: 0x158 ----------------------------------------------- Version: InsaneLimits 0.0.0.8-patch-2 Date: 2/17/2012 9:12:31 PM Data: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. Stack Trace: at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(T Key key) * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by Singh400*: OnRoundOver is too late, no one can see chat at that time. Your original code looks good. I would use 10 instead of 5 as the percentage of tickets. I've noticed that tickets can go from slightly over 5% to nothing in less than an update interval, so you might miss some announcements. I'd also shorten the values in the Mode table to the following: Code: /* BF3 friendly game modes, including B2K */ Dictionary<String, String> Modes = new Dictionary<String, String>(); Modes.Add("ConquestLarge0", "Conquest"); Modes.Add("ConquestSmall0", "Conquest"); Modes.Add("ConquestSmall1", "Conquest Assault"); Modes.Add("RushLarge0", "Rush"); Modes.Add("SquadRush0", "Squad Rush"); Modes.Add("SquadDeathMatch0", "SQDM"); Modes.Add("TeamDeathMatch0", "TDM"); Ahhh I see. Just tried this out, and it worked perfectly. I was using OnSpawn as the evaluation. Is there a better one to pick? It spammed like crazy during the last few seconds of the round. I guess I forget to add some sort of ceiling for activating the limit. Code: if (limit.Activations() > 2) return false;That would work right? Or is there a better way to do it? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by pharbehind*: Can I request an example for a 3 warning for killing with vehicles under X players? I don't want to turn off vehicles completely since that takes it off of Quick Join. But having a system that warned the player twice, then on the 3rd kill admin killed them would be ideal. Transports would be exempt, naturally. Is this possible? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by Athlon*: Please let me know if this 'kill streak' limit code is correct. It has been announcing and tweeting 10 kills in a row for a couple of weeks now, but never more than that. So, either we suck , or my code is bad. Code: double count = limit.Spree(player.Name); if (count == 10) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row!")); if (count == 10) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); else if (count == 15) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! Stop him!!")); else if (count == 15) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); else if (count == 20) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! Insane!!")); else if (count == 20) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); else if ( count > 25) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! He's unstoppable!")); else if ( count > 25) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by ango*: Is your map list always 18 maps? Do you change it often? Remember, I said all I needed to know was the number of maps to make a better example. As long as you remember to change the value of maxNextLevels every time you change the maplist.txt, this third version is better (just the second_check again, first_check is still the same): Code: int maxNextLevels = 18; // Change this to the number of maps in your rotation String kRandomized = "ango_random"; int randomLevels = -1; if (server.Data.issetInt(kRandomized)) randomLevels = server.Data.getInt(kRandomized); if (randomLevels == 0) { if (server.TimeUp < 2*60) return false; // Prevent repetition while in the critical time period // We're done, forget the counter server.Data.unsetInt(kRandomized); plugin.ConsoleWrite("^b[Map Randomizer]^n: Done!"); return false; } else if (randomLevels == -1) { // Generate a random number Random rand = new Random(); randomLevels = rand.Next(maxNextLevels); } if (randomLevels > 0) { // Jump to a random level by setting the next map index plugin.ServerCommand("mapList.setNextMapIndex", randomLevels); plugin.ServerCommand("mapList.runNextRound"); plugin.ConsoleWrite("^b[Map Randomizer]^n: jumped to map index " + randomLevels); randomLevels = 0; } // Prevent repetition of the runNextRound command server.Data.setInt(kRandomized, randomLevels); return false;It's still not the "real" version worth posting in a new example thread, since it requires changing the value of maxNextLevels for anyone else who uses it. When the full map list is available to limits, I'll make the final version.We dont change often the maplist. If we change I change also maxNextLevels.If I insert your new code I´be got some errors: Code: 16:04:01 40] [Insane Limits] Thread(settings): ERROR: 2 errors compiling Expression [16:04:01 40] [Insane Limits] Thread(settings): ERROR: (CS1502, line: 55, column: 14): Die beste Übereinstimmung für die überladene Methode PRoConEvents.PluginInterface.ServerCommand(params string[]) hat einige ungültige Argumente. [16:04:01 40] [Insane Limits] Thread(settings): ERROR: (CS1503, line: 55, column: 62): Das Argument 2 kann nicht von int in string konvertiert werden.Ok, think its better to wait till the full map list is available to limits.Anyway, thanks for your help ... * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by PapaCharlie9*: We dont change often the maplist. If we change I change also maxNextLevels. If I insert your new code I´be got some errors: Code: 16:04:01 40] [Insane Limits] Thread(settings): ERROR: 2 errors compiling Expression [16:04:01 40] [Insane Limits] Thread(settings): ERROR: (CS1502, line: 55, column: 14): Die beste Übereinstimmung für die überladene Methode PRoConEvents.PluginInterface.ServerCommand(params string[]) hat einige ungültige Argumente. [16:04:01 40] [Insane Limits] Thread(settings): ERROR: (CS1503, line: 55, column: 62): Das Argument 2 kann nicht von int in string konvertiert werden.Ok, think its better to wait till the full map list is available to limits.Anyway, thanks for your help ... Sorry, that was my mistake. I didn't test that one. I've corrected it below, give this a try:Code: int maxNextLevels = 18; // Change this to the number of maps in your rotation String kRandomized = "ango_random"; int randomLevels = -1; if (server.Data.issetInt(kRandomized)) randomLevels = server.Data.getInt(kRandomized); if (randomLevels == 0) { if (server.TimeUp < 2*60) return false; // Prevent repetition while in the critical time period // We're done, forget the counter server.Data.unsetInt(kRandomized); plugin.ConsoleWrite("^b[Map Randomizer]^n: Done!"); return false; } else if (randomLevels == -1) { // Generate a random number Random rand = new Random(); randomLevels = rand.Next(maxNextLevels); } if (randomLevels > 0) { // Jump to a random level by setting the next map index plugin.ServerCommand("mapList.setNextMapIndex", randomLevels.ToString()); plugin.ServerCommand("mapList.runNextRound"); plugin.ConsoleWrite("^b[Map Randomizer]^n: jumped to map index " + randomLevels); randomLevels = 0; } // Prevent repetition of the runNextRound command server.Data.setInt(kRandomized, randomLevels); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by PapaCharlie9*: Ahhh I see. Just tried this out, and it worked perfectly. I was using OnSpawn as the evaluation. Is there a better one to pick? It spammed like crazy during the last few seconds of the round. I guess I forget to add some sort of ceiling for activating the limit. Code: if (limit.Activations() > 2) return false;That would work right? Or is there a better way to do it?That should work fine with OnSpawn, though if two spawns happen one immediately after the other, the announcement will spam twice and then stop for the rest of the round. If you really want it to run exactly twice and space out the announcements over some period of time, use OnIntervalServer set to 30 seconds and make the first_check be this: Code: ( (!server.RoundData.issetBool("Singh_announcer") && (team1.RemainTicketsPercent < 10 || team2.RemainTicketsPercent < 10)) || (server.RoundData.issetBool("Singh_announcer") && (team1.RemainTicketsPercent < 5 || team2.RemainTicketsPercent < 5)) )second_check Code start like this: Code: if (limit.Activations() > 2) return false; server.RoundData.setBool("Singh_announcer", true); ... the rest of your code follows here ...That will insure that the announcement happens exactly twice and that it happens near 10% and near 5% instead of immediately one after the other, though again, you will go from slightly over 5% to 0% before 30 seconds expires, so you'll miss the second announcement sometimes. In a 300 ticket round with a full server, 5% is only 15 tickets and 15 tickets can go to zero very quickly with a bleed on. If you want to guarantee everyone sees the second message, set the the percentages to 15 and 10 or 12 and 8, something like that. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by PapaCharlie9*: Please let me know if this 'kill streak' limit code is correct. It has been announcing and tweeting 10 kills in a row for a couple of weeks now, but never more than that. So, either we suck , or my code is bad. Code: double count = limit.Spree(player.Name); if (count == 10) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row!")); if (count == 10) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); else if (count == 15) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! Stop him!!")); else if (count == 15) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); else if (count == 20) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! Insane!!")); else if (count == 20) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); else if ( count > 25) plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! He's unstoppable!")); else if ( count > 25) plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); return false; Not quite right. When you have if/else if/else if/... etc., it means only one of those conditions will execute. If you would remove all the "else" keywords and just have everything be "if", it would work. It would be better to group everything under the count you want in multiple line blocks, like this: Code: double count = limit.Spree(player.Name); if (count == 10) { plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row!")); plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); } if (count == 15) { plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! Stop him!!")); plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); } if (count == 20) { plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! Insane!!")); plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); } if ( count >= 25) { plugin.SendGlobalMessage(plugin.R("%p_n% killed %r_x% in a row! He's hacking like a cheating mofo!")); plugin.Tweet(plugin.R("%p_n% killed %r_x% in a row!")); } return false;Check the message for the count >= 25 case, I changed it to reflect reality. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted February 18, 2012 Author Share Posted February 18, 2012 Originally Posted by PapaCharlie9*: Can I request an example for a 3 warning for killing with vehicles under X players? I don't want to turn off vehicles completely since that takes it off of Quick Join. But having a system that warned the player twice, then on the 3rd kill admin killed them would be ideal. Transports would be exempt, naturally. Is this possible? It's possible if you are willing to assume that a kill.Weapon of "Death" means a vehicle kill. I think it can also mean a mortar kill, so you will get some false warnings. I wrote the code for you here: myrcon.net/...insane-limits-warn-then-punish-pattern#entry23527 You said "3 warnings" then "2 warnings/kill" so I wasn't sure which you meant. The code does 3 warnings and then a kill. If you want to make it two warnings, let me know and I'll adjust the code. I assumed X to be 8 or fewer players, but you can change that to whatever number you want in the first_check. * 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.