Jump to content

Insane Limits - Examples


Recommended Posts

Originally Posted by ganjaparadise*:

 

Hey,

I want to know if i made this expression

player.LastChat.StartsWith("!kap") && plugin.isInList(player.Name, "admin_list")

Only player on admin_list are able to active this command ?

 

And i 've a problem to disabled limit :

 

plugin.setPluginVarValue("limit_3_state" , "Disabled");

plugin.setPluginVarValue("limit_4_state" , "Disabled");

plugin.setPluginVarValue("limit_13_state" , "Enabled");

plugin.setPluginVarValue("limit_14_state" , "Enabled");

plugin.ServerCommand("vars.serverDescription" , "KNIFE AND PISTOL ONLY or Kill/Kick/Ban [15 minutes]");

plugin.SendGlobalMessage(plugin.R("*** Enable Knife/Pistol Only Mode!***"));

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

Originally Posted by xFaNtASyGiRLx*:

 

i tried to do a search for "limit mav" on the forums and came up with a bunch of posts that has limits in it and "mav" is too short to be used in the search bar.

 

i was hoping the patch was going to fix the mav killings but i guess people can still kill with the mav since they have more ammo supply or something like that.

 

a problem on my server is too many mav kills. how can i set insane limits to kick someone after 5 mav kills? i run a metro/bazaar server and so i'm not sure how mav roadkill would affect the tanks in bazaar. i don't want it to.

 

thanks for any help!!

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

Originally Posted by PapaCharlie9*:

 

can anyone tell me how i can display a message saying "nice shot! %k_fn%" when a user dies then types !ns

 

 

under insane limits i setup a new Limit and set OnAnyChat player.LastChat.StartsWith("!ns")

or

when they type "!ns techkiller" techkiller is the players name that killed them. then is display a message with the name that someone entered?

That's tricky. The event that tells PRoCon the killer's name and weapon is separate from the event that handles chat. That creates two big problems. One, how does the kill event keep track of which victims might want to type !ns in the future? Two, how does the any chat event know which kill to use, if any?

 

If it just says "nice shot", it's not really worth the effort ...

 

Now, if it chose a phrase from a list of phrases, that would be more interesting, like:

 

Nice shot %k_fn%

 

Good one %k_fn%

 

Schooled me with that %w_n%, didn't you %k_fn%?

 

You are a good shot with the %w_n% there, %k_n%

 

etc.

 

I'll work on it later.

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

Originally Posted by PapaCharlie9*:

 

Hey,

I want to know if i made this expression

 

Only player on admin_list are able to active this command ?

 

And i 've a problem to disabled limit :

 

 

 

Thank you :smile:

Your first expression looks perfect, well done.

 

For disabling limits, I think there is a bug in Insane Limits that doesn't update the user interface after you change something with plugin.setPluginVarValue. It also doesn't save the change to the config file. Are you sure that limit is really not disabled or does it just not look disabled when you look in the Settings tab?

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

Originally Posted by PapaCharlie9*:

 

i tried to do a search for "limit mav" on the forums and came up with a bunch of posts that has limits in it and "mav" is too short to be used in the search bar.

 

i was hoping the patch was going to fix the mav killings but i guess people can still kill with the mav since they have more ammo supply or something like that.

 

a problem on my server is too many mav kills. how can i set insane limits to kick someone after 5 mav kills? i run a metro/bazaar server and so i'm not sure how mav roadkill would affect the tanks in bazaar. i don't want it to.

 

thanks for any help!!

I think you will just have to live with this problem and let players votekick if they don't like it. If the R20 patch does what it says it is supposed to do, the MAV should be destroyed after it road kills someone. So yes, with an ammo pack, a Recon can wait a while and get a new MAV and do it again, but that will take time. I haven't tested it myself yet, so I'm not sure.

 

There's no way for PRoCon to stop this. On Metro you could just punish for any "Death" weapon, but that won't work on Bazaar.

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

Originally Posted by xFaNtASyGiRLx*:

 

I think you will just have to live with this problem and let players votekick if they don't like it. If the R20 patch does what it says it is supposed to do, the MAV should be destroyed after it road kills someone. So yes, with an ammo pack, a Recon can wait a while and get a new MAV and do it again, but that will take time. I haven't tested it myself yet, so I'm not sure.

 

