Jump to content

Insane Limits - Examples


Recommended Posts

Originally Posted by noobsrus*:

 

@PapaCharlie9

 

Wondering if you could help me with a limit I'm trying to create....

 

Pretty basic I just want it to send a Welcome Message to the player in a Yell for about 3-5 seconds....

vars.serverMessage "Welcome to Noobs R Us Battlefield 3 Conquest Server! Visit @ http://www.noobs-r-us.co.uk" (my example we use) you can add this in procon console or in your game server when the player joins the server it will yell this to the player :smile:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Fl0ppyF*:

 

I currently run a weapon limiter on our Shotgun P/K only TDM server, and want to change the output messages from say commands to pyell commands so the chatbox box doesn't get spammed so much. The server is pretty much full the whole day but a lot of players either don't read the server name, or think they won't get punished using other weapons.

 

Can somone help me changing the code since I'm not capable of doing it myself. I know how to setup limits, and change variables for admin lists or chat message output, but when it comes to coding I've no clue at all.

 

Here's the code:

 

limit_evaluation OnKill

 

first check Expression

Code:

! Regex.Match(kill.Weapon, @"(M1911|M9|M93R|Taurus|MP412REX|MP443|Glock|M67|870MCS|M1014|DAO-12|M26Mass|Melee|KNIFE|Siaga20k)", RegexOptions.IgnoreCase).Success
second check Code

Code:

if (limit.Data.issetBool(player.Name))
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!"));
     plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n% on a Shotgun, Pistol, Knife server"));
     limit.Data.unsetBool(player.Name);
  }
  
  int count = (int) limit.Activations(player.Name);
   
  if (count == 1)
  {
      plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!!! Only Shotgun, Pistol, Knife allowed!!! "));
      plugin.KillPlayer(player.Name);
  }
  else if (count == 2)
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been kicked for using %w_n%"));
     plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using %w_n% on a Shotgun, Pistol, Knife server"));
     
     if (!limit.Data.issetBool(player.Name))
         limit.Data.setBool(player.Name, true);
  }
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Dudenell*:

 

haven't tested this but this should use yell to the player + put in the chat warning the player about the weapon use. This will stay on screen for 15 seconds. you can lower the number by changing 15 to another number

 

Code:

if (limit.Data.issetBool(player.Name))
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!"));
     plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n% on a Shotgun, Pistol, Knife server"));
     limit.Data.unsetBool(player.Name);
  }
  
  int count = (int) limit.Activations(player.Name);
   
  if (count == 1)
  {
      plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!!! Only Shotgun, Pistol, Knife allowed!!! "));
	  plugin.ServerCommand("admin.yell", ("%p_n% do not use %w_n%!!! Only Shotgun, Pistol, Knife allowed!!!"), "15", "player", player.Name);
      plugin.KillPlayer(player.Name);
  }
  else if (count == 2)
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been kicked for using %w_n%"));
     plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using %w_n% on a Shotgun, Pistol, Knife server"));
     
     if (!limit.Data.issetBool(player.Name))
         limit.Data.setBool(player.Name, true);
  }
If you do not want it to be sent to the player directly (squad) then remove this line)

Code:

plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!!! Only Shotgun, Pistol, Knife allowed!!! "));
This will only yell to the specific player in question causing the issue. The yell really shouldn't be sent to all the people in the server.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Dudenell*:

 

micovery disrecommends using limit.Data for anything. It has to do with the lifetime of limits. I used to use limit.Data and limit.RoundData, so you might have copied that from me. Recommendation: change all your limit.Data to server.Data.

actually I grabbed that from one of micovery's previous examples.

 

The comment "Checks to see if the player is banned during the current round. If so the player will be kicked." says the opposite of what the code does. :smile:

I believed I fixed it, will post updated code a little later.

 

For consistency, you should change all player.Name to killer.Name.

now I did this with ALL the player.Name entries in the code, no errors so far but I guess I'm surprised there was not any conflict with any other mods

 

As Mootart discovered, clays can do multiple kills in a single second, so your limit.Activations count might actually be 2, 3, or 4 on a single activation of the limit. If you don't mind that no change is needed, but if you do, you need something like the code that was in the xFantasyGirlx example, where a TimeSpan is used to collect and ignore all activations in a short number of seconds (5 is probably too long, 2 is plenty). Once in place, you need to use a server.Data counter of your own, since the limit.Activations count is no longer reliable in that case.

