ImportBot Posted January 14, 2014 Share Posted January 14, 2014 Originally Posted by PapaCharlie9*: This limit requires Insane Limits 0.9.16.0 or later! The limit should be active if less than (6 or 8_) people on the server. The limit should tell people when they spawn and if there are less than (6 or 8_) people that the limit is active: - Killing people with vehicles and mortals is not allowed, until minimum of (6 or 8_) people online. And then it should punish people for killing with vehicles like this: - 1 kill = Warning / Kill - 2 kills = Warning / Kill - 3 kills = Kick the player It would help when we are playing rush with low number of players. Create a new limit OnKill, call it "Low Pop Vehicle Kills", leave Action set to None. In the code that follows, these variables define how the limit works -- think of these like settings, but you have to change the code to change them: minimumPlayers: if there are the same or fewer than this number of players in the server, the punishment is enabled. If there are more players than this number, the punishment is disabled. warningCount: first through this number of vehicle kills get a warning (player-only chat). adminKillCount: first through this number of vehicle kills result in the player being admin killed. kickCount: this number of vehicle kills will result in the player being kicked. If they come back and vehicle kill again and the population is still too low, they will get kicked again. Note that adminKillCount and warningCount are forced to be less than kickCount. So if you make a mistake and set warningCount to 5 and kickCount to 4, warningCount will be changed to (kickCount - 1), which would be 3 in this example. Set first_check to this Code: Code: // Variables int minimumPlayers = 8; // you can change this number int warningCount = 2; // you can change this number int adminKillCount = 2; // you can change this number int kickCount = 3; // you can change this number // You can change these messages also: String warningMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; String kickMessage = "ignored warnings about no vehicle kills"; // Code if (!Regex.Match(kill.Category, @"(Vehicle)").Success) return false; if (killer.Name == victim.Name) return false; if (killer.Name == "Server") return false; if (server.PlayerCount > minimumPlayers) return false; String prefix = "LowPopVehiclePunisher_"; String key = prefix + killer.Name; int count = 0; if (plugin.RoundData.issetInt(key)) count = plugin.RoundData.getInt(key); count = count + 1; plugin.RoundData.setInt(key, count); if (kickCount < 1) kickCount = 1; if (warningCount >= kickCount) warningCount = kickCount - 1; if (adminKillCount >= kickCount) adminKillCount = kickCount - 1; if (count >= kickCount) { String tmp = "Kicking " + killer.Name + " killed " + victim.Name + " with " + kill.Weapon + ", reason: " + kickMessage; plugin.ConsoleWrite(tmp); plugin.PRoConChat("Insane Limits > " + tmp); plugin.KickPlayerWithMessage(killer.Name, kickMessage); return false; } bool warned = false; if (count <= warningCount) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); warned = true; } if (count <= adminKillCount) { if (!warned) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); } plugin.KillPlayer(killer.Name, 5); } return false; OPTIONAL For each players first noticeCount spawns, this limit will announce that vehicle kills will be punished if the population is less than minimumPlayers. The value of minimumPlayers MUST be the same in both limits. If you change the code above, you must also change this code. Create a new limit OnSpawn, call it "Spawn Notice", leave Action set to None. In the code that follows, these variables define how the limit works -- think of these like settings, but you have to change the code to change them: minimumPlayers: if there are the same or fewer than this number of players in the server, the punishment is enabled. If there are more players than this number, the punishment is disabled. noticeCount: first through this number of spawns will send a chat message to the player. Code: // Variables int minimumPlayers = 8; // you can change this number - MUST BE THE SAME AS THE OnKill LIMIT! int noticeCount = 2; // you can change this number // You can change this message also: String noticeMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; // Code if (server.PlayerCount > minimumPlayers) return false; String prefix = "SpawnNotice_"; String key = prefix + player.Name; int count = 0; if (plugin.RoundData.issetInt(key)) count = plugin.RoundData.getInt(key); if (count > noticeCount) return false; count = count + 1; plugin.RoundData.setInt(key, count); plugin.SendPlayerMessage(player.Name, noticeMessage); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 14, 2014 Author Share Posted January 14, 2014 Originally Posted by TMiland*: Thank you PapaCharlie9! Just what i was looking for! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 14, 2014 Author Share Posted January 14, 2014 Originally Posted by jking54*: This is a really nice idea in lieu of codes for vehicles which from looks of it I'll win the lottery before this happens Consider the example of someone who may take a vehicle to get to a flag, say a heli and a foot soldier equipped with stingers nails him, fair game? Of course, so one would have to keep that in mind or someone who grabs a jeep and runs someone over on the way to a flag, that sort of thing. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 15, 2014 Author Share Posted January 15, 2014 Originally Posted by Talzac*: I like it, but you should change the code from: if (server.PlayerCount > minimumPlayers) return false; To if (server.PlayerCount >= minimumPlayers) return false; So that if 8 players are online it is activated and not have to wait for 9 players. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 15, 2014 Author Share Posted January 15, 2014 Originally Posted by Talzac*: Also adding a game mode setting, so that you can select to have this on rush only and not if map is CQ. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 15, 2014 Author Share Posted January 15, 2014 Originally Posted by Talzac*: Also if the server drops below the 8 players, it would be nice to give a gerenal information about this so that people know about it? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 15, 2014 Author Share Posted January 15, 2014 Originally Posted by PapaCharlie9*: I like it, but you should change the code from: if (server.PlayerCount > minimumPlayers) return false; To if (server.PlayerCount >= minimumPlayers) return false; So that if 8 players are online it is activated and not have to wait for 9 players. The message assumes >, so either you also have to change the message, or change minimumPlayers to 7 instead of 8. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 15, 2014 Author Share Posted January 15, 2014 Originally Posted by PapaCharlie9*: Also if the server drops below the 8 players, it would be nice to give a gerenal information about this so that people know about it?That's easier to do with a separate limit. NOTE: This limit assumes the original > logic, not >=, for minimumPlayers. If you change the other limits to >= minimumPlayers, you have to change this code too from Create a limit to evaluate OnLeave, call it "Low Pop Notice", leave Action set to None. Set first_check to this Code: Code: // Variables int minimumPlayers = 8; // you can change this number // You can change these messages also: String warningMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; // Code String key = "LowPopCount"; int last = 0; if (plugin.RoundData.issetInt(key)) last = plugin.RoundData.getInt(key); plugin.RoundData.setInt(key, server.PlayerCount); if (last <= minimumPlayers) return false; if (server.PlayerCount > minimumPlayers) return false; plugin.SendGlobalMessage(warningMessage); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 15, 2014 Author Share Posted January 15, 2014 Originally Posted by jking54*: That's easier to do with a separate limit. NOTE: This limit assumes the original > logic, not >=, for minimumPlayers. If you change the other limits to >= minimumPlayers, you have to change this code too from Create a limit to evaluate OnLeave, call it "Low Pop Notice", leave Action set to None. Set first_check to this Code: Code: // Variables int minimumPlayers = 8; // you can change this number // You can change these messages also: String warningMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; // Code String key = "LowPopCount"; int last = 0; if (plugin.RoundData.issetInt(key)) last = plugin.RoundData.getInt(key); plugin.RoundData.setInt(key, server.PlayerCount); if (last <= minimumPlayers) return false; if (server.PlayerCount > minimumPlayers) return false; plugin.SendGlobalMessage(warningMessage); return false; Man you're on a roll today So if I want to limit vehicle kills until at least 16 players on a 32 player server, then use this limit would be best? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 15, 2014 Author Share Posted January 15, 2014 Originally Posted by Talzac*: Can it be done some kind of filtering? Now if killing with the mortars and the stationary heavy machine gun also is punished. Can we make some kind of filter for those weapons with weapon codes? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 16, 2014 Author Share Posted January 16, 2014 Originally Posted by PapaCharlie9*: Man you're on a roll today So if I want to limit vehicle kills until at least 16 players on a 32 player server, then use this limit would be best? You need to use all three limits in this thread, but yes, just change the minimumPlayers variable to 16. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 16, 2014 Author Share Posted January 16, 2014 Originally Posted by PapaCharlie9*: Can it be done some kind of filtering? Now if killing with the mortars and the stationary heavy machine gun also is punished. Can we make some kind of filter for those weapons with weapon codes?If the "stationary heavy machine gun" has a weapon code, sure, you can filter for that. I don't think that weapon has a code, though, but if you can find it, post it. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 2, 2014 Author Share Posted April 2, 2014 Originally Posted by Talzac*: Hi, It seems this have stopped working now? They can kill with vehicles. Is this because they have added vehicles weapon codes now? Can you please help us repair this code again? Thanks * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 2, 2014 Author Share Posted April 2, 2014 Originally Posted by TMiland*: Try this for the first limit: Code: // Variables int minimumPlayers = 8; // you can change this number int warningCount = 2; // you can change this number int adminKillCount = 2; // you can change this number int kickCount = 3; // you can change this number // You can change these messages also: String warningMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; String kickMessage = "ignored warnings about no vehicle kills"; // Code if (!Regex.Match(kill.Category, @"(Vehicle)").Success) return false; if (killer.Name == victim.Name) return false; if (killer.Name == "Server") return false; if (server.PlayerCount > minimumPlayers) return false; String prefix = "LowPopVehiclePunisher_"; String key = prefix + killer.Name; int count = 0; if (plugin.RoundData.issetInt(key)) count = plugin.RoundData.getInt(key); count = count + 1; plugin.RoundData.setInt(key, count); if (kickCount < 1) kickCount = 1; if (warningCount >= kickCount) warningCount = kickCount - 1; if (adminKillCount >= kickCount) adminKillCount = kickCount - 1; if (count >= kickCount) { String tmp = "Kicking " + killer.Name + " killed " + victim.Name + " with " + kill.Weapon + ", reason: " + kickMessage; plugin.ConsoleWrite(tmp); plugin.PRoConChat("Insane Limits > " + tmp); plugin.KickPlayerWithMessage(killer.Name, kickMessage); return false; } bool warned = false; if (count <= warningCount) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); warned = true; } if (count <= adminKillCount) { if (!warned) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); } plugin.KillPlayer(killer.Name, 5); } return false;All vehicles are defined in category Vehicle*, where * is Light, Heavy, Air and so on, so Vehicle should cover all vehicles.I have no idea if this works, but test it and see. PC9 Could maybe help us out here. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 2, 2014 Author Share Posted April 2, 2014 Originally Posted by PapaCharlie9*: All vehicles are defined in category Vehicle*, where * is Light, Heavy, Air and so on, so Vehicle should cover all vehicles. I have no idea if this works, but test it and see. PC9 Could maybe help us out here. Looks good to me. I've updated post #1 with the same change. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 2, 2014 Author Share Posted April 2, 2014 Originally Posted by TMiland*: Looks good to me. I've updated post #1 with the same change.Great! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 7, 2015 Author Share Posted January 7, 2015 Originally Posted by BBDK*: Hello Anyone know how to make this work on choppers? Want to limit chopper use on Silk Road and not all vehicles. Tried this code "out of the box" and got this error: Insane Limits] ERROR: (CS0117, line: 37, column: 35): 'PRoConEvents.KillInfoInterface' does not contain a definition for 'Category' * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 7, 2015 Author Share Posted January 7, 2015 Originally Posted by TMiland*: Hello Anyone know how to make this work on choppers? Want to limit chopper use on Silk Road and not all vehicles. Tried this code "out of the box" and got this error: Insane Limits] ERROR: (CS0117, line: 37, column: 35): 'PRoConEvents.KillInfoInterface' does not contain a definition for 'Category' You have it set to OnKill right? And have the latest version of Insane Limits? You could try this, but take it with a warning, that i am not 100% sure it's going to work: Code: // Variables int minimumPlayers = 8; // you can change this number int warningCount = 2; // you can change this number int adminKillCount = 2; // you can change this number int kickCount = 3; // you can change this number // You can change these messages also: String warningMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; String kickMessage = "ignored warnings about no vehicle kills"; // Code if (Regex.Match(server.MapFileName, @"(_:XP1_001)", RegexOptions.IgnoreCase).Success && (!Regex.Match(kill.Weapon, @"(Z-11w|AH6_Littlebird)", RegexOptions.IgnoreCase).Success)) return false; //if (!Regex.Match(kill.Category, @"(Vehicle)").Success) return false; if (killer.Name == victim.Name) return false; if (killer.Name == "Server") return false; if (server.PlayerCount > minimumPlayers) return false; String prefix = "LowPopVehiclePunisher_"; String key = prefix + killer.Name; int count = 0; if (plugin.RoundData.issetInt(key)) count = plugin.RoundData.getInt(key); count = count + 1; plugin.RoundData.setInt(key, count); if (kickCount < 1) kickCount = 1; if (warningCount >= kickCount) warningCount = kickCount - 1; if (adminKillCount >= kickCount) adminKillCount = kickCount - 1; if (count >= kickCount) { String tmp = "Kicking " + killer.Name + " killed " + victim.Name + " with " + kill.Weapon + ", reason: " + kickMessage; plugin.ConsoleWrite(tmp); plugin.PRoConChat("Insane Limits > " + tmp); plugin.KickPlayerWithMessage(killer.Name, kickMessage); return false; } bool warned = false; if (count <= warningCount) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); warned = true; } if (count <= adminKillCount) { if (!warned) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); } plugin.KillPlayer(killer.Name, 5); } return false;This will limit AH6_Littlebird & Z-11w on Silk Road (XP1_001), when less than what ever variable you set for "minimumPlayers". * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 7, 2015 Author Share Posted January 7, 2015 Originally Posted by BBDK*: You have it set to OnKill right? And have the latest version of Insane Limits? You could try this, but take it with a warning, that i am not 100% sure it's going to work: Code: // Variables int minimumPlayers = 8; // you can change this number int warningCount = 2; // you can change this number int adminKillCount = 2; // you can change this number int kickCount = 3; // you can change this number // You can change these messages also: String warningMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; String kickMessage = "ignored warnings about no vehicle kills"; // Code if (Regex.Match(server.MapFileName, @"(_:XP1_001)", RegexOptions.IgnoreCase).Success && (!Regex.Match(kill.Weapon, @"(Z-11w|AH6_Littlebird)", RegexOptions.IgnoreCase).Success)) return false; //if (!Regex.Match(kill.Category, @"(Vehicle)").Success) return false; if (killer.Name == victim.Name) return false; if (killer.Name == "Server") return false; if (server.PlayerCount > minimumPlayers) return false; String prefix = "LowPopVehiclePunisher_"; String key = prefix + killer.Name; int count = 0; if (plugin.RoundData.issetInt(key)) count = plugin.RoundData.getInt(key); count = count + 1; plugin.RoundData.setInt(key, count); if (kickCount < 1) kickCount = 1; if (warningCount >= kickCount) warningCount = kickCount - 1; if (adminKillCount >= kickCount) adminKillCount = kickCount - 1; if (count >= kickCount) { String tmp = "Kicking " + killer.Name + " killed " + victim.Name + " with " + kill.Weapon + ", reason: " + kickMessage; plugin.ConsoleWrite(tmp); plugin.PRoConChat("Insane Limits > " + tmp); plugin.KickPlayerWithMessage(killer.Name, kickMessage); return false; } bool warned = false; if (count <= warningCount) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); warned = true; } if (count <= adminKillCount) { if (!warned) { plugin.SendPlayerMessage(killer.Name, warningMessage); plugin.PRoConChat("Insane Limits > " + killer.Name + ": " + warningMessage); } plugin.KillPlayer(killer.Name, 5); } return false;This will limit AH6_Littlebird & Z-11w on Silk Road (XP1_001), when less than what ever variable you set for "minimumPlayers".Thx - testing it now :-) * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 8, 2015 Author Share Posted January 8, 2015 Originally Posted by TMiland*: Thx - testing it now :-)Did it work? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 9, 2015 Author Share Posted January 9, 2015 Originally Posted by BBDK*: Did it work? Yes it did - thank you! :-) * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 9, 2015 Author Share Posted January 9, 2015 Originally Posted by TMiland*: Yes it did - thank you! :-)That's great! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 12, 2015 Author Share Posted January 12, 2015 Originally Posted by BBDK*: Another thing.... The spawn warning ( myrcon.net/...insane-limits-punish-for-vehicle-kills-when-not-enough-players#entry48942 ) , from page one... How do I change it from msg to yell? String warningMessage ---> String warningYell? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 12, 2015 Author Share Posted January 12, 2015 Originally Posted by TMiland*: Another thing.... The spawn warning ( myrcon.net/...insane-limits-punish-for-vehicle-kills-when-not-enough-players#entry48942 ) , from page one... How do I change it from msg to yell? String warningMessage ---> String warningYell? You can use f. eksCode: plugin.ServerCommand("admin.yell", warningMessage, "5");where 5 is seconds the yell will be shown. So it would look like this: Code: // Variables int minimumPlayers = 8; // you can change this number // You can change these messages also: String warningMessage = "Vehicle kills will be punished until there are more than " + minimumPlayers + " players!"; // Code String key = "LowPopCount"; int last = 0; if (plugin.RoundData.issetInt(key)) last = plugin.RoundData.getInt(key); plugin.RoundData.setInt(key, server.PlayerCount); if (last <= minimumPlayers) return false; if (server.PlayerCount > minimumPlayers) return false; plugin.SendGlobalMessage(warningMessage); plugin.ServerCommand("admin.yell", warningMessage, "5"); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 12, 2015 Author Share Posted January 12, 2015 Originally Posted by PapaCharlie9*: That's the old-fashioned way. You can do this now: Code: plugin.SendGlobalYell(warningMessage, 5); * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 12, 2015 Author Share Posted January 12, 2015 Originally Posted by TMiland*: That's the old-fashioned way. You can do this now: Code: plugin.SendGlobalYell(warningMessage, 5); Aha, right, i thought it looked odd! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 13, 2015 Author Share Posted January 13, 2015 Originally Posted by BBDK*: so the current code: // Variables int minimumPlayers = 16; // you can change this number - MUST BE THE SAME AS THE OnKill LIMIT! int noticeCount = 2; // you can change this number // You can change this message also: String noticeMessage = "**WARNING** Helicopter will be punished until there are more than " + minimumPlayers + " players!"; // Code if (server.PlayerCount > minimumPlayers) return false; String prefix = "SpawnNotice_"; String key = prefix + player.Name; int count = 0; if (plugin.RoundData.issetInt(key)) count = plugin.RoundData.getInt(key); if (count > noticeCount) return false; count = count + 1; plugin.RoundData.setInt(key, count); plugin.SendPlayerMessage(player.Name, noticeMessage); return false; Should be: // Variables int minimumPlayers = 16; // you can change this number - MUST BE THE SAME AS THE OnKill LIMIT! int noticeCount = 2; // you can change this number // You can change this message also: String noticeMessage = "**WARNING** Helicopter will be punished until there are more than " + minimumPlayers + " players!"; // Code if (server.PlayerCount > minimumPlayers) return false; String prefix = "SpawnNotice_"; String key = prefix + player.Name; int count = 0; if (plugin.RoundData.issetInt(key)) count = plugin.RoundData.getInt(key); if (count > noticeCount) return false; count = count + 1; plugin.RoundData.setInt(key, count); plugin.SendGlobalYell(warningMessage, 5); return false; ? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 13, 2015 Author Share Posted January 13, 2015 Originally Posted by TMiland*: That should work. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 23, 2015 Author Share Posted January 23, 2015 Originally Posted by )RAG()N*: Is it posable to get this to not spawn vehicles until there is a set number of players ? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted January 23, 2015 Author Share Posted January 23, 2015 Originally Posted by BBDK*: That should work. [13:44:22 51] [insane Limits] Compiling Limit #7 - Spawn Notice - OnSpawn[13:44:22 55] [insane Limits] ERROR: 1 error compiling Code [13:44:22 55] [insane Limits] ERROR: (CS0103, line: 48, column: 35): The name 'warningMessage' does not exist in the current context * 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.