There's no way for PRoCon to stop this. On Metro you could just punish for any "Death" weapon, but that won't work on Bazaar.

thanks for the reply papacharlie!! ok.. so how do i go about punishing on metro? thanks!!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

wath is R20 gamemode names?

 

how do i use yell bar for sending the server rules(scrolling) time to time...is that possible?

If you just want to know what's changed, look here:

 

www.phogue.net/forumvb/showth...e-requirements*

 

If you want the complete documentation for R20, look here:

 

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

 

For yell, give us some time to catch up, we're just learning all this stuff today. It will be VERY easy to add admin.yell to everything. Too easy, if you ask me. Prepare for lots of screen spam on every server you play on from now on ...

 

If you absolutely must add a yell to your limits immediately and your limit is in code (not an Action), find where you currently have:

 

Code:

plugin.SendGlobalMessage("...");
in your code and if you want it to be a yell instead, change it to:

 

Code:

plugin.ServerCommand("admin.yell", "...");
Replace the "..." with whatever the message is.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

thanks for the reply papacharlie!! ok.. so how do i go about punishing on metro? thanks!!

Do you currently have a limit for Metro that restricts weapons, like USAS or M320? If so, post the code for that. If not, use the Metro only, 2 warnings then punish for M320, RPG, USAS, etc.* example, find the first_check Expression:

 

Code:

( Regex.Match(server.MapFileName, @"(_:MP_Subway)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(_:M320|RPG|SMAW|USAS)", RegexOptions.IgnoreCase).Success )
And change it to this:

 

Code:

( Regex.Match(server.MapFileName, @"(_:MP_Subway)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(_:M320|RPG|SMAW|USAS|Death)", RegexOptions.IgnoreCase).Success )
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by xFaNtASyGiRLx*:

 

Do you currently have a limit for Metro that restricts weapons, like USAS or M320? If so, post the code for that. If not, use the Metro only, 2 warnings then punish for M320, RPG, USAS, etc.* example, find the first_check Expression:

 

Code:

( Regex.Match(server.MapFileName, @"(_:MP_Subway)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(_:M320|RPG|SMAW|USAS)", RegexOptions.IgnoreCase).Success )
And change it to this:

 

Code:

( Regex.Match(server.MapFileName, @"(_:MP_Subway)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(_:M320|RPG|SMAW|USAS|Death)", RegexOptions.IgnoreCase).Success )
no, i don't limit any weapons. all i want this for is the mav.

 

so where you said "and change to this: ( Regex.Match(server.MapFileName, @"(_:MP_Subway)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(_:M320|RPG|SMAW|USAS|Death)", RegexOptions.IgnoreCase).Success )

 

do i remove the part i bolded since its only for the mav?

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

Originally Posted by ganjaparadise*:

 

Your first expression looks perfect, well done.

 

For disabling limits, I think there is a bug in Insane Limits that doesn't update the user interface after you change something with plugin.setPluginVarValue. It also doesn't save the change to the config file. Are you sure that limit is really not disabled or does it just not look disabled when you look in the Settings tab?

Work one time but when i try to revert doesn't work properly i think we 've bug on plugin.setPluginVarValue :huh:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by phrogz*:

 

For yell, give us some time to catch up, we're just learning all this stuff today. It will be VERY easy to add admin.yell to everything. Too easy, if you ask me. Prepare for lots of screen spam on every server you play on from now on ...

 

If you absolutely must add a yell to your limits immediately and your limit is in code (not an Action), find where you currently have:

 

Code:

plugin.SendGlobalMessage("...");
in your code and if you want it to be a yell instead, change it to:

 

Code:

plugin.ServerCommand("admin.yell", "...");
Replace the "..." with whatever the message is.
If I use "ServerCommand Action" in the limit_X_action can I use variables between doubles quotes?

Like that:

admin.yell "%p_n% got the first kill of this round with %w_n%!"

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

Originally Posted by Dudenell*:

 

This limit kills for RPG/SMAW/M320 on first violation, kicks on second violation, if player comes back, and uses it again one more time, player is banned.

 

Set limit to evaluate OnKill, set action to None

 

Set first_check to this Expression:

 

Code:

Regex.Match(kill.Weapon, @"(m320|smaw|rpg)", RegexOptions.IgnoreCase).Success
Set second_check to this Code:

 