yeah I noticed it, one of the reasons I have 2 punishes before it kicks the player on the 3rd. I could do this also but I'm a little lazy :P

 

Finally, the way the code is written, once the player is kicked, any subsequent kills with a clay on the current or subsequent round will result in a ban. Since you are using Data, everything is remembered until the plugin is disabled. If you want counts to be forgotten/reset every round, use RoundData.

you meant a temp ban right? as far as I know after this fix (code below) it should just temp ban the player for 15 using pb if they use a clay the same round, if they come back though and go through all 6 claymores again they will get banned the second time.

 

Code:

String kCounter = killer.Name + "_TreatAsOne_Count";
	int kicks = 0;
	int count = (int) limit.Activations(killer.Name);
	
	if (server.Data.issetInt(kCounter)) kicks = server.Data.getInt(kCounter);
	
	//Checks to see if the player is banned during the current round. If so the player will be kicked.
	if (server.RoundData.issetBool(killer.Name))
	{
		plugin.SendGlobalMessage(plugin.R(killer.Name + " has been banned for using claymores after a kick!"));
		plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, killer.Name, 15, plugin.R("You have been banned for 15 minutes for using claymores after a kick"));
		plugin.PRoConChat("ADMIN > " + killer.Name + " Was tempbanned after a kick for claymores");
		server.RoundData.unsetBool(killer.Name);
	}
	
   //under 3 claymores it warns the player as to how many they have. One message will go in the chat box, other is admin yell
   if (count <=  3)
   {	
		plugin.SendSquadMessage(player.TeamId, player.SquadId, (killer.Name + ", you have " + count + " of 3 Claymore kills - more and you will be killed and then kicked"));
		plugin.ServerCommand("admin.yell", (killer.Name + ", you have " + count + " of 3 Claymore kills - more and you will be killed and then kicked"), "10", "player", killer.Name);
   }
   //4 - 5 claymores it will kill the player + send message to server + player in question regarding claymores
   else if (count == 4 || count == 5)
   {
		plugin.SendSquadMessage(player.TeamId, player.SquadId, (killer.Name + ", you have NO Claymore kills left, more and you will be kicked!"));
		plugin.ServerCommand("admin.yell", (killer.Name + ", you have NO Claymore kills left, more and you will be kicked!"), "10", "player", killer.Name);
		plugin.SendGlobalMessage(plugin.R(killer.Name + " has been killed for excessive claymore use!"));
		plugin.PRoConChat("ADMIN > " + killer.Name + " has used " + count + " claymores and has been killed." killer.Name + " has " + kicks " previous kicks");
		plugin.KillPlayer(killer.Name);
   }
   //6 claymores the player will be kicked, message tweeted
   //If the player has a previous kick while procon has been running than it will ban the player.
   else if (count == 6)
   {
		if (kicks == 1)
		{
			//plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Permanent, killer.Name, 0, (killer.Name + " - Banned for excessive claymore use! appeal: rufclan.com"));
			plugin.PBBanPlayerWithMessage(PBBanDuration.Permanent, killer.Name, 0, plugin.R(killer.Name + " - excessive claymore use. rufclan.com"));
			//Custom twitter setting for tweeting kicks / bans
			plugin.Tweet(plugin.R(killer.Name + " was banned for excessive claymore use after a kick! #banned"));
			plugin.SendGlobalMessage(plugin.R(killer.Name + " has been banned for excessive claymore use after a kick!"));
			plugin.PRoConChat("ADMIN > " + killer.Name + " was banned for excessive claymore use!");
		}
		else
		{
			plugin.KickPlayerWithMessage(killer.Name, plugin.R("You have been kicked for using too many claymores"));
			plugin.PRoConChat("ADMIN > " + killer.Name + " Was kicked for excessive claymore use, first kick");
			//Custom twitter setting for tweeting kicks / bans
			plugin.Tweet(plugin.R(killer.Name + " was kicked for excessive claymore use! #kick #noob"));
			plugin.SendGlobalMessage(plugin.R(killer.Name + " has been kicked for excessive claymores"));
				if (!server.RoundData.issetBool(killer.Name))
				server.RoundData.setBool(killer.Name, true);
				server.Data.setInt(kCounter, kicks+1);
		}
	}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Multiple replies, scan the whole post for your answer.

 

