Jump to content

Insane Limits - Examples


ImportBot

Recommended Posts

Originally Posted by PhaxeNor*:

 

I was wondering if I can do a MAV shame like the knife just not sure where to get the mav name from?

 

Regex.Match(kill.Weapon, "(Melee|Knife)").Success need MAV name.

 

Thanks,

 

jt

Only way is to use ROADKILL

 

MAV doesn't have its own name yet.

* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 1.4k
  • Created
  • Last Reply

Originally Posted by Klarwasser*:

 

Is it possible to implement an Admin Online Check?

 

Every XXXX Seconds checks for players in the White List and Say Admin(s) Mr.A, Mr.B, Mr.C are currently online.

Is something like that possible?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ghostfighter777*:

 

This is a great idea. Some care would be needed to make sure only certain players (admins) can use that command, but I think it's something everyone would find useful. I think it can be done with plugin.setPluginVarValue. For example, if the command were:

 

!limit 3 Disabled

 

(same meaning as your !ESL OFF 3), I think this code would work (NOT REAL CODE, DO NOT TRY TO COMPILE!):

 

Code:

String id = ... the number parsed out of the chat command ...
String state = ... the state, Enabled/Disabled/Virtual, parsed out of the chat command ...
String limitName = "limit_" + id + "_state";
plugin.setPluginVarValue(limitName, state);
Better still would be if a future version of Insane Limits just made this an Action, with a corresponding function on the Plugin object, with parameters for limit id and the desired state. So yet another wish list item!
It's easy, just apply a filter with the names of admins

 

otherwise continuing on disabling limits, could disable a procon plugins and enable them again?

 

I love this plugin, you can do almost everything, congratulations to the author:smile:

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Wow! This is a great plugin.

 

How do I make a server spam message wich pop up every 5 minutes?

First of all, every 5 minutes is pretty noisy. You sure you want 5 minutes? I never do any scrolling chat with a frequency of less than every 15 minutes.

 

See this post: http://www.phogue.net/forumvb/showth...6996#post36996*

 

Use a pb_sv_task and add it to your pbsvuser.cfg. That's the preferred way and works whether you have the plugin or PRoCon running or not.

 

Don't know what a pb_sv_task or pbsvuser.cfg is? Every admin should know the basics about RCON and PunkBuster commands, particularly if you want to make your own limits with Insane Limiter, so familiarize yourself with this documentation:

 

RCON:

http://static.cdn.ea.com/dice/u/f/bf...inistrator.zip

See the "BF3 PC Server Remote Administration Protocol.pdf" file, Client Commands section.

 

PunkBuster:

http://www.evenbalance.com/publicati...c-ad/index.htm

 

Steps to add scrolling chat messages follow. REQUIREMENTS: access to your PunkBuster configuration file folder on your game server, ability to read/write the contents of PB config files, a pbsv.cfg file already exists -- if it doesn't, your config directory isn't properly setup yet and this may not work.

 

1) If you already have a pbsvuser.cfg, skip to step 4

 

2) To create a pbsvuser.cfg, either use your RSP access to create or ftp upload a file, or, from the PunkBuster console window (PRoCon Console tab, PunkBuster tab), type this command (NOTE: This overwrites/destroys any existing pbsvuser.cfg file, so be sure you don't already have one!):

 

pb_sv_writecfg pbsvuser.cfg

 

Then IMMEDIATELY use your RSP access to replace all of the contents of the pbsvuser.cfg file with Step 3. If you don't do this, you might start seeing double commands and other weird PunkBuster stuff.

 

3) Initialize the contents of the pbsvuser.cfg file with this header comment, as a reminder to yourself how to format tasks:

 

Code:

; Put task customizations here
; ------------------------------
; PB Tasks (pb_sv_task [start delay (seconds)] [repeat (seconds)] [command])
; ------------------------------
4) At the end of the file, add a new pb_sv_task line. Use the format described in Step 3. So, for example, let's say you want to advertise Insane Limits every 15 minutes with a message like "=== This server is protected by Insane Limits! ===". All times in pb_sv_task are expressed in seconds, so you have to convert 15 minutes to seconds by multiplying by 60, which is 900. Let's also say you want the very first message to come 20 minutes after a reboot, so 20 times 60 is 1200. Now you have everything you need to add the scrolling message. Add this line:

 

pb_sv_task 1200 900 admin.say "=== This server is protected by Insane Limits! ==="

 

The "double quotes" around the message are required.

 

5) Reboot your game server or restart just PunkBuster by typing this command into the ProCon PunkBuster command line:

 

pb_sv_restart

 

=======

 

That's it. You can add one pb_sv_task for each message you want to scroll.

 

The difference between the delay values is the time between messages. So, if you want "Test 1!" and "Test 2!" to show up 10 seconds apart, you would do something like this:

 

pb_sv_task 600 300 admin.say "Test 1!"

pb_sv_task 610 300 admin.say "Test 2!"

 

610 - 600 is 10 seconds, so Test 2 will show up 10 seconds after Test 1.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Chimera76*:

 

This limit will say server rules to the player on request when the player type !rules

Really nice feature which I use for our server. Is there a way to change the code, expressions etc so that the rules are only "spammed" to the player who asked for instead everyone? Would be great! Thanks.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PhaxeNor*:

 

Really nice feature which I use for our server. Is there a way to change the code, expressions etc so that the rules are only "spammed" to the player who asked for instead everyone? Would be great! Thanks.

With the current RCON protocol it is not possible to send messages to single players. The one in my example only sends it to the SQUAD, so MAX 4 people will see this when its requested.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

So first off, looks like my experiment to use a separate thread to discuss a more complicated example* is a bust. Even I found it it a PITA to look there, LOL. So I'm bringing it back here.

 

Quick Summary: I want an in-game command _victims to show my top 3 victims and _killers to show my top 3 killers.

 

I wrote up all the code. The OnJoin and OnKill bookeeping is pretty straightforward (with the patch for bool casting). The OnAnyChat that enables asking for _killers or _victims (and eventually _versus {player}, but not implemented in this yet) was the big one, mostly just for parsing the command. My noob C# skills probably show through here, maybe there's a more concise way of writing this? I tried to use LINQ to do the sort, but looks like PRoCon doesn't have that assembly.

 

Rather than have a gigantic post of code blocks, I just attached the dump limits files.

 

Limit 2 is the OnJoin initializer.

 

Limit 3 is the OnKill tracker.

 

Limit 4 is the OnAnyChat command executive.

 

Let me know if there is anything I could do better! This all compiles, but I haven't tried it on a live server yet. It also isn't hooked up to chat back yet, just dumps debug stuff to the log.

 

LimitEvaluator2.cs.txt

LimitEvaluator3.cs.txt

LimitEvaluator4.cs.txt

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

Set limit to evaluate OnKill and action to None

 

Set first_check to this Expression

Code:

( true )
Set second_check to this Code

 

Code:

Dictionary<int, String> kmessage = new Dictionary<int, String>();
	kmessage.Add(4, "[SPREE] %p_n% with %r_x% kills!");
	kmessage.Add(5, "[RAMPAGE] %p_n% with %r_x% kills!");
	kmessage.Add(6, "[DOMINATION] %p_n% with %r_x% kills!");
	kmessage.Add(7, "[UNSTOPPABLE] %p_n% with %r_x% kills!");
	kmessage.Add(8, "[GODLIKE] %p_n% with %r_x% kills!");
	kmessage.Add(9, "[LEGENDARY] %p_n% with %r_x% kills!");
	
	Dictionary<int, String> vmessage = new Dictionary<int, String>();
	vmessage.Add(4, "%k_n% ended %v_n%'s killing spree!");
	vmessage.Add(5, "%k_n% ended %v_n%'s rampage!");
	vmessage.Add(6, "%k_n% ended %v_n%'s domination!");
	vmessage.Add(7, "%k_n% ended %v_n%'s unstoppable kill streak!");
	vmessage.Add(8, "%k_n% ended %v_n%'s godlike kill streak!");
	vmessage.Add(9, "%k_n% ended %v_n%'s legendary kill streak!");

	List<int> vkeys = new List<int>(vmessage.Keys);
	List<int> kkeys = new List<int>(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;
the end kill streak isnt working... i just changed the kill counts and the messages...

Code:

Dictionary<int, String> kmessage = new Dictionary<int, String>();
	kmessage.Add(5, "[KILLING SPREE] %p_n% - %r_x% kill streak!");
	kmessage.Add(10, "[RAMPAGE] %p_n% - %r_x% kill streak!");
	kmessage.Add(15, "[DOMINATION] %p_n% - %r_x% kill streak!");
	kmessage.Add(20, "[UNSTOPPABLE] %p_n% - %r_x% kill streak!");
	kmessage.Add(25, "[GODLIKE] %p_n% - %r_x% kill streak!");
	kmessage.Add(30, "[LEGENDARY] %p_n% - %r_x% kill streak!");
	
	Dictionary<int, String> vmessage = new Dictionary<int, String>();
	vmessage.Add(5, "%k_n% ended %v_n%'s %r_x% kill streak killing spree!");
	vmessage.Add(10, "%k_n% ended %v_n%'s %r_x% kill streak rampage!");
	vmessage.Add(15, "%k_n% ended %v_n%'s %r_x% kill streak domination!");
	vmessage.Add(20, "%k_n% ended %v_n%'s %r_x% kill streak unstoppable kill streak!");
	vmessage.Add(25, "%k_n% ended %v_n%'s %r_x% kill streak godlike kill streak!");
	vmessage.Add(30, "%k_n% ended %v_n%'s %r_x% kill streak legendary kill streak!");

	List<int> vkeys = new List<int>(vmessage.Keys);
	List<int> kkeys = new List<int>(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;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

the end kill streak isnt working... i just changed the kill counts and the messages...

The way the example is written it does not support jumps/holes. The count-values have to be continuous. 15,16, 17, etc. Not 15, 20, 25. I will fix the example for next version to support jumps/holes.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

First of all, every 5 minutes is pretty noisy. You sure you want 5 minutes? I never do any scrolling chat with a frequency of less than every 15 minutes.

 

See this post: http://www.phogue.net/forumvb/showth...6996#post36996*

 

Use a pb_sv_task and add it to your pbsvuser.cfg. That's the preferred way and works whether you have the plugin or PRoCon running or not.

 

Don't know what a pb_sv_task or pbsvuser.cfg is? Every admin should know the basics about RCON and PunkBuster commands, particularly if you want to make your own limits with Insane Limiter, so familiarize yourself with this documentation:

 

RCON:

http://static.cdn.ea.com/dice/u/f/bf...inistrator.zip

See the "BF3 PC Server Remote Administration Protocol.pdf" file, Client Commands section.

 

PunkBuster:

http://www.evenbalance.com/publicati...c-ad/index.htm

 

Steps to add scrolling chat messages follow. REQUIREMENTS: access to your PunkBuster configuration file folder on your game server, ability to read/write the contents of PB config files, a pbsv.cfg file already exists -- if it doesn't, your config directory isn't properly setup yet and this may not work.

 

1) If you already have a pbsvuser.cfg, skip to step 4

 

2) To create a pbsvuser.cfg, either use your RSP access to create or ftp upload a file, or, from the PunkBuster console window (PRoCon Console tab, PunkBuster tab), type this command (NOTE: This overwrites/destroys any existing pbsvuser.cfg file, so be sure you don't already have one!):

 

pb_sv_writecfg pbsvuser.cfg

 

Then IMMEDIATELY use your RSP access to replace all of the contents of the pbsvuser.cfg file with Step 3. If you don't do this, you might start seeing double commands and other weird PunkBuster stuff.

 

3) Initialize the contents of the pbsvuser.cfg file with this header comment, as a reminder to yourself how to format tasks:

 