Code:

if (limit.Data.issetBool(player.Name))
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!"));
     plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%"));
     limit.Data.unsetBool(player.Name);
  }
  
  int count = (int) limit.Activations(player.Name);
   
  if (count == 1)
  {
      plugin.SendGlobalMessage(plugin.R("%p_n% do not use %w_n%!"));
      plugin.KillPlayer(player.Name);
  }
  else if (count == 2)
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been kicked for using %w_n%"));
     plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using %w_n%"));
     
     if (!limit.Data.issetBool(player.Name))
         limit.Data.setBool(player.Name, true);
  }
I've modified this script to take care of people using too many claymores. I was hoping to modify it more so that I wanted to change it up a bit so that it would perm ban a player after a second kick. For example

 

Player a comes into the server

player a uses too many claymores within a round and is kicked.

New round starts (or maybe even the next day)

player uses too many claymores again and because he is kicked a second time he is banned.

 

I guess what I'm mostly looking for clarification on is what exactly does this do? It's been quite a while since i've done any programming. Is limit the variable name?

 

Code:

if (!limit.Data.issetBool(player.Name))
		limit.Data.setBool(player.Name, true);
		}
and

 

Code:

if (limit.Data.issetBool(player.Name))
and

 

Code:

limit.Data.unsetBool(player.Name);
Thanks for the help!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by phrogz*:

 

If I use "ServerCommand Action" in the limit_X_action can I use variables between doubles quotes?

Like that:

admin.yell "%p_n% got the first kill of this round with %w_n%!"

FYI In servercommand action that doesn't work, and this one works in check code:

Code:

plugin.ServerCommand("admin.yell", killer.Name + "got the first kill of this round with" + kill.Weapon + "!");
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

no, i don't limit any weapons. all i want this for is the mav.

 

so where you said "and change to this: ( Regex.Match(server.MapFileName, @"(_:MP_Subway)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(_:M320|RPG|SMAW|USAS|Death)", RegexOptions.IgnoreCase).Success )

 

do i remove the part i bolded since its only for the mav?

Here, I added a new post to the example which should kick for MAV or Mortar kills on Metro. Go to this link:

 

http://www.phogue.net/forumvb/showth...ll=1#post45527*

 

 

 

I guess what I'm mostly looking for clarification on is what exactly does this do? It's been quite a while since i've done any programming. Is limit the variable name?

 

Code:

if (!limit.Data.issetBool(player.Name))
		limit.Data.setBool(player.Name, true);
		}
and

 

Code:

if (limit.Data.issetBool(player.Name))
and

 

Code:

limit.Data.unsetBool(player.Name);
Thanks for the help!
"Data" is like a scratchpad that remembers a key/value pair for as long as the plugin is enabled and running. The key is the player's name. The value is a boolean, true if he has been kicked, false otherwise. If no key is found (issetBool returns false), it's the same as the value being false.

 

issetBool asks if the key has a value.

 

setBool sets the value for the key.

 

getBool gets the value for the key.

 

unsetBool removes the key and value from Data.

 

If you want to kick twice, you will have to change the boolean to an int so you can keep a count. You might be better off starting with the example linked above for xFantasyGirlx, which already has a "warning" counter set up, then modify it as needed:

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

Originally Posted by Dudenell*:

 

Here, I added a new post to the example which should kick for MAV or Mortar kills on Metro. Go to this link:

 

http://www.phogue.net/forumvb/showth...ll=1#post45527*

 

 

 

 

"Data" is like a scratchpad that remembers a key/value pair for as long as the plugin is enabled and running. The key is the player's name. The value is a boolean, true if he has been kicked, false otherwise. If no key is found (issetBool returns false), it's the same as the value being false.

 

issetBool asks if the key has a value.

 

setBool sets the value for the key.

 

getBool gets the value for the key.

 

unsetBool removes the key and value from Data.

 

If you want to kick twice, you will have to change the boolean to an int so you can keep a count. You might be better off starting with the example linked above for xFantasyGirlx, which already has a "warning" counter set up, then modify it as needed:

Thanks for that, helped me a lot in better understanding. I guess what I'm trying to get out of it is that it will remember the kick for claymores even after the round is over (ex if the procon layer hasn't been restarted it would remember that kick). Here is the code I currently have which was edited from here:

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