Hello, I was looking through the uses for the plugin and I was wondering is there any way you could force gamemodes to different maps like a squad deathmatch on a conquest map for example?

That's not possible, the server won't allow it. The map name + game mode name combine to determine what the physical layout and boundaries are in the game. For example, you can't have a TDM on Kharg that goes all the way from the US carrier to the RU air strip. If you use TDM on Kharg, you just get the warehouse and containers area.

 

 

weird i know i verified but should say m320...

 

basically, like you said, using rare weapons or weapons that are hard to get kills with like eod bots, mav's, even the whores that claymore, knife, and c4 in my case. just a little kill-streak style of messages except not in streaks, more of kills used with that weapon in a round. i used that other rulez plugin that did that but forgot about it when switching to insanelimits.

 

i counted them by 5's or 10's. i dont know if it also has the option to count headshots but players liked it.

Yeah, that's easy to do. Tell me exactly what you want the messages to be and I'll make an example. Do you want it like the Unreal kill streak, where you get a different message like "player.Name is DOMINATING with MAV" and "player.Name is OWNING with MAV", or do you want counts shown, like "player.Name has 5 kills with MAV so far"?

 

Yes, no errors! Thx! But i try it on server after work )) And replay here

Progress! Good work, Spectral.

 

vars.serverMessage "Welcome to Noobs R Us Battlefield 3 Conquest Server! Visit @ http://www.noobs-r-us.co.uk" (my example we use) you can add this in procon console or in your game server when the player joins the server it will yell this to the player :smile:

I didn't know that! That's not in the R20 docs but it's a great idea if it works.

 

Disturbed, if you still want an example of how to do it, let me know. It's like a 2 line change to micovery's Welcome example.

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

Originally Posted by PapaCharlie9*:

 

That's almost right. It's missing a plugin.R. See the red corrections below:

 

haven't tested this but this should use yell to the player + put in the chat warning the player about the weapon use. This will stay on screen for 15 seconds. you can lower the number by changing 15 to another number

 

Code:

if (limit.Data.issetBool(player.Name))
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!"));
     plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n% on a Shotgun, Pistol, Knife server"));
     limit.Data.unsetBool(player.Name);
  }
  
  int count = (int) limit.Activations(player.Name);
   
  if (count == 1)
  {
      plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!!! Only Shotgun, Pistol, Knife allowed!!! "));
	  plugin.ServerCommand("admin.yell", [b]plugin.R[/b]("%p_n% do not use %w_n%!!! Only Shotgun, Pistol, Knife allowed!!!"), "15", "player", player.Name);
      plugin.KillPlayer(player.Name);
  }
  else if (count == 2)
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been kicked for using %w_n%"));
     plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using %w_n% on a Shotgun, Pistol, Knife server"));
     
     if (!limit.Data.issetBool(player.Name))
         limit.Data.setBool(player.Name, true);
  }
If you do not only want it to be sent to the player directly (squad) then remove this line)

Code:

plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!!! Only Shotgun, Pistol, Knife allowed!!! "));
This will only yell to the specific player in question causing the issue. The yell really shouldn't be sent to all the people in the server.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Fl0ppyF*:

 

Thank you very much Dudenell and PapaCharlie9!

 

I added the limit with the small correction Papa added, and removed the line so the yell commands gets only send to the player in question. Tested it a few minutes ago and it works flawlessly.

 

Again, thank you both for your time changing the code, and checking it for errors. I really appreciate the effort! :biggrin:

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

Originally Posted by Damien720*:

 

I am trying to setup a hackusations taunting limit to taunt people that cry hack every time they get killed, so far i have done this hacking and slashing papa's and micovery codes.

 

OnAnyChat

 

First Check

Code

 

 

 

