ImportBot Posted July 11, 2013 Author Share Posted July 11, 2013 Originally Posted by w262035635*: Try this new version of "Test Roadkill": Change OnKill to OnTeamKill. Code: if (!Regex.Match(kill.Weapon, @"(Roadkill|Death|Suicide)", RegexOptions.IgnoreCase).Success) return false; String kname = (killer == null || String.IsNullOrEmpty(killer.Name)) _ "(null)" : killer.Name; String vname = (victim == null || String.IsNullOrEmpty(victim.Name)) _ "(null)" : victim.Name; String pname = (player == null || String.IsNullOrEmpty(player.Name)) _ "(null)" : player.Name; plugin.ConsoleWrite(kname + "/" + pname + " " + kill.Weapon + " " + vname); if (killer != null) plugin.ConsoleWrite(kname + " TEAMKILLS = " + killer.TeamKillsRound + ", TEAMDEATHS = " + killer.TeamDeathsRound); return false;Make sure someone is doing Roadkills during your test.Didn't any test log... * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 12, 2013 Author Share Posted July 12, 2013 Originally Posted by PapaCharlie9*: Didn't any test log...I'm stumped. I don't know what else to try. I guess Insane Limits can't be used for this purpose. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 12, 2013 Author Share Posted July 12, 2013 Originally Posted by LumPenPacK*: Is it possible to get an information about the count of kills one team has been doing with a specific weapon during the current round? I want to add an OnKill limit which gets only activated if teamA has more than X kills with a specific weapon. How to use WeaponStatsInterface from Server Object? Code: /* Weapon Stats, Current Round, All Rounds (Total)*/ WeaponStatsInterface this[String WeaponName] { get; } * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 13, 2013 Author Share Posted July 13, 2013 Originally Posted by Singh400*: Is it possible to get an information about the count of kills one team has been doing with a specific weapon during the current round? I want to add an OnKill limit which gets only activated if teamA has more than X kills with a specific weapon. How to use WeaponStatsInterface from Server Object? Code: /* Weapon Stats, Current Round, All Rounds (Total)*/ WeaponStatsInterface this[String WeaponName] { get; } Thinking out a loud... Have a int value, let it be incremented when OnKill is triggered and the weapon is equal to whatever. Then the second bit of the limit can be if the int value is above a certain value to do something else. And you need to clear the int value at either roundStart or roundEnd. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 13, 2013 Author Share Posted July 13, 2013 Originally Posted by Singh400*: And I've never ever managed to get WeaponStatsInterface working, I've tried lots of different things too. Never ever been able to compile a limit with it. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 13, 2013 Author Share Posted July 13, 2013 Originally Posted by LumPenPacK*: Thinking out a loud... Have a int value, let it be incremented when OnKill is triggered and the weapon is equal to whatever. Then the second bit of the limit can be if the int value is above a certain value to do something else. And you need to clear the int value at either roundStart or roundEnd. I had already this idea: OnKill first check Expression: Code: Regex.Match(kill.Weapon, @"(_:M416|M16A4)", RegexOptions.IgnoreCase).Sucesssecond checkCode: Code: Code: if ((limit.Activations(1) / team1.KillsRound ) > 0.5) // weapon usage percentage team 1 { plugin.ConsoleWrite("team1 exceeds limit"); plugin.PRoConChat("US Team has reached weapon usage limit. DON'T spawn with M16 or M416") } if ((limit.Activations(2) / team2.KillsRound ) > 0.5) // weapon usage percentage team 2 { plugin.ConsoleWrite("team2 exceeds limit"); plugin.PRoConChat("RU Team has reached weapon usage limit. DON'T spawn with M16 or M416") }Problem: I don't want to punish people immediately if the second check is true but only after the weapon usage percentage is higher than the limit AND the players spawn and kill someone again with M416/M16. I'm not sure if this is possible with Insane Limits. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 13, 2013 Author Share Posted July 13, 2013 Originally Posted by w262035635*: I'm stumped. I don't know what else to try. I guess Insane Limits can't be used for this purpose.It is indeed a difficult problemDon't know can do this. Don't go to tube players how to death. As long as it is death, will be recorded. then If death X times, and score points less than Y For example: a player killed four times, but has a score of 150 points, then the cumulative death will be empty Recently didn't get score of 150 points, then will start the punishment So will be kicked out the server again The second warning for the temporary ban The third is forever The number of punishment automatic emptying the next round * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 13, 2013 Author Share Posted July 13, 2013 Originally Posted by PapaCharlie9*: And I've never ever managed to get WeaponStatsInterface working, I've tried lots of different things too. Never ever been able to compile a limit with it.Here ya go mate, this works. You can use it as a cut&paste basis. Set limit to evaluate OnKill. Set first_check to this Code: Code: WeaponStatsInterface ws = server[kill.Weapon]; // weapon stats for the entire server WeaponStatsInterface wk = killer[kill.Weapon]; // weapon stats for the killer Match m = Regex.Match(kill.Weapon, @"/([^/]+)$"); String wn = kill.Weapon; if (m.Success) wn = m.Groups[1].Value; plugin.ConsoleWrite("^b" + killer.Name + "^n has ^8" + wk.KillsRound + "^0 kills with ^b" + wn + "^n; ^8" + ws.KillsRound + "^0 total for all players this round"); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 13, 2013 Author Share Posted July 13, 2013 Originally Posted by PapaCharlie9*: I had already this idea: OnKill first check Expression: Code: Regex.Match(kill.Weapon, @"(_:M416|M16A4)", RegexOptions.IgnoreCase).Sucesssecond checkCode: Code: Code: if ((limit.Activations(1) / team1.KillsRound ) > 0.5) // weapon usage percentage team 1 { plugin.ConsoleWrite("team1 exceeds limit"); plugin.PRoConChat("US Team has reached weapon usage limit. DON'T spawn with M16 or M416") } if ((limit.Activations(2) / team2.KillsRound ) > 0.5) // weapon usage percentage team 2 { plugin.ConsoleWrite("team2 exceeds limit"); plugin.PRoConChat("RU Team has reached weapon usage limit. DON'T spawn with M16 or M416") }Problem: I don't want to punish people immediately if the second check is true but only after the weapon usage percentage is higher than the limit AND the players spawn and kill someone again with M416/M16. I'm not sure if this is possible with Insane Limits. Here's how you can do the same thing with WeaponStatsInterface OnKill Set first_check to this Code: Code: String teamName = (killer.TeamId == 1) _ "US" : "RU"; double totalM416 = 0; double totalM16 = 0; TeamInfoInterface thisTeam = (killer.TeamId == 1) _ team1 : team2; // Compute team totals for specified weapons foreach (PlayerInfoInterface mate in thisTeam.players) { totalM416 = totalM416 + mate["M416"].KillsRound; totalM16 = totalM16 + mate["M16A4"].KillsRound; } if ((totalM416 / team1.KillsRound ) > 0.5) // weapon usage percentage for M416 { plugin.ConsoleWrite("Team " + teamName + " exceeds M416 limit: " + totalM416.ToString("F0") + "/" + thisTeam.KillsRound.ToString("F0")); plugin.PRoConChat(teamName + " Team has reached M416 weapon usage limit. DON'T spawn with M416"); } if ((totalM16 / team1.KillsRound ) > 0.5) // weapon usage percentage for M16 { plugin.ConsoleWrite("Team " + teamName + " exceeds M16 limit: " + totalM16.ToString("F0") + "/" + thisTeam.KillsRound.ToString("F0")); plugin.PRoConChat(teamName + " Team has reached M16 weapon usage limit. DON'T spawn with M16"); } return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by EntraVenuS*: Hi all, Just a wild idea for an insane limit. Bear with me there is a bit of text. Battle On A Budget.. is there any way to record (yes i guess it must be databased) each of the vehicles that are destroyed on a team? if the answer is yes then could the vehicles have a price on them? Reason behind this... You start the round with your team access to $100,000,000 and each vehicle that is destroyed would take some of your starting money, so in effect you have to repair your vehicles to save your cash. If you run out of money (i know you cannot stop spawn of vehicles but maybe delay spawn for maximum time) to give the other team a advantage to win (if they havent lost their money too) I know this sounds a bit way out but it would be a nice mod to run Thanks for reading plz dont laugh too hard at me if there is no way of achieving this * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by Singh400*: Here ya go mate, this works. You can use it as a cut&paste basis. Set limit to evaluate OnKill. Set first_check to this Code: Code: WeaponStatsInterface ws = server[kill.Weapon]; // weapon stats for the entire server WeaponStatsInterface wk = killer[kill.Weapon]; // weapon stats for the killer Match m = Regex.Match(kill.Weapon, @"/([^/]+)$"); String wn = kill.Weapon; if (m.Success) wn = m.Groups[1].Value; plugin.ConsoleWrite("^b" + killer.Name + "^n has ^8" + wk.KillsRound + "^0 kills with ^b" + wn + "^n; ^8" + ws.KillsRound + "^0 total for all players this round"); return false; Ahhh, I was so close. Thanks mate. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by LumPenPacK*: Here's how you can do the same thing with WeaponStatsInterfaceThank you PapaCharlie9! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by w262035635*: I'm stumped. I don't know what else to try. I guess Insane Limits can't be used for this purpose.It is indeed a difficult problemDon't know can do this. Don't go to tube players how to death. As long as it is death, will be recorded. then If death X times, and score points less than Y For example: a player killed four times, but has a score of 150 points, then the cumulative death will be empty Recently didn't get score of 150 points, then will start the punishment So will be kicked out the server again The second warning for the temporary ban The third is forever The number of punishment automatic emptying the next round * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by PapaCharlie9*: It is indeed a difficult problem Don't know can do this. Don't go to tube players how to death. As long as it is death, will be recorded. then If death X times, and score points less than Y For example: a player killed four times, but has a score of 150 points, then the cumulative death will be empty Recently didn't get score of 150 points, then will start the punishment So will be kicked out the server again The second warning for the temporary ban The third is forever The number of punishment automatic emptying the next round The problem is, the death is not recorded at all. As you noticed, Roadkill and certain types of vehicle suicide don't get reported by Insane Limits. It's as if they don't happen. The only type of death that is recorded is when an enemy kills the victim. That is not what you want. I'm sorry, I tried everything and I can't figure out how to make it work. You are welcome to try yourself, but I don't believe I will be able to help you. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by PapaCharlie9*: Hi all, Just a wild idea for an insane limit. Bear with me there is a bit of text. Battle On A Budget.. is there any way to record (yes i guess it must be databased) each of the vehicles that are destroyed on a team? if the answer is yes then could the vehicles have a price on them? Reason behind this... You start the round with your team access to $100,000,000 and each vehicle that is destroyed would take some of your starting money, so in effect you have to repair your vehicles to save your cash. If you run out of money (i know you cannot stop spawn of vehicles but maybe delay spawn for maximum time) to give the other team a advantage to win (if they havent lost their money too) I know this sounds a bit way out but it would be a nice mod to run Thanks for reading plz dont laugh too hard at me if there is no way of achieving this Why would I laugh? I think that's a fun idea and I would like playing that. Unfortunately, no vehicle information whatsoever is reported in BF3. All vehicles, included MAV and Mortar (because you have to enter it to fire it I guess) are reported as "Death". That's it. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by w262035635*: The problem is, the death is not recorded at all. As you noticed, Roadkill and certain types of vehicle suicide don't get reported by Insane Limits. It's as if they don't happen. The only type of death that is recorded is when an enemy kills the victim. That is not what you want. I'm sorry, I tried everything and I can't figure out how to make it work. You are welcome to try yourself, but I don't believe I will be able to help you. Or you can think of a way to stop the troublemakers in the "NO KILL Server"? Rock the boat * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by PapaCharlie9*: Or you can think of a way to stop the troublemakers in the "NO KILL Server"? Rock the boatEnable team killing? Set vars.friendlyFire to true? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by PapaCharlie9*: Thank you PapaCharlie9!Thinking about this some more, I think it would be better for you to use your original first_check, the Regex.Match for M416 and M16A4, and put my code in second_check. That way, you avoid recalculating the counts for weapon kills that don't matter. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by PapaCharlie9*: Enable team killing? Set vars.friendlyFire to true?Or maybe ProconRulz works better for this kind of thinkg? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by w262035635*: Or maybe ProconRulz works better for this kind of thinkg?Yes, I use ProconRulz plugin.Banning players kill,Can only get scores by the capture flags But there are always some troublemakers, cause disturbance in the server, Accidental death led to other players to score points * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by EntraVenuS*: Why would I laugh? I think that's a fun idea and I would like playing that. Unfortunately, no vehicle information whatsoever is reported in BF3. All vehicles, included MAV and Mortar (because you have to enter it to fire it I guess) are reported as "Death". That's it.ok so how about using the death as a minus of your teams money and when money runs out your vehicles take a very long time to respawn, key to the gameplay is revive and keep your team in the money. So any death costs you money. not quite as good as the original concept but equally as fun if your team dies a lot and dont revive / repair. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 14, 2013 Author Share Posted July 14, 2013 Originally Posted by LumPenPacK*: Thinking about this some more, I think it would be better for you to use your original first_check, the Regex.Match for M416 and M16A4, and put my code in second_check. That way, you avoid recalculating the counts for weapon kills that don't matter.If I use your code for the second check, will the counter not be set to zero for every new first check activation of the limit? String teamName = (killer.TeamId == 1) ? "US" : "RU"; double totalM416 = 0; double totalM16 = 0; TeamInfoInterface thisTeam = (killer.TeamId == 1) ? team1 : team2; // Compute team totals for specified weapons foreach (PlayerInfoInterface mate in thisTeam.players) { totalM416 = totalM416 + mate["M416"].KillsRound; totalM16 = totalM16 + mate["M16A4"].KillsRound; ..... I'm just trying to find a way to implement my idea of an adaptive weapon kills percentage limiter but at the moment I've exactly this problem that a code in second check is apparently not saving the value of my parameters. (I'll propably post my concept is a few minutes ) * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 16, 2013 Author Share Posted July 16, 2013 Originally Posted by LumPenPacK*: but at the moment I've exactly this problem that a code in second check is apparently not saving the value of my parameters.Okay, I'm a noob with coding, but I've learned: I have to use DataDictionaryInterface to save values. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 17, 2013 Author Share Posted July 17, 2013 Originally Posted by PapaCharlie9*: ok so how about using the death as a minus of your teams money and when money runs out your vehicles take a very long time to respawn, key to the gameplay is revive and keep your team in the money. So any death costs you money. not quite as good as the original concept but equally as fun if your team dies a lot and dont revive / repair. Better, but still not really feasible. Since kills by chopper/jet guns would count, a team that is flying would burn up their money pretty quick. One good jet pilot could blow the whole budget. You might as well just limit the total kills by "Death" and forget about the whole money angle. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 17, 2013 Author Share Posted July 17, 2013 Originally Posted by PapaCharlie9*: If I use your code for the second check, will the counter not be set to zero for every new first check activation of the limit? I'm just trying to find a way to implement my idea of an adaptive weapon kills percentage limiter but at the moment I've exactly this problem that a code in second check is apparently not saving the value of my parameters. (I'll propably post my concept is a few minutes ) Those sums are recalculated from the weapon stats (mate["M416"].KillsRound). The KillsRound part is remembered. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 18, 2013 Author Share Posted July 18, 2013 Originally Posted by Jaythegreat1*: Give this a try: Create a new custom list (make sure use_custom_lists is True) called idle_whitelist. Set it to CaseSensitive. You can put player names or clan tags in the list, separated by commas. Create a new limit to evaluate OnIntervalServer, call it "Idle Kick", set interval to 60 seconds, leave Action set to None. Set first_check to this Code: Code: double MaximumIdleSeconds = 10*60; // 10 minutes double MinimumPlayers = 6; String KickMessage = "Idle too long"; if (server.PlayerCount < MinimumPlayers) return false; List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); if (team3.players.Count > 0) all.AddRange(team3.players); if (team4.players.Count > 0) all.AddRange(team4.players); // Track and update idle players foreach (PlayerInfoInterface p in all) { if (plugin.isInList(p.Name, "idle_whitelist") || (!String.IsNullOrEmpty(p.Tag) && plugin.isInList(p.Tag, "idle_whitelist"))) continue; if (plugin.CheckPlayerIdle(p.Name) > MaximumIdleSeconds) { plugin.ConsoleWrite("Kicking idle player " + p.FullName); plugin.KickPlayerWithMessage(p.Name, KickMessage); } } return false;You should change the top three lines. MaximumIdleSeconds is the maximum idle time in seconds. So if you want 15 minutes, make it 15*60, or 900. MinimumPlayers is the minimum number of players that have to be in the server before the idle kicker is enabled. I set it to 6, but you can change it to whatever you want. KickMessage is the message you want the player to see when they are kicked. NOTE: I haven't tested this myself, but I've been told that the idle time tracked by the game server is cumulative. So if a player is idle for 5 minutes, then plays for an hour, then is idle for 5 minutes again, his idle time will be reported as 10 minutes. Keep that in mind when you set the maximum. Is there a way to enable/disable idle depending on the time of day? I'd like to turn idle kick during late-night/early times. Sometimes if our server is full at night, guys can't idle unless someone turns off idle kick and disables a setting in adaptive server size. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 31, 2013 Author Share Posted July 31, 2013 Originally Posted by XJaegaX*: Hi, I am looking for a limit that displays a message when a player ends another player's kill spree. I have the following kill spree limit to show kill sprees every 5 kills: double count = limit.Spree(player.Name); double vcount = limit.Spree(victim.Name); if ((count > 0) && ((count % 5) == 0)) { String msg = plugin.R("%p_n% has a %r_x% kill streak!"); plugin.ServerCommand("admin.yell", msg, "8"); plugin.PRoConChat("ADMIN > " + msg); } if (vcount >= 5) { String msg = plugin.R("%p_n% ended %v_n% "); msg = msg + vcount.ToString() + " kill streak"; plugin.ServerCommand("admin.yell", msg, "8"); plugin.PRoConChat("ADMIN > " + msg); } But the second part is not working. Any suggestions/example on how to do it would be greatly appreciated. Thanks * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted July 31, 2013 Author Share Posted July 31, 2013 Originally Posted by LumPenPacK*: myrcon.net/...insane-limits-examples#entry18492 * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 1, 2013 Author Share Posted August 1, 2013 Originally Posted by XJaegaX*: myrcon.net/...insane-limits-examples#entry18492Thanks very much for the help.Is working now, updated as follows: int kcount = (int)limit.Spree(player.Name); int vcount = (limit.RoundData.issetInt(victim.Name)) ? limit.RoundData.getInt(victim.Name) : 0; if (kcount >= 5) { if ((kcount % 5) == 0) { String msg = plugin.R("%p_n% has a %r_x% kill streak!"); plugin.ServerCommand("admin.yell", msg, "5"); plugin.PRoConChat("ADMIN > " + msg); } limit.RoundData.setInt(killer.Name, kcount); } if (vcount >= 5) { String msg = plugin.R("%k_n% ended %v_n%'s " + vcount.ToString() + " kill streak!"); plugin.ServerCommand("admin.yell", msg, "5"); plugin.PRoConChat("ADMIN > " + msg); limit.RoundData.unsetInt(victim.Name); } return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted August 2, 2013 Author Share Posted August 2, 2013 Originally Posted by )RAG()N*: This thread IS the replacement for Examples. Also, this whole forum is as well. There are lots of "Insane Limits" threads in the Plugin Enhancements forum. Use the forum search or just page through the table of contents for this forum to see examples. Create a new limit to evaluate OnSpawn, call it "Ping Kicker", set Action to Kick and fill in the kick_message field. Set first_check to this Expression: Code: (player.MedianPing > XXX)Change XXX to whatever you want the maximum ping to be.Would it be possible to add a white list to this ? * 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.