Code:

if (limit.Data.issetBool(player.Name))
	{
	plugin.SendGlobalMessage(plugin.R(player.Name + " has been banned for using claymores after a kick!"));
	plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("You have been banned for 15 minutes for using claymores after a kick"));
	plugin.PRoConChat("ADMIN > " + player.Name + " Was tempbanned after a kick for claymores");
	limit.Data.unsetBool(player.Name);
	}
	
	int count = (int) limit.Activations(player.Name);
	//int kicks = (int) limit.ActivationsTotal(player.Name);
   
   //under 3 claymores it warns the player as to how many they have
   if (count <=  3)
   {
   plugin.SendSquadMessage(player.TeamId, player.SquadId, (player.Name + ", you have " + count + " of 3 Claymore kills - more and you will be killed and then kicked"));
   }
   //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, (player.Name + ", you have NO Claymore kills left, more and you will be kicked!"));
   plugin.SendGlobalMessage(plugin.R(player.Name + " has been killed for excessive claymore use!"));
   plugin.KillPlayer(player.Name);
   plugin.PRoConChat("ADMIN > " + player.Name + " has used " + count + " claymores and has been killed");
   }
   //6 claymores the player will be kicked, message tweeted
   else if (count == 6)
   {
   plugin.SendGlobalMessage(plugin.R(player.Name + " has been kicked for excessive claymores"));
   plugin.KickPlayerWithMessage(player.Name, plugin.R("You have been kicked for using too many claymores"));
   plugin.Tweet(plugin.R(player.Name + " was kicked for excessive claymore use! #kick #noob"));
   plugin.PRoConChat("ADMIN > " + player.Name + " Was kicked for excessive claymore use");
	if (!limit.Data.issetBool(player.Name))
		limit.Data.setBool(player.Name, true);
		}
so lets say I join the server

I get 6 claymores kills and I'm kicked. I decide to find another server and in a few days come back and decide to use claymores again and get another 6 kills. Instead of being kicked this time I am banned.

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

Originally Posted by Mootart*:

 

hi with the new bf3 patch update you can now see your own ping. is there a limit that we can kick a max ping like 400 like 1st 30sec if players ping 400 above he will be warn. to check ping and check connection. after 60sec. if player is still above 400 he will be kick with 30sec coundown.

 

thanks.. looking forward for this.

 

cheers

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

Originally Posted by Spectralslayer*:

 

Replying here to a question from another thread, as it pertains to Insane Limits more. Original thread can be found here for reference: www.phogue.net/forumvb/showth...d-How-to/page3*

 

Yes, I did, but the plug-in fails. And I did not create lists. I would be glad to get help :smile:

Steps for creating custom lists:

1) Set use_custom_lists to "True" under Settings in the Plugin Settings tab

2) Set new_list to "True" under Lists Manager

3) Show the list settings by setting list_x_hide (where x is the setting #) to "Show"

4) Rename the list to an appropriate name*

5) Enter the values in list_x_data separated by a comma (don't use quotes in this field)

6) Make sure that list_x_state is set to "Enabled"

 

 

*The list name must be matched EXACTLY anywhere that you use it in code. If your list name is "Admins" then the following line of code:

Code:

if(plugin.isInList(player.Name, "Admins"))
would check whether the player's name was in the custom list Admins, but the following line would not:

Code:

if(plugin.isInList(player.Name,"admins"))
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Dudenell*:

 

alright so I think I finished my version of the multi action for claymores. Code needs to be cleaned up a little bit but basically this will allow a player to use 3 claymores per round, telling the player via chat + yell how many claymores they have left. on the 4 + 5th kill it will auto kill the player and warn them (via yell + chat) that they are about to be kicked. On the 6th kill they get kicked from the server.

 

If they join the server immediately and use another claymore it will temp ban them for 15 minutes