Code:

    List<String> bad_words = new List<String>();
    
    bad_words.Add(@"hack");
    bad_words.Add("hacker");
    bad_words.Add("hacking");
    bad_words.Add("hacker!");
    bad_words.Add("hack!");
    bad_words.Add("hacker.");
    bad_words.Add("hack.");
    bad_words.Add("hacking.");
    
    String[] chat_words = Regex.Split(player.LastChat, @"\s+");
    
    foreach(String chat_word in chat_words)
        foreach(String bad_word in bad_words)
            if (Regex.Match(chat_word, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)
                return true;
            
    return false;
Second Check

Code

 

Code:

/* Version: V0.8/R1 */
List<String> shame = new List<String>();
shame.Add("%p_n% hackusations are not welcome on this server!");
shame.Add("%p_n% must have been killed, go cry hackusations to mommy!");
shame.Add("%p_n% go report the hacker on battlelog, dont spam my chat with hackusations."); 

// Add additional messages here with shame.Add("...");

int level = 2;

try {
	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

int next = Convert.ToInt32(limit.ActivationsTotal());

next = next % shame.Count; // Ensure rotation of messages
String msg = plugin.R(shame[next]);

/*
To keep a lid on spam, only the first activation per player per
round is sent to all players. Subsequent shames are only sent
to the killer's squad.
*/
bool squadOnly = (limit.Activations(player.Name) > 1);

if (level >= 2) plugin.ConsoleWrite("^b[Knife Shame]^n " + ((squadOnly)_"^8private^0: ":"^4public^0: ") + msg);
if (squadOnly) {
	plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
} else {
	plugin.SendGlobalMessage(msg);
}
plugin.PRoConChat("ADMIN > " + msg);
return false;
i have gotten it to work some what. well i looks to work for me with hack or hacker in game right now. The thing is i have no coding abilities at all so i'm not sure if that code is doing anything else.

 

My team gets called hacker alot and we want to do somthing about it but kick/ban is not right just for somone calling hacks on us every time we kill them. So i though a taunting limit might be just the thing.

 

http://www.youtube.com/watch_v=b1MWEv0R9Sw

at 5:23 and 5:34 you will see my teamates get hackusations on them later on he trys to voteban us off our server so he get a auto temp ban for that.

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

Originally Posted by Mandizzy*:

 

I didn't know that! That's not in the R20 docs but it's a great idea if it works.

Yeah it does work.. the only reason I found out the very first day was because I already had it set in my startup.txt file. After the patch, first time I joined, it displayed that message like Yell does. It yells the message to everyone on round startup and also to anyone who joins in the middle of round and spawns for the first time. Pretty cool feature.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by R2Mi*:

 

Could anyone help me with this? I am trying to make a limit, with multiple word activations for server rules, and have it list each rule with a 1-3 second delay between them. For example I want (!rules, @rules and /rules) to all trigger the server rules, and have it list Rule #1, wait X seconds, list Rule #2, wait X Seconds, and so on.

 

I tried to combine the Rules on Request, and Bad Word Filter (replacing bad words with !rules, @rules, etc.) but I kept getting compiling errors. Also are there any guides on how to format the coding? It's very hard for me to learn by examples only.

 

Also tried to have the First Expression as:

player.LastChat.StartsWith("!rules | @rules | /rules")

as oppsed to just:

player.LastChat.StartsWith("!rules")

 

but it didn't work.

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

Originally Posted by PapaCharlie9*:

 

I am trying to setup a hackusations taunting limit to taunt people that cry hack every time they get killed, so far i have done this hacking and slashing papa's and micovery codes.

And you've done a good job. I just do a little clean-up below. I also added some more words and retorts and added the option for doing a yell.

 

OnAnyChat

 

First Check

Code

 

 

 

Code:

    List<String> bad_words = new List<String>();
    
    bad_words.Add("hack");
    bad_words.Add("hacker");
    bad_words.Add("hacking");
    bad_words.Add("cheat");
    bad_words.Add("cheater");
    bad_words.Add("cheating");
    bad_words.Add("exploit");
    bad_words.Add("exploiter");
    bad_words.Add("exploiting");
    bad_words.Add("glitch");
    bad_words.Add("glitcher");
    bad_words.Add("glitching");
    
    String[] chat_words = Regex.Split(player.LastChat, @"[\s!\_\.]+");
    
    foreach(String chat_word in chat_words)
        foreach(String bad_word in bad_words)
            if (Regex.Match(chat_word, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)
                return true;
            
    return false;
Second Check

Code

 

Code:

/* Version: V0.8/R1 */
List<String> shame = new List<String>();
shame.Add("%p_n%, hackusations are not welcome on this server!");
shame.Add("%p_n% must have been killed, go cry hackusations to mommy!");
shame.Add("%p_n% go report the hacker on battlelog, dont spam my chat with hackusations."); 
shame.Add("Would you like some cheese with your whine about hacking, %p_n%_"); 
shame.Add("%p_n%, maybe if you played better everyone wouldn't seem like a hack_");
shame.Add("%p_n%, surrounded by hacks who can't possibly play better than you ... really_"); 
shame.Add("%p_n%, don't go away mad, just go away."); 
shame.Add("%p_n%, u mad, bro_"); 
// Add additional messages here with shame.Add("...");

int level = 2;

try {
	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

int next = Convert.ToInt32(limit.ActivationsTotal());

next = next % shame.Count; // Ensure rotation of messages
String msg = plugin.R(shame[next]);

/*
To keep a lid on spam, only the first activation per player per
round is sent to all players. Subsequent shames are only sent
to the killer's squad.
*/
bool squadOnly = (limit.Activations(player.Name) > 1);

if (level >= 2) plugin.ConsoleWrite("^b[Hackusation]^n " + ((squadOnly)_"^8private^0: ":"^4public^0: ") + msg + " to " + player.Name + " about[b][/b]: " + player.LastChat);
if (squadOnly) {
	plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
	plugin.ServerCommand("admin.yell", msg, "10", "player", player.Name);
} else {
	plugin.SendGlobalMessage(msg);
	plugin.ServerCommand("admin.yell", msg);
}
plugin.PRoConChat("ADMIN > " + msg);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Could anyone help me with this? I am trying to make a limit, with multiple word activations for server rules, and have it list each rule with a 1-3 second delay between them. For example I want (!rules, @rules and /rules) to all trigger the server rules, and have it list Rule #1, wait X seconds, list Rule #2, wait X Seconds, and so on.

 

I tried to combine the Rules on Request, and Bad Word Filter (replacing bad words with !rules, @rules, etc.) but I kept getting compiling errors. Also are there any guides on how to format the coding? It's very hard for me to learn by examples only.

 

Also tried to have the First Expression as:

player.LastChat.StartsWith("!rules | @rules | /rules")

as oppsed to just:

player.LastChat.StartsWith("!rules")

 

but it didn't work.

The "1 to 3 seconds apart" is the hard part. There have been several requests about this sort of timing thing. There is a solution, but I have to code it up and test it before I can post it, so give me some time and I'll see what I can do.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

Yeah, that's easy to do. Tell me exactly what you want the messages to be and I'll make an example. Do you want it like the Unreal kill streak, where you get a different message like "player.Name is DOMINATING with MAV" and "player.Name is OWNING with MAV", or do you want counts shown, like "player.Name has 5 kills with MAV so far"?

 

im not picky it can say anything aslong as it says something (although displaying different messages might look better so it doesnt spam the same text when counting by 5's) for kills with anything that doesnt use bullets.

 

also, i think it would be interesting to see a headshot kills in a row with after like 5 or something higher.

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

Originally Posted by spitfire007*:

 

This example keeps count of all of the killers and all of the victims of every player during a round. By itself, it doesn't do anything else. However, it is required for other examples, like the In-Game Top Killers & Victims Command* or the In-Game Player Versus Player Command*. It can be used for other limits as well, such as announcing when a victim has been killed more than 10 times by a single player, or to play sub-games like Regicide, where a player from each team is designated "The King" during the round, and whoever kills the king the most, wins.

 

Create a new limit to evaluate OnKill and set action to None

 

Set first_check to this Expression:

 

Code:

( !killer.Name.Equals(victim.Name) )
This insures that Suicides are ignored by the tracker.

 

Set second_check to this Code:

 

Code:

/* OnKill: track killers and victims */

// Keep TOP stats

String prefix = "TOP_";
String kKillers = prefix + "killers";  // Killers of a player
String kVictims = prefix + "victims";  // Victims of a player

// Track killer and victim counts
DataDictionaryInterface dk = killer.RoundData;
DataDictionaryInterface dv = victim.RoundData;

int level = 3;

try {
    level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

// Setup up killer's data, if not already done
if (!dk.issetObject(kKillers)) { // Killers of killer
    dk.setObject(kKillers, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kKillers+plugin.R(" created for player.FullName"));
}
if (!dk.issetObject(kVictims)) { // Victims of killer
    dk.setObject(kVictims, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kVictims+plugin.R(" created for player.FullName"));
}

// Setup up victim's data, if not already done
if (!dv.issetObject(kKillers)) { // Killers of victim
    dv.setObject(kKillers, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kKillers+plugin.R(" created for player.FullName"));
}
if (!dv.issetObject(kVictims)) { // Victims of victim
    dv.setObject(kVictims, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kVictims+plugin.R(" created for player.FullName"));
}

Dictionary<String, int> vOfK = (Dictionary<String, int>)dk.getObject(kVictims); // victims of this killer
Dictionary<String, int> kOfV = (Dictionary<String, int>)dv.getObject(kKillers); // killers of this victim

/* Count killer's victim and victim's killer */

if (!vOfK.ContainsKey(victim.FullName)) {
    vOfK[victim.FullName] = 1;
} else {
    vOfK[victim.FullName] += 1;
}

if (!kOfV.ContainsKey(killer.FullName)) {
    kOfV[killer.FullName] = 1;
} else {
    kOfV[killer.FullName] += 1;
}

/* Debugging and logging */

if (level >= 4) {
    Dictionary<String, int> vKK = (Dictionary<String, int>)dv.getObject(kVictims); // victim killed killer
    int paybacks = 0;

    if (vKK.ContainsKey(killer.FullName)) {
        paybacks = vKK[killer.FullName];
    }

    if (level >= 5) {
        plugin.ConsoleWrite(plugin.R(@"^b[TOP] OnKill^n: %k_fn% killer of %v_fn% ") + vOfK[victim.FullName] + " times.");
        plugin.ConsoleWrite(plugin.R(@"^b[TOP] OnKill^n: %k_fn% victim of %v_fn% ") + paybacks + " times.");
        return false;
    }
    // Otherwise, show gaps of 10 or more
    if (vOfK[victim.FullName] > paybacks && (vOfK[victim.FullName] - paybacks) >= 10) {
        plugin.ConsoleWrite(plugin.R(@"^b[TOP] OnKill^n: %k_fn% vs %v_fn% kills: ") + vOfK[victim.FullName] + "-" + paybacks);
    }
}

return false;
At debug level 3 or lower, there is no logging output.

 

At level 4, the log will be updated every time the difference between the number of times killer has killed victim and the number of times victim has killed killer is 10 or more, with a line like this:

 

[TOP] OnKill: micovery vs [LGN]PapaCharlieNiner kills: 11-1

 

At level 5, the log will be updated with every new entry that will be tracked as well as with current counts for the killer and victim, like this:

 

[TOP] OnKill: micovery killer of [LGN]PapaCharlieNiner 11 times.

[TOP] OnKill: micovery victim of [LGN]PapaCharlieNiner 1 times.

I am getting the following compile warnings.

I have the R30 release and have updated Procon

 

[15:28:16 99] [insane Limits] Thread(settings): ERROR: 3 errors compiling Code

[15:28:17 23] [insane Limits] Thread(settings): ERROR: (CS1002, line: 22, column: 49): ; expected

[15:28:17 87] [insane Limits] Thread(settings): ERROR: (CS0168, line: 52, column: 15): The variable 'e' is declared but never used

[15:28:18 12] [insane Limits] Thread(settings): ERROR: (CS0162, line: 113, column: 13): Unreachable code detected

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

Originally Posted by medicine-man*:

 

This limit sends a global message for the first kill of the round, in the entire server. This is very similar to the Team First Blood, example. The only thing that changes is that instead of counting first kill for each team, it counts first kill for entire server.

 

Set the limit evaluation to OnKill, and set the action to Say

 

Set the fist_check to this Expression:

 

Code:

(true)
Set the second_check to this Expression:

 

Code:

limit.Activations() == 1
And set these action specific parameters:

 

Code:

say_audience = All
                say_message = %p_n% got the first kill of this round with %w_n%!
Anyway I can make this a admin yell message?

 

Thanks

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

Originally Posted by PapaCharlie9*:

 

I am getting the following compile warnings.

I have the R30 release and have updated Procon

 

[15:28:16 99] [insane Limits] Thread(settings): ERROR: 3 errors compiling Code

[15:28:17 23] [insane Limits] Thread(settings): ERROR: (CS1002, line: 22, column: 49): ; expected

[15:28:17 87] [insane Limits] Thread(settings): ERROR: (CS0168, line: 52, column: 15): The variable 'e' is declared but never used

[15:28:18 12] [insane Limits] Thread(settings): ERROR: (CS0162, line: 113, column: 13): Unreachable code detected

This is usually a browser-based copy&paste problem. Try copying the code from PRoCon into a post in this thread, in a code block, which is mark up [ code ] and [ /code ], but without the spaces.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

CORRECTED AGAIN

Anyway I can make this a admin yell message?

 

Thanks

You have to change second_check to the following code:

 

Set the second_check to this Code:

 

Code:

if (limit.Activations() == 1) {
    Match m = Regex.Match(kill.Weapon, @"/[^/]+$");
    String wn = kill.Weapon;
    if (m.Success) wn = m.Groups[1].Value;
    String msg = killer.FullName + " got the first kill against " + victim.FullName +  " with " + wn + "!";
    plugin.ServerCommand("admin.yell", msg);
}
return false;
Change the Action to None.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Dudenell*:

 

You have to change second_check to the following code:

 

Set the second_check to this Code:

 

Code:

Match m = Regex.Match(kill.Weapon, @"Weapons/[^/]+/(.*)$");
String wn = kill.Weapon;
if (m.Success) wn = m.Groups[1].Value;
String msg = player.FullName + " got the first kill of this round with " + wn + "!";
plugin.ServerCommand("admin.yell", msg);
can't get it to work since the first check is (true) and the second check is

limit.Activations() == 1

and micro used the action say.

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

Originally Posted by spitfire007*:

 

This is usually a browser-based copy&paste problem. Try copying the code from PRoCon into a post in this thread, in a code block, which is mark up [ code ] and [ /code ], but without the spaces.

Thanks for the reply ... here is what I cut and pasted directly from procon

 

Code:

/* OnKill: track killers and victims */

// Keep TOP stats

String prefix = "TOP_";
String kKillers = prefix + "killers";  // Killers of a player
String kVictims = prefix + "victims";  // Victims of a player

// Track killer and victim counts
DataDictionaryInterface dk = killer.RoundData;
DataDictionaryInterface dv = victim.RoundData;

int level = 3;

try {
    level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

// Setup up killer's data, if not already done
if (!dk.issetObject(kKillers)) { // Killers of killer
    dk.setObject(kKillers, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kKillers+plugin.R(" created for player.FullName"));
}
if (!dk.issetObject(kVictims)) { // Victims of killer
    dk.setObject(kVictims, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kVictims+plugin.R(" created for player.FullName"));
}

// Setup up victim's data, if not already done
if (!dv.issetObject(kKillers)) { // Killers of victim
    dv.setObject(kKillers, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kKillers+plugin.R(" created for player.FullName"));
}
if (!dv.issetObject(kVictims)) { // Victims of victim
    dv.setObject(kVictims, new Dictionary<String, int>());
    if (level >= 5) plugin.ConsoleWrite(kVictims+plugin.R(" created for player.FullName"));
}

Dictionary<String, int> vOfK = (Dictionary<String, int>)dk.getObject(kVictims); // victims of this killer
Dictionary<String, int> kOfV = (Dictionary<String, int>)dv.getObject(kKillers); // killers of this victim

/* Count killer's victim and victim's killer */

if (!vOfK.ContainsKey(victim.FullName)) {
    vOfK[victim.FullName] = 1;
} else {
    vOfK[victim.FullName] += 1;
}

if (!kOfV.ContainsKey(killer.FullName)) {
    kOfV[killer.FullName] = 1;
} else {
    kOfV[killer.FullName] += 1;
}

/* Debugging and logging */

if (level >= 4) {
    Dictionary<String, int> vKK = (Dictionary<String, int>)dv.getObject(kVictims); // victim killed killer
    int paybacks = 0;

    if (vKK.ContainsKey(killer.FullName)) {
        paybacks = vKK[killer.FullName];
    }

    if (level >= 5) {
        plugin.ConsoleWrite(plugin.R(@"^b[TOP] OnKill^n: %k_fn% killer of %v_fn% ") + vOfK[victim.FullName] + " times.");
        plugin.ConsoleWrite(plugin.R(@"^b[TOP] OnKill^n: %k_fn% victim of %v_fn% ") + paybacks + " times.");
        return false;
    }
    // Otherwise, show gaps of 10 or more
    if (vOfK[victim.FullName] > paybacks && (vOfK[victim.FullName] - paybacks) >= 10) {
        plugin.ConsoleWrite(plugin.R(@"^b[TOP] OnKill^n: %k_fn% vs %v_fn% kills: ") + vOfK[victim.FullName] + "-" + paybacks);
    }
}

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

Originally Posted by Dudenell*:

 

papa I was wondering if there was a way to expand the kill spree plugin here to include who ended the kill spree

myrcon.net/...insane-limits-examples#entry18420

 

kinda like: www.phogue.net/forumvb/showth...or-ProconRulz)*

 

the only way I could think of doing this was to create two separate limits, one to check for how many kills a person has in a killstreak and another to go through and check to see if that player was killed and announce who killed that player / the streak they were killed on.

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

Originally Posted by PapaCharlie9*:

 

Thanks for the reply ... here is what I cut and pasted directly from procon

Well, I don't know what to tell you. I copied&pasted your block of code into an OnKill limit and it compiled perfectly for me, no errors. Maybe you have an old version of Insane Limits or PRoCon? Or maybe a version of .Net that is earlier than 3.5?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

Remind me what this is? I don't remember the original request.

lol you know how in the server you can get double kill with like 1 shot? im not sure how it works exactly but it would be cool to have a count of the number of kills within a second and display the message with like DROOPIE GOT A DOUBLE KILL! i believe the problem was something about if getting a 4 kill (quadruple kill) it would first display Double then Triple and finally Quadruple Kill messages.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

papa I was wondering if there was a way to expand the kill spree plugin here to include who ended the kill spree

myrcon.net/...insane-limits-examples#entry18420

 

kinda like: www.phogue.net/forumvb/showth...or-ProconRulz)*

 

the only way I could think of doing this was to create two separate limits, one to check for how many kills a person has in a killstreak and another to go through and check to see if that player was killed and announce who killed that player / the streak they were killed on.

It's definitely possible. Unfortunately, I think micovery was planning to add that support directly to 0.9, so I'm reluctant to do throw away work to patch it in the mean time. I'd either have to change Insane Limits itself to add the support, or write a limit that duplicates the built-in Spree handling, neither of which seems like much fun.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

lol you know how in the server you can get double kill with like 1 shot? im not sure how it works exactly but it would be cool to have a count of the number of kills within a second and display the message with like DROOPIE GOT A DOUBLE KILL! i believe the problem was something about if getting a 4 kill (quadruple kill) it would first display Double then Triple and finally Quadruple Kill messages.

That's right, I remember now. And that problem still exists, sorry.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Mootart*:

 

CORRECTED

 

You have to change second_check to the following code:

 

Set the second_check to this Code:

 

Code:

if (limit.Activations() == 1) {
    Match m = Regex.Match(kill.Weapon, @"Weapons/[^/]+/(.*)$");
    String wn = kill.Weapon;
    if (m.Success) wn = m.Groups[1].Value;
    String msg = player.FullName + " got the first kill of this round with " + wn + "!";
    plugin.ServerCommand("admin.yell", msg);
}
return false;
Change the Action to None.
how to code if i want to see the victims name too.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by medicine-man*:

 

CORRECTED

 

You have to change second_check to the following code:

 

Set the second_check to this Code:

 

Code:

if (limit.Activations() == 1) {
    Match m = Regex.Match(kill.Weapon, @"Weapons/[^/]+/(.*)$");
    String wn = kill.Weapon;
    if (m.Success) wn = m.Groups[1].Value;
    String msg = player.FullName + " got the first kill of this round with " + wn + "!";
    plugin.ServerCommand("admin.yell", msg);
}
return false;
Change the Action to None.
Thank you sooo much! Will give it a try!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by medicine-man*:

 

how to code if i want to see the victims name too.

+1 I was going to ask this also but didn't want to push my luck :smile:

 

Thanks again for all your hard work and effort!

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • 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.