Code:

; Put task customizations here
; ------------------------------
; PB Tasks (pb_sv_task [start delay (seconds)] [repeat (seconds)] [command])
; ------------------------------
4) At the end of the file, add a new pb_sv_task line. Use the format described in Step 3. So, for example, let's say you want to advertise Insane Limits every 15 minutes with a message like "=== This server is protected by Insane Limits! ===". All times in pb_sv_task are expressed in seconds, so you have to convert 15 minutes to seconds by multiplying by 60, which is 900. Let's also say you want the very first message to come 20 minutes after a reboot, so 20 times 60 is 1200. Now you have everything you need to add the scrolling message. Add this line:

 

pb_sv_task 1200 900 admin.say "=== This server is protected by Insane Limits! ==="

 

The "double quotes" around the message are required.

 

5) Reboot your game server or restart just PunkBuster by typing this command into the ProCon PunkBuster command line:

 

pb_sv_restart

 

=======

 

That's it. You can add one pb_sv_task for each message you want to scroll.

 

The difference between the delay values is the time between messages. So, if you want "Test 1!" and "Test 2!" to show up 10 seconds apart, you would do something like this:

 

pb_sv_task 600 300 admin.say "Test 1!"

pb_sv_task 610 300 admin.say "Test 2!"

 

610 - 600 is 10 seconds, so Test 2 will show up 10 seconds after Test 1.

the 1 thing i cant find is a way to do a bf2 like msgs...

 

300 Line 1

0 Line 2

0 Line 3

0 Line 4

300 Line 1

0 Line 2

0 Line 3

0 Line 4

300 Line 1

0 Line 2

0 Line 3

0 Line 4

300 Line 1

0 Line 2

0 Line 3

0 Line 4

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Froz3nTundra*:

 

Is it possible to write a limit to discern between between guys and gals who are playing? For example, so and so killed his/herself, that sort of thing. Obviously you'd need to know who's who ahead of time so this limit would be based upon playername.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

Is it possible to write a limit to discern between between guys and gals who are playing? For example, so and so killed his/herself, that sort of thing. Obviously you'd need to know who's who ahead of time so this limit would be based upon playername.

Where can you see male/female? I am not sure if battlelog shows that information publicly.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Froz3nTundra*:

 

Where can you see male/female? I am not sure if battlelog shows that information publicly.

Well there may be public info in that regard but I'm speaking more of having prior knowledge of the player,who's been on before.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

The way the example is written it does not support jumps/holes. The count-values have to be continuous. 15,16, 17, etc. Not 15, 20, 25. I will fix the example for next version to support jumps/holes.

ok cool please let us know when the jump is fixed. ill increase the values like in the quote above so it doesnt spam. thank you!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

ok cool please let us know when the jump is fixed. ill increase the values like in the quote above so it doesnt spam. thank you!

Fixed already, works with 0.0.0.6. ( 0.0.0.7 not out yet though)
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by WaxMyCarrot*:

 

I am getting this exception.. any thoughts?

 

[20:44:36] [insane Limits] EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

[20:44:36] [insane Limits] Extra information dumped in file InsaneLimits.dump

 

 

Console log

http://dl.dropbox.com/u/27936758/Stu...14_console.txt

 

plugin log

http://dl.dropbox.com/u/27936758/Stu...114_plugin.txt

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

I am getting this exception.. any thoughts?

 

[20:44:36] [insane Limits] EXCEPTION: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

[20:44:36] [insane Limits] Extra information dumped in file InsaneLimits.dump

 

 

Console log

http://dl.dropbox.com/u/27936758/Stu...14_console.txt

 

plugin log

http://dl.dropbox.com/u/27936758/Stu...114_plugin.txt

What does the dump show? What's the limit #/Name that's causing this?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

Is this the file you need? If not where would the dump file be?

 

Not sure what limit it is.. I have attached the console and plugin logs in the last post.. you can find this exception throughout the plugin log.

 

