Insane limits examples

Slawter

Support team
5 Сен 2014
22.731
881
COPIED FROM MYRCON.COM BECAUSE OF FORUM Closure Imminent


Simple Rank Limit
Set limit to evaluate OnJoin, set action to Kick or ban, or any other action you wish​
Set first_check to this Expression:​
Code:​
( player.Rank > 45 )​
You may change the rank value from 45 to whatever value you want.​
 
Последнее редактирование:

Slawter

Support team
5 Сен 2014
22.731
881
Smart Rank Limit
Suppose that you want to be tolerant and allow the server to fill up and only kick the high ranking players after a certain point. You can achieve this by combining the Simple Rank Limit with another Expression using the server's player count.

Set limit to evaluate OnJoin, and set action to Kick ...

Set first_check to this Expression:

Code:
( player.Rank > 45 && server.PlayerCount > 30 )
This will allow the server to fill up to 30 players, and start kicking high ranking players only after the 31st player joins.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Simple Country Kicker
Suppose you wanted to kick players who join your server from Russia, India, or Iran.

Set limit to evaluate OnJoin, and set action to Kick

Set first_check to this Expression:

Code:
Regex.Match(player.CountryCode, "(RU|IR|IN)", RegexOptions.IgnoreCase).Success
Any player that joins the server, whose country code matches "RU", "IR", or "IN" will be kicked.

What if you want to setup a negative check ... like kick anyone that joins who is not from "US". In that case, you can do this:

Set limit to evaluate OnJoin, and set action to Kick

Set first_check to this Expression:

Code:
! Regex.Match(player.CountryCode, "(US)", RegexOptions.IgnoreCase).Success​
 

Slawter

Support team
5 Сен 2014
22.731
881
Battlelog Kdr Kicker
This limit combines both Kdr, and Accuracy measurements from Battlelog to kick suspicious players.

Set limit to evaluate OnSpawn, and action to Kick

Set first_check to this Expression:

Code:
( player.Kdr > 4.0 || player.Accuracy > 50 )
You may adjust the values of Kdr, and Accuracy as you see fit.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Battlelog Excessive Recon/Sniper Kicker
This limit will kick any player on the server who uses recon kit more than 90% of the time, and has good Kdr.

Set limit to evaluate OnJoin, Set action to Kick

Set first_check to this Expressio:

Code:
( player.ReconPercent > 90 && player.Kdr > 2.0 )
You may adjust the values in the check expression as you see fit.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Admin Request Notification
This limit creates a Windows Taskbar notification when someone in-game types something like:

"Admin Please kick micovery for hacking!"


Set the limit to evaluate OnAnyChat, and make the action be TaskbarNotify.

Set first_check to this Expression:

Code:
player.LastChat.StartsWith("Admin")​

And set these action specific parameters:

Code:
taskbar_notify_title = Admin Request from %p_n%
taskbar_notify_message = %p_n% says, %p_lc%​

A few users have tested it and reported that the task-bar notification won't show if plugin is running on layer.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Excessive Kill Rate Kicker
This limit will check for how fast a player makes kills, and perform whatever action you want, if the player exceeds the rate you specify.


Set the limit to evaluate for OnKill, and set the action to Kick

Set first_check to this Expression:

Code:
(true)​
Set the second_check to this Expression:

Code:
( limit.Activations(player.Name, TimeSpan.FromSeconds(30)) > 10 )​
In this example, the rate is +10 kills, in 30 seconds. You may want to adjust this rate as you wish.


What if you wanted to check for the Headshot rate ? Well you can do that as well. In that case, just modify the first_check Expression to activate only for Headshots like this:

Code:
( kill.Headshot == true)​
 

Slawter

Support team
5 Сен 2014
22.731
881
Simple Weapon Kill Spree
For this example, I will use pistols, but you may do it for any weapon you wish, as long as you know the name of the weapon. This kill-spree limit will send a message to the server whenever a player reaches or exceeds a certain amount of kills with the weapon. Each time the message says the number of kills.

Set limit to evaluate OnKill, Set action to Say

Set first_check to this Expression:

Code:
Regex.Match(kill.Weapon, @"(M1911|M9|M93R|Taurus|MP412REX|MP443|Glock)", RegexOptions.IgnoreCase).Success​

Set second_check to this Expression:

Code:
( limit.Spree(player.Name) > 5 )​

Set these action specific parameters:

Code:
say_audience = All
say_message = %p_n% is on a killing spree with his %w_n%, he has %r_x% kills with it!​
So in this example, more than 5 pistol kills (without dying) with a pistol is considered a spree. You may change the spree condition to start sending messages at different value.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Suicide Jumper Shame
In this example, the limit tracks when a player dies by "SoldierCollision" which is usually from a big fall.


Set a limit to evaluate OnSuicide, and action to Say

Set first_check to this Expression:

Code:
kill.Weapon.Equals("SoldierCollision")​
Set these action specific parameters:

Code:
say_audience = All
say_message = %p_n% just jumped to his death, for the %p_x_th% time this round!​
 

Slawter

Support team
5 Сен 2014
22.731
881
Weapon Multi-Kill achievement
For this limit, you can set it to any weapon you wish, as long as you know the name of the weapon. I will show it here for "C4". The way it works is that it tracks multiple kills in a very short amount of time with the same weapon. When this happens, you are either hacking or you just got a multi-kill.


Set limit to evaluate OnKill, and set action to Say

Set first_check to this Expression:

Code:
( kill.Weapon.Equals("C4") )​
Set second_check to this Expression::

Code:
( limit.Activations(player.Name, TimeSpan.FromSeconds(10)) > 1 )​
And set these action specific parameters:

Code:
say_audience = All
say_message = %p_n% multi-kill achievement with %w_n%!​
The rate for this limit is +1 kill in 10 seconds, you may adjust this as you see fit.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Melee/Knife Death Shame
This limit sends a shame message to the server when a player is meleed, or knifed.

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

Set the fist_check to this Expression:

Code:
Regex.Match(kill.Weapon, "(Melee|Knife)").Success​
And set these action specific parameters:

Code:
say_audience = All
say_message = %k_n% just sliced %v_n%'s throat, what a shame!​
 

Slawter

Support team
5 Сен 2014
22.731
881
Team First Blood
This limit sends a global message for the first kill of the round, in each team

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(player.TeamId) == 1​
And set these action specific parameters:

Code:
say_message = %p_n% got the first kill on his team this round with %w_n%!
say_audience = All​
 

Slawter

Support team
5 Сен 2014
22.731
881
Server First Blood
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%!​
 

Slawter

Support team
5 Сен 2014
22.731
881
Round Kpm Kicker
This limit will activate for players that exceed a certain Kpm value during the round. In this example the actionbeing taken is Kick, but you may set it to any action you want.


Set limit to evaluate OnInterval, and set action to Kick

Set first_check to this Expression:

Code:
( player.KpmRound > 30 && (player.TimeRound/60) > 5 )​

Note that for sanity reasons, I have put an extra check to make sure that the player has been playing in the current round for at least 5 minutes. That way the Kpm measure has some time to stabilize itself, before a kick based on Kpm can be considered.

You may change the values being checked in the Expression as you see fit.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Kife Only Server
This limit will check for how many times a player made non-kife kills. On the first kill, it will send a warning on chat, on the second kill, it will kick the player.


Set limit to evaluate OnKill, set action to None


Set first_check to this Expression:

Code:
! Regex.Match(kill.Weapon, @"(Melee|Knife)", RegexOptions.IgnoreCase).Success​
Set second_check to this Code:

Code:
double count = limit.Activations(player.Name);

if (count == 1)
plugin.SendGlobalMessage(plugin.R("%p_n%, this is a knife only server, do not use %w_n% again! Next time kick"));
else if (count > 1)
plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked you for using %w_n% on knife only server"));
return false;​
 

Slawter

Support team
5 Сен 2014
22.731
881
Multi-Message Kill Spree
This limit is for tracking player's kill sprees. The example only tracks kills (not team-kills). This is a base example, you can modify it to track kills with specific weapons, etc. You can do that by modifying the first_check Expression. If not sure, as for help in this thread.

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

Set the first_check to this Expression:

Code:
( true )​

Set the second_check to this Code:

Code:
double count = limit.Spree(player.Name);

if (count == 4)
plugin.SendGlobalMessage(plugin.R("%p_n% has a %r_x% kill spree!"));
else if (count == 5)
plugin.SendGlobalMessage(plugin.R("%p_n% has a %r_x% kill spree! He's on fire!"));
else if (count == 6)
plugin.SendGlobalMessage(plugin.R("%p_n% has a %r_x% kill spree! Getting ridiculous!"));
else if ( count > 6)
plugin.SendGlobalMessage(plugin.R("%p_n% has a %r_x% kill spree! He's unstoppable!"));

return false;​

The kill spree messages start at 4, and go all the way to 6 kills. After 6 kills, it's always the same message being sent, just with a different kill count. You can modify these values as you see fit, or even add more messages to extend it.​
 

Slawter

Support team
5 Сен 2014
22.731
881
No RPG/M320 Server
Set limit to evaluate OnKill, set action to Kick_Say, or any other action you wish

Set first_check to this Expression:

Code:
( kill.Weapon.Equals("M320") ) || ( kill.Weapon.Equals("RPG-7") ) || ( kill.Weapon.Equals("SMAW") )​

Set these action specific parameters:

Code:
kick_message = No M320\RPG\SMAW! connect again and dont use this weapon!
say_message = %p_n% killed with %w_n%, he kill %v_n%! KICKED!​
 

Slawter

Support team
5 Сен 2014
22.731
881
Multi-Message Death Spree
This limit is very similar to the Multi-Message Kill Spree the only parts that change are the event, and the messages. Basically, it counts how many times the player has died. (suicides not counted). The spree count is reset as soon as player makes a kill.

Set the limit evaluation to OnDeath, and set the action to None

Set the fist_check to this Expression:

Code:
( true )​

Set the second_check to this Code:

Code:
double count = limit.Spree(player.Name);

if (count == 4)
plugin.SendGlobalMessage(plugin.R("%p_n% has died for the %r_x_th% time!"));
else if (count == 5)
plugin.SendGlobalMessage(plugin.R("%p_n% has died for the %r_x_th% time, Waahmbulance!"));
else if (count == 6)
plugin.SendGlobalMessage(plugin.R("%p_n% has died for the %r_x_th% time, Maybe take a break?"));
else if ( count > 6)
plugin.SendGlobalMessage(plugin.R("%p_n% has died for the %r_x_th% time, Alt-F4 now please!"));

return false;​

The messages start at the 4th death, and go up to 6. After the 6th death, all messages are the same, but with different count. You may adjust the checks to start at different count values, or extend it to add more messages.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Pistol Only Server
This limit will check for how many times a player made non-pistol kills. On the first kill, it will send a warning on chat, on the second kill, it will kick the player.


Set limit to evaluate OnKill, set action to None


Set first_check to this Expression:

Code:
! Regex.Match(kill.Weapon, @"(M1911|M9|M93R|Taurus|MP412REX|MP443|Glock)", RegexOptions.IgnoreCase).Success​

Set second_check to this Code:

Code:
double count = limit.Activations(player.Name);

if (count == 1)
plugin.SendGlobalMessage(plugin.R("%p_n%, this is a pistol only server, do not use %w_n% again! Next time kick"));
else if (count > 1)
plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked you for using %w_n% on pistol only server"));

return false;​

You can use this limit as a template for restricting any weapon you want. Just change the Expression in the first_check depending on what weapon you want to restrict. The way it is right now, it will activate for any Non-Pistol ... that is because of the Negation symbol "!" at the begining of the expression. If you remove, the Negation symbol "!", it becomes a positive check. So you could make it activate for certain weapons, and restrict those only, while allowing the rest.​
 

Slawter

Support team
5 Сен 2014
22.731
881
Bad Words Kicker (Regular Epxressions Optional)
This limit works as a simple chat filtering system. After each player sends a chat message, it scans the text of the chat, and looks for bad words in it. If it finds that one of the words matches the words in the bad words list, it kicks the player. It also sends a global message to let players know who was kicked for profanity.

Set limit to evaluate OnAnyChat, and action to None,

Set first_check to this Code:

Code:

List<String> bad_words = new List<String>();

bad_words.Add("word1");
bad_words.Add("word2");
bad_words.Add("word3");
bad_words.Add("word4");

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)
{
plugin.ConsoleWarn(plugin.R("Kicked %p_n% for saying "+bad_word));
plugin.SendGlobalMessage(plugin.R("Kicking %p_n% for profanity!"));
plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked for saying "+bad_word+"!"));
}

return false;​

You may add as many words as you want to the bad-words list, or even use Regular Expressions to match multiple spellings of the same word.​