If they wait a round or so (not positive on this since i'm testing on a live server and it took quite a while. I think I need to add an if statement to check if the round is over or not) then they can continue to use claymores but if they are kicked again for excessive claymore use they will be perminately banned.

 

This should also tweet any kicks / bans if you have a custom twitter.

 

anyways to add:

 

Set limit to evaluate OnKill, set action to None

 

Set first_check to this Expression:

Code:

( Regex.Match(kill.Weapon, "(Claymore)").Success )
Set second_check to this code:

 

Code:

String kCounter = killer.Name + "_TreatAsOne_Count";
	int kicks = 0;
	int count = (int) limit.Activations(player.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 (limit.Data.issetBool(player.Name))
	{
		plugin.SendGlobalMessage(plugin.R(player.Name + " has been banned for using claymores after a kick!"));
		plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("You have been banned for 15 minutes for using claymores after a kick"));
		plugin.PRoConChat("ADMIN > " + player.Name + " Was tempbanned after a kick for claymores");
		limit.Data.unsetBool(player.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, (player.Name + ", you have " + count + " of 3 Claymore kills - more and you will be killed and then kicked"));
		plugin.ServerCommand("admin.yell", (player.Name + ", you have " + count + " of 3 Claymore kills - more and you will be killed and then kicked"), "10", "player", player.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, (player.Name + ", you have NO Claymore kills left, more and you will be kicked!"));
		plugin.ServerCommand("admin.yell", (player.Name + ", you have NO Claymore kills left, more and you will be kicked!"), "10", "player", player.Name);
		plugin.SendGlobalMessage(plugin.R(player.Name + " has been killed for excessive claymore use!"));
		plugin.PRoConChat("ADMIN > " + player.Name + " has used " + count + " claymores and has been killed." player.Name + " has " + kicks " previous kicks");
		plugin.KillPlayer(player.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, player.Name, 0, (player.Name + " - Banned for excessive claymore use! appeal: rufclan.com"));
			plugin.PBBanPlayerWithMessage(PBBanDuration.Permanent, killer.Name, 0, plugin.R(player.Name + " - excessive claymore use. rufclan.com"));
			//Custom twitter setting for tweeting kicks / bans
			plugin.Tweet(plugin.R(player.Name + " was banned for excessive claymore use after a kick! #banned"));
			plugin.SendGlobalMessage(plugin.R(player.Name + " has been banned for excessive claymore use after a kick!"));
			plugin.PRoConChat("ADMIN > " + player.Name + " was banned for excessive claymore use!");
		}
		else
		{
			plugin.KickPlayerWithMessage(player.Name, plugin.R("You have been kicked for using too many claymores"));
			plugin.PRoConChat("ADMIN > " + player.Name + " Was kicked for excessive claymore use, first kick");
			//Custom twitter setting for tweeting kicks / bans
			plugin.Tweet(plugin.R(player.Name + " was kicked for excessive claymore use! #kick #noob"));
			plugin.SendGlobalMessage(plugin.R(player.Name + " has been kicked for excessive claymores"));
				if (!limit.Data.issetBool(player.Name))
				limit.Data.setBool(player.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 below, scan the whole post for your answer.

 

how about an example for counting the amount of kills with x weapon? like player has 10 kills with claymores with 20

"with 20" what? Clicked submit too soon?

 

In general, it is possible to track weapons and keep a count per player, but times 64 players starts to become a lot of book keeping. If it is only certain types of weapons that would be better.

 

 

hi with the new bf3 patch update you can now see your own ping. is there a limit that we can kick a max ping like 400 like 1st 30sec if players ping 400 above he will be warn. to check ping and check connection. after 60sec. if player is still above 400 he will be kick with 30sec coundown.

 

thanks.. looking forward for this.

 

cheers

Sorry bud, but PRoCon still doesn't get sent that info. Much raging and complaining about that in the admins forum, but it is low priority for DICE.

 

 

Replying here to a question from another thread, as it pertains to Insane Limits more. Original thread can be found here for reference:

Thanks Spectral. Between the two of us, we should be able to get tygra09 on the right path. I'll paste the code into a separate post below, for reference.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

alright so I think I finished my version of the multi action for claymores. Code needs to be cleaned up a little bit but basically this will allow a player to use 3 claymores per round, telling the player via chat + yell how many claymores they have left. on the 4 + 5th kill it will auto kill the player and warn them (via yell + chat) that they are about to be kicked. On the 6th kill they get kicked from the server.

 

If they join the server immediately and use another claymore it will temp ban them for 15 minutes

If they wait a round or so (not positive on this since i'm testing on a live server and it took quite a while. I think I need to add an if statement to check if the round is over or not) then they can continue to use claymores but if they are kicked again for excessive claymore use they will be perminately banned.

 

This should also tweet any kicks / bans if you have a custom twitter.

 

anyways to add:

 

Set limit to evaluate OnKill, set action to None

 

Set first_check to this Expression:

Code:

( Regex.Match(kill.Weapon, "(Claymore)").Success )
Set second_check to this code:

 

Code:

String kCounter = killer.Name + "_TreatAsOne_Count";
	int kicks = 0;
	int count = (int) limit.Activations(player.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 (limit.Data.issetBool(player.Name))
	{
		plugin.SendGlobalMessage(plugin.R(player.Name + " has been banned for using claymores after a kick!"));
		plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("You have been banned for 15 minutes for using claymores after a kick"));
		plugin.PRoConChat("ADMIN > " + player.Name + " Was tempbanned after a kick for claymores");
		limit.Data.unsetBool(player.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, (player.Name + ", you have " + count + " of 3 Claymore kills - more and you will be killed and then kicked"));
		plugin.ServerCommand("admin.yell", (player.Name + ", you have " + count + " of 3 Claymore kills - more and you will be killed and then kicked"), "10", "player", player.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, (player.Name + ", you have NO Claymore kills left, more and you will be kicked!"));
		plugin.ServerCommand("admin.yell", (player.Name + ", you have NO Claymore kills left, more and you will be kicked!"), "10", "player", player.Name);
		plugin.SendGlobalMessage(plugin.R(player.Name + " has been killed for excessive claymore use!"));
		plugin.PRoConChat("ADMIN > " + player.Name + " has used " + count + " claymores and has been killed." player.Name + " has " + kicks " previous kicks");
		plugin.KillPlayer(player.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, player.Name, 0, (player.Name + " - Banned for excessive claymore use! appeal: rufclan.com"));
			plugin.PBBanPlayerWithMessage(PBBanDuration.Permanent, killer.Name, 0, plugin.R(player.Name + " - excessive claymore use. rufclan.com"));
			//Custom twitter setting for tweeting kicks / bans
			plugin.Tweet(plugin.R(player.Name + " was banned for excessive claymore use after a kick! #banned"));
			plugin.SendGlobalMessage(plugin.R(player.Name + " has been banned for excessive claymore use after a kick!"));
			plugin.PRoConChat("ADMIN > " + player.Name + " was banned for excessive claymore use!");
		}
		else
		{
			plugin.KickPlayerWithMessage(player.Name, plugin.R("You have been kicked for using too many claymores"));
			plugin.PRoConChat("ADMIN > " + player.Name + " Was kicked for excessive claymore use, first kick");
			//Custom twitter setting for tweeting kicks / bans
			plugin.Tweet(plugin.R(player.Name + " was kicked for excessive claymore use! #kick #noob"));
			plugin.SendGlobalMessage(plugin.R(player.Name + " has been kicked for excessive claymores"));
				if (!limit.Data.issetBool(player.Name))
				limit.Data.setBool(player.Name, true);
				server.Data.setInt(kCounter, kicks+1);
		}
	}
return false;
Not bad, Dudenell. Unfortunately there are a handful of gotchas you will need to deal with.

 

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.

 

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:

 

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

 

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.

 

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.

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

Originally Posted by PapaCharlie9*:

 

Spectralslayer wrote this example:

 

Code:

//Check if last chat is a yell command
if(player.LastChat.ToUpper().StartsWith("@YELL "))
{
	//Check whether player is admin (using custom list Admins)
	if(plugin.isInList(player.Name, "Admins"))
	{
		//Yell the message to everyone on the server
		plugin.ServerCommand("admin.yell", player.LastChat.Substring(5));
	}
}
//Check if last chat is a yell command (included a second time due to character offset)
else if(player.LastChat.ToUpper().StartsWith("/@YELL "))
{
	//Check whether player is admin (using custom list Admins)
	if(plugin.isInList(player.Name, "Admins"))
	{
		//Yell the message to everyone on the server
		plugin.ServerCommand("admin.yell", player.LastChat.Substring(6));
	}
}
//Check if last chat is a pyell command
else if(player.LastChat.ToUpper().StartsWith("@PYELL ") || player.LastChat.ToUpper().StartsWith("/@PYELL "))
{
	//Check whether player is admin (using custom list Admins)
	if(plugin.isInList(player.Name, "Admins"))
	{
		//Split each word using space as delimiter
		String[] args = player.LastChat.Split(' ');
		String target = args[1];
		
		//Rebuild message
		String message = "";
		for(int i = 2; i < args.Length; i++)
		{
			message += args[i] + " ";
		}
		
		//Determine target player
		//Build list of players
		List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
		players.AddRange(team1.players);
		players.AddRange(team2.players);
		if (team3.players.Count > 0)
		{
			players.AddRange(team3.players);
		}
		if (team4.players.Count > 0)
		{
			players.AddRange(team4.players);
		}
		
		//Loop through list of players
		foreach (PlayerInfoInterface p in players)
		{
			//Check whether target is a substring of the current player's name
			if(Regex.Match(p.Name, target, RegexOptions.IgnoreCase).Success)
			{
				//Issue the yell
				plugin.ServerCommand("admin.yell", message, "10", "player", p.Name);
				//Yell the matched name to the command issuer
				plugin.ServerCommand("admin.yell", "Yelling to " + p.Name, "5", "player", player.Name);
				
				//Exit script
				return false;
			}
		}
		//Yell to the command issuer that a target could not be found
		plugin.ServerCommand("admin.yell", "No players matching name " + target, "5", "player", player.Name);
	}
}
Comments from PapaCharlie9:

 

This is a good example as is and should work fine. My comments are just some simplifications that could be made.

 

When I do a check for admin lists, I do it once at the top and return false immediately if the player name is not in the list. After that point you can assume the player is an admin, which simplifies the code. Saves having to test for it multiple times later.

 

I also put the admin list name in a variable at the top, to make it easier to change. See this post for an example:

 

www.phogue.net/forumvb/showth...nd-and-reasons*

 

For version 0.0.0.8, micovery added a function to do player name lookup, so you don't have to do all that AddRange stuff. It's documented in the .cs file and in the plugin details, but unfortunately not in the OP of the Insane Limits thread (some kind of copy&paste mishap). Here's the spec:

 

Code:

/* This method looks in the internal player's list for player with matching name.
     * If fuzzy argument is set to true, it will find the player name that best matches the given name
     *
     /
    PlayerInfoInterface GetPlayer(String name, bool fuzzy);
So just do

 

Code:

PlayerInfoInterface p = plugin.GetPlayer(target, false);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Rules. Ok. I try copy...

 

 

[13:41:02] [insane Limits] ERROR: 4 errors compiling Code

[13:41:02] [insane Limits] ERROR: (CS1026, line: 23, column: 64): expected)

[13:41:02] [insane Limits] ERROR: (CS1002, line: 23, column: 104) was expected;

[13:41:02] [insane Limits] ERROR: (CS1525, line: 23, column: 104): Invalid term ')' in expression

[13:41:02] [insane Limits] ERROR: (CS1002, line: 23, column: 105) was expected;

Tygra, which limit number did you paste the code into? We need the limit number for the next step.

 

Suppose you pasted it into limit #3. In the Insane Limits Plugin Settings tab, near the top, find the "console" line. In the console line, type:

 

!dump limit 3

 

If your limit number is different from 3, replace 3 with the correct number

 

That will create a file LimitEvaluator3.cs in your Plugins folder (on your layer if you are using a layer). If your limit number isn't 3, it will be whatever number you typed into the !dump command.

 

Attach that file to a reply to this post.

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

Originally Posted by AnonFriction*:

 

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?

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

Originally Posted by Spectralslayer*:

 

Comments from PapaCharlie9:

 

This is a good example as is and should work fine. My comments are just some simplifications that could be made.

 

When I do a check for admin lists, I do it once at the top and return false immediately if the player name is not in the list. After that point you can assume the player is an admin, which simplifies the code. Saves having to test for it multiple times later.

 

I also put the admin list name in a variable at the top, to make it easier to change. See this post for an example:

 

www.phogue.net/forumvb/showth...nd-and-reasons*

 

For version 0.0.0.8, micovery added a function to do player name lookup, so you don't have to do all that AddRange stuff. It's documented in the .cs file and in the plugin details, but unfortunately not in the OP of the Insane Limits thread (some kind of copy&paste mishap). Here's the spec:

 

Code:

/* This method looks in the internal player's list for player with matching name.
     * If fuzzy argument is set to true, it will find the player name that best matches the given name
     *
     /
    PlayerInfoInterface GetPlayer(String name, bool fuzzy);
So just do

 

Code:

PlayerInfoInterface p = plugin.GetPlayer(target, false);
Thanks for the suggestions! I'll get to work rewriting the script, and re-post it when it's ready.

 

Update:

 

Here's the updated script:

 

Code:

//Stores the name of the custom list of admins, edit this to match your list name
string strAdminList = "Admins";

//Check whether player is an admin (using custom list Admins)
if(plugin.isInList(player.Name, strAdminList))
{
    //Check if last chat is a yell command
    if(player.LastChat.ToUpper().StartsWith("@YELL "))
    {
		//Yell the message to everyone on the server
		plugin.ServerCommand("admin.yell", player.LastChat.Substring(5));
	}

    //Check if last chat is a yell command (included a second time due to character offset)
    else if(player.LastChat.ToUpper().StartsWith("/@YELL "))
    {
	    //Yell the message to everyone on the server
		plugin.ServerCommand("admin.yell", player.LastChat.Substring(6));
	}

    //Check if last chat is a pyell command
    else if(player.LastChat.ToUpper().StartsWith("@PYELL ") || player.LastChat.ToUpper().StartsWith("/@PYELL "))
    {
		//Split each word using space as delimiter
		string[] args = player.LastChat.Split(' ');

        //Store target name
		string target = args[1];
		
		//Rebuild message
		string message = "";
		for(int i = 2; i < args.Length; i++)
		{
			message += args[i] + " ";
		}
		
		//Determine target player
        PlayerInfoInterface p = plugin.GetPlayer(target, true);
        
        //Verify that a player was found
        if(p != null && Regex.Match(p.Name, target, RegexOptions.IgnoreCase).Success)
        {
            //Issue the yell
            plugin.ServerCommand("admin.yell", message, "10", "player", p.Name);
            
            //Yell the matched name to the command issuer
            plugin.ServerCommand("admin.yell", "Yelling to " + p.Name, "5", "player", player.Name);
        }
        else
        {
		    //Yell to the command issuer that a target could not be found
		    plugin.ServerCommand("admin.yell", "No players matching name " + target, "5", "player", player.Name);
        }
	}
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Spectralslayer*:

 

Rules. Ok. I try copy...

 

 

[13:41:02] [insane Limits] ERROR: 4 errors compiling Code

[13:41:02] [insane Limits] ERROR: (CS1026, line: 23, column: 64): expected)

[13:41:02] [insane Limits] ERROR: (CS1002, line: 23, column: 104) was expected;

[13:41:02] [insane Limits] ERROR: (CS1525, line: 23, column: 104): Invalid term ')' in expression

[13:41:02] [insane Limits] ERROR: (CS1002, line: 23, column: 105) was expected;

Think I found the issue. While editing I must have accidentally put a space in the middle of a variable name in the first if statement. Here's the fixed code, tested it already to verify that it works (going back to update the original to avoid further confusion as well):

 

 

Code:

//Stores the name of the custom list of admins, edit this to match your list name
string strAdminList = "Admins";

//Check whether the last chat was a rules command
if(player.LastChat.ToUpper().Equals("@RULES")||player.LastChat.ToUpper().Equals("/@RULES"))
{
	//Create the list of rules
	string rules = "";
	rules += ("\n***Server Rules***");
	rules += ("\n1: Rule 1");
	rules += ("\n2: Rule 2");
	
	//Check whether the player issuing the command is an admin (using custom list Admins)
	if(plugin.isInList(player.Name, strAdminList))
	{
		//If issued by an admin, yell to all players (default 10 second duration)
		plugin.ServerCommand("admin.yell", rules);
	}
	else
	{
		//If issued by non-admin, yell only to the command issuer
		plugin.ServerCommand("admin.yell", rules, "10", "player", player.Name);
	}
}

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

Originally Posted by droopie*:

 

Multiple replies below, scan the whole post for your answer.

 

 

"with 20" what? Clicked submit too soon?

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.

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

Originally Posted by Disturbed11B*:

 

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

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