http://dl.dropbox.com/u/27936758/Stuff/DEBUG.txt

No, I need InsaneLimits.dump, not DEBUG.txt. Anyway, I don't think that file will help much. The important thing is identify which limit is raising those exceptions. (I think it's your Kill-Streak limit). In next version, I am adding information to be able to identify which limit causes a dump.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

This limit will check the number of players in the server at specific intervals of time, and depending on how many players are there in the server, it will enable/disable vehicle spawn by changing the value of "vars.vehicleSpawnAllowed". This change is in effect immediately, no need to wait for next round. However, this only applies to attack vehicles. Transport vehicles will still spawn.

 

 

Set limit to evaluate OnInterval, and set action to None

 

Set first_check to use this Code snippet:

 

Code:

if (server.PlayerCount < 8 )
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "false");
else
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "true");
In this case, if number of players in the server falls below 8, vehicles are disabled. As soon as it goes to or over 8, vehicles are re-enabled. You may change this value as you see fit.

 

Also note that when you turn off vehicle spawn, your server may not be listed in Battlelog as Hard-core. Additionally, disabling vehicles can reportedly interfere with Battlelog's Quick Match option.

omg i totally missed this example. dude im disabling/removing a bunch of plugins because your plugin is so far close to an all-in-1. THANK YOU!!!!!!!!!!!!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by mezzovide*:

 

I've been meaning to ask about this :

 

Code:

Regex.Match(kill.Weapon, @"m320|smaw|rpg", RegexOptions.IgnoreCase).Success
is it possible to recognize m320 smoke / buck / mass so this one dont kick/ban ppl using m320 smoke accidentally killing someone. Thx.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

I've been meaning to ask about this :

 

Code:

Regex.Match(kill.Weapon, @"m320|smaw|rpg", RegexOptions.IgnoreCase).Success
is it possible to recognize m320 smoke / buck / mass so this one dont kick/ban ppl using m320 smoke accidentally killing someone. Thx.
There is one problem in your regular expression, it's missing the parenthesis around the group.

 

Code:

Regex.Match(kill.Weapon, @"[b]([/b]m320|smaw|rpg[b])[/b]", RegexOptions.IgnoreCase).Success
As far as distinguishing between different types of m320, I am not sure, I have to check what are the weapon names that the server sends when killing with those.

 

If you have time, you can check it yourself. Go on your server, and kill some-one with one of those m320 variations. Then inside the plugin run this command (in the console field)

 

Code:

!weapon round stats mezzovide
It should tell you all the names of all the weapons you have made kills with.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

This limit detects when a player has no Battlelog account. Each time the player spawns, it warns him that he will be kicked. It tells him how much time he has left. After five minutes expires, the player is kicked.

 

Set limit to evaluate OnSpawn, and action to None

 

Set first_check to this Expression

 

Code:

player.Battlelog404 == true
Set second_check to this Code

 

Code:

int minutes = 5;
      TimeSpan remain = TimeSpan.FromMinutes(5).Subtract(DateTime.Now.Subtract(player.JoinTime));
      
      if ( remain.TotalSeconds > 0 )
          plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name looks like you don't have a Battlelog account. You have " + plugin.FriendlySpan(remain) + " before being kicked"));
      else
      {
          plugin.SendGlobalMessage(plugin.R("player.Name was kicked for not having a Battlelog account"));
          plugin.KickPlayerWithMessage(player.Name, plugin.R("player.Name, you were kicked for not having a Battelog account"));
      }
      return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

This limit allows players to use In-Game command "!voteban ". Players can vote as many times they want, and against as many players they want. The are no time or concurrency restrictions. However, votes are only counted once (you can only vote once against a certain player). If any player accumulates votes from more than 50% of all players in the server, that player is banned. All votes are reset at the end of a round. The player name does not have to be a full-name. It can be a sub-string or misspelled name.

 

For this example, a Temporary PBBan is used with 24 hours. You can adjust the percentage, and the ban time (in minutes).

 

Set limit to evaluate OnAnyChat, set action to None

 

Set first_check to this Code

Code:

double percent = 50;     
double minutes = 24*60; 

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match banMatch = Regex.Match(command, @"^voteban\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-ban */
if (!banMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(banMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;
    
if (target.Name.Equals(player.Name))
{
    plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, you cannot vote-ban yourself!"));
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("voteban"))
    player.DataRound.setObject("voteban", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("voteban");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("voteban"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("voteban");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1)
   plugin.SendGlobalMessage(target.Name + " is about to get vote-banned, 1 more vote needed");
else if (remain > 0)
   plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to ban"));

if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-ban " + target.Name + ", " + remain + " more votes needed");
   
if (votes >= needed)
{
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"") + ", for " + plugin.FriendlySpan(TimeSpan.FromMinutes(minutes));
    String message = target.Name + " was vote-banned " + count;
    plugin.SendGlobalMessage(message);
    plugin.ConsoleWrite(message);
    plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, target.Name, (int) minutes, target.Name + ", you were vote-banned " + count);
    return true;
}

return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by mezzovide*:

 

Code:

Regex.Match(kill.Weapon, @"[b]([/b]m320|smaw|rpg[b])[/b]", RegexOptions.IgnoreCase).Success
You probably should edit this post too myrcon.net/...insane-limits-examples#entry18504 since ive just copy paste from there.

 

If you have time, you can check it yourself. Go on your server, and kill some-one with one of those m320 variations.

gonna check after this, thx.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

This limit allows players to use In-Game command "!votekick ". Players can vote as many times they want, and against as many players they want. The are no time or concurrency restrictions. However, votes are only counted once (you can only vote once against a certain player). If any player accumulates votes from more than 50% of all players in the server, that player is kicked. All votes are reset at the end of a round. The player name does not have to be a full-name. It can be a sub-string or misspelled name.

 

Set limit to evaluate OnAnyChat, set action to None

 

Set first_check to this Code

Code:

double percent = 50;

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-kick */
if (!kickMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;
    
if (target.Name.Equals(player.Name))
{
    plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, you cannot vote-kick yourself!"));
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("votekick"))
    player.DataRound.setObject("votekick", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("votekick"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1)
   plugin.SendGlobalMessage(target.Name + " is about to get vote-kicked, 1 more vote needed");
else if (remain > 0)
   plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"));

if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");

if (votes >= needed)
{
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    String message = target.Name + " was vote-kicked " + count ;
    plugin.SendGlobalMessage(message);
    plugin.ConsoleWrite(message);
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
    return true;
}

return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

You probably should edit this post too myrcon.net/...insane-limits-examples#entry18504 since ive just copy paste from there.

 

gonna check after this, thx.

Thanks, I have edited it. Note that a lot of the conversations In-Between examples, I will remove later on. Once a question/discussion is resolved, I will remove traces of the question/discussion so that only examples remain.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

This limit detects when a player switches team with less than 20% tickets left (before end of round) in either team. If the player moved to the losing team, he gets a cheer. If the player moved to the winning team he's moved back.

 

Set limit to evaluate OnTeamChanged and action to None

 

Set first_check to this Expression:

 

Code:

team1.RemainTicketsPercent < 20 || team2.RemainTicketsPercent < 20
Set second_check to this Code:

 

Code:

/* check if tickets are the same, do nothing */
if (team1.Tickets == team2.Tickets)
    return false;

/* find which team is losing */
TeamInfoInterface loseTeam = ( team1.Tickets > team2.Tickets)_ team2:team1;

/* check which team the player moved to */
if (player.TeamId  == loseTeam.TeamId)
   plugin.SendGlobalMessage(plugin.R("Cheers to player.Name for moving to help losing team!"));
else
{
    plugin.SendGlobalMessage(plugin.R("player.Name switched to Winning team, moving him back!"));
    plugin.MovePlayer(player.Name, loseTeam.TeamId, 0, true);
}

return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ango*:

 

First of all, every 5 minutes is pretty noisy. You sure you want 5 minutes? I never do any scrolling chat with a frequency of less than every 15 minutes.

 

See this post: http://www.phogue.net/forumvb/showth...6996#post36996*

 

Use a pb_sv_task and add it to your pbsvuser.cfg. That's the preferred way and works whether you have the plugin or PRoCon running or not.

 

Don't know what a pb_sv_task or pbsvuser.cfg is? Every admin should know the basics about RCON and PunkBuster commands, particularly if you want to make your own limits with Insane Limiter, so familiarize yourself with this documentation:

 

RCON:

http://static.cdn.ea.com/dice/u/f/bf...inistrator.zip

See the "BF3 PC Server Remote Administration Protocol.pdf" file, Client Commands section.

 

PunkBuster:

http://www.evenbalance.com/publicati...c-ad/index.htm

 

Steps to add scrolling chat messages follow. REQUIREMENTS: access to your PunkBuster configuration file folder on your game server, ability to read/write the contents of PB config files, a pbsv.cfg file already exists -- if it doesn't, your config directory isn't properly setup yet and this may not work.

 

1) If you already have a pbsvuser.cfg, skip to step 4

 

2) To create a pbsvuser.cfg, either use your RSP access to create or ftp upload a file, or, from the PunkBuster console window (PRoCon Console tab, PunkBuster tab), type this command (NOTE: This overwrites/destroys any existing pbsvuser.cfg file, so be sure you don't already have one!):

 

pb_sv_writecfg pbsvuser.cfg

 

Then IMMEDIATELY use your RSP access to replace all of the contents of the pbsvuser.cfg file with Step 3. If you don't do this, you might start seeing double commands and other weird PunkBuster stuff.

 

3) Initialize the contents of the pbsvuser.cfg file with this header comment, as a reminder to yourself how to format tasks:

 

Code:

; Put task customizations here
; ------------------------------
; PB Tasks (pb_sv_task [start delay (seconds)] [repeat (seconds)] [command])
; ------------------------------
4) At the end of the file, add a new pb_sv_task line. Use the format described in Step 3. So, for example, let's say you want to advertise Insane Limits every 15 minutes with a message like "=== This server is protected by Insane Limits! ===". All times in pb_sv_task are expressed in seconds, so you have to convert 15 minutes to seconds by multiplying by 60, which is 900. Let's also say you want the very first message to come 20 minutes after a reboot, so 20 times 60 is 1200. Now you have everything you need to add the scrolling message. Add this line:

 

pb_sv_task 1200 900 admin.say "=== This server is protected by Insane Limits! ==="

 

The "double quotes" around the message are required.

 

5) Reboot your game server or restart just PunkBuster by typing this command into the ProCon PunkBuster command line:

 

pb_sv_restart

 

=======

 

That's it. You can add one pb_sv_task for each message you want to scroll.

 

The difference between the delay values is the time between messages. So, if you want "Test 1!" and "Test 2!" to show up 10 seconds apart, you would do something like this:

 

pb_sv_task 600 300 admin.say "Test 1!"

pb_sv_task 610 300 admin.say "Test 2!"

 

610 - 600 is 10 seconds, so Test 2 will show up 10 seconds after Test 1.

Thank you for the explanation how to do the server spam message with punkbuster. The 5 minutes spam was only an example. I cant do this with punkbuster because I dont have access to it.

 

I thought it would be easier with insane limits and the check_interval command, but I dont know how to do this.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

Thank you for the explanation how to do the server spam message with punkbuster. The 5 minutes spam was only an example. I cant do this with punkbuster because I dont have access to it.

 

I thought it would be easier with insane limits and the check_interval command, but I dont know how to do this.

You can run punk-buster command from within ProCon (if you have the required privileges). Look under, Console Tab > PunkBuster Console Sub-Tab.

 

Spambot style limits will be available with 0.0.0.8.

* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.




  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.