Jump to content

Insane Limits: Warn then Punish pattern


ImportBot

Recommended Posts

  • Replies 71
  • Created
  • Last Reply

Originally Posted by PapaCharlie9*:

 

ok getting warnings now but when you kill a person it says Do not use %w_n%

My bad! I shouldn't mix message methods. Here's a quick fix, but a more thorough fix should be done to make the messages consistent. Unfortunately, I do'nt have time right now.

 

 

Code:

/* Version: V0.8/R1 */
String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);

//plugin.ConsoleWrite("^b[No Rockets]^n (" + killer.FullName + ") warnings = " + warnings);
    
/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
if (warnings == 0) {
        msg = plugin.R("Attention " + killer.Name + "! Do not use %w_n%!");
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        server.Data.setInt(kCounter, warnings+1);
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings == 1) {
        msg = plugin.R("FINAL WARNING " + killer.Name + "! Do not use %w_n%!");
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
} else if (warnings >= 2) {
        msg = plugin.R("Kicking " + killer.Name + " for ignoring warnings and killing with %w_n%!");
        plugin.SendSquadMessage(killer.TeamId, killer.SquadId, msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.PRoConEvent(msg, "Insane Limits");
        plugin.KickPlayerWithMessage(killer.Name, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by EntraVenuS*:

 

ok so far so good papa charlie i owe you big time for this.. i havent had a kick yet but warnings are reporting back ok. will confirm when ive had my first kick thanks so much

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

Originally Posted by PapaCharlie9*:

 

Here's the corrected version. Compiled but not tested.

 

Code:

/* Version: V0.8/R2 */
String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);

//plugin.ConsoleWrite("^b[No Rockets]^n (" + killer.FullName + ") warnings = " + warnings);
    
/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
if (warnings == 0) {
        msg = plugin.R("Attention %k_n%! Do not use %w_n%!");
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        server.Data.setInt(kCounter, warnings+1);
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings == 1) {
        msg = plugin.R("FINAL WARNING %k_n%! Do not use %w_n%!");
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
} else if (warnings >= 2) {
        msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
        plugin.SendSquadMessage(killer.TeamId, killer.SquadId, msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.PRoConEvent(msg, "Insane Limits");
        plugin.KickPlayerWithMessage(killer.Name, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by EntraVenuS*:

 

ok looks good so far .. the last version worked ok gonna run this version and let you know.. do you have a donate button please as i feel the need to give you something as you have given me a lot .. thank you

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

Originally Posted by HexaCanon*:

 

was wondering if this would work with multi-kill with a weapon, since the normal ones in the example topic gets activated more than once (2 kills = once , 3 kills = activated twice and so on ..

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

Originally Posted by PapaCharlie9*:

 

was wondering if this would work with multi-kill with a weapon, since the normal ones in the example topic gets activated more than once (2 kills = once , 3 kills = activated twice and so on ..

By weapon, you mean a gun like an M16A3? Actually, USAS counts as a gun too.

 

According to micovery, it won't work. You never know when to stop counting. Even if you set a time span of like 1 second, you still activate the limit on each and every individual kill. How do you know which one is the last one of the multi-kill?

 

The only reliable way to detect multi-kills is to save the time stamp of each OnKill event and then look backwards in time until you see a gap in time. That would be the end of the multikill. The Insane Limits code doesn't save the time stamp and there are so many delays between when the event is received and when your limit is called that you can't do it yourself.

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

Originally Posted by HexaCanon*:

 

i meant something like this

Code:

String kCounter = "TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(5);
int warnings = 0;
if (player.RoundData.issetInt(kCounter)) warnings = player.RoundData.getInt(kCounter);


if (warnings == 0) {
	plugin.ServerCommand("admin.yell", fragmessage);
	player.RoundData.setInt(kCounter, warnings+1);
	return false;
}


if (limit.Activations(player.Name, time) > 1 (2 instead of 1__) ) return false;


if (warnings >= 1) {
	plugin.ServerCommand("admin.yell", fragmessage);
}
player.RoundData.setInt(kCounter, warnings+1);
return false;
i can see what is wrong, if it happened once it will still shout multi-kill ... hm
* Restored post. It could be that the author is no longer active.
Link to comment
  • 1 month later...

Originally Posted by PapaCharlie9*:

 

Regarding this request:

Hi,

 

How would I use the below killrate checker, in the following way:

 

X per min = warn

X per min 2nd time = kill

X per min 3rd time = banned for a week or X time

The X value is defined in maxKillRate, default is 30 per minute. To change it to something else, change the value 30 in the code where it says CUSTOMIZE.

 

The ban time is in the line of code with EABanPlayerWithMessage. The time is in minutes, so 60 x 24 x 7 is one week. To change that to another time, replace 60*24*7 with some other number of minutes.

 

Set limit to evaluate OnKill. Set Action to None.

 

Set first_check to this Expression:

 

Code:

( true )
Set second_check to this Code:

Code:

/* Version: V0.8/R1 */
int maxKillRate = 30; // CUSTOMIZE

String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(60); // Activations within 1 minute
 
if (limit.Activations(killer.Name, time) < maxKillRate) return false;

int warnings = 0;
if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

String msg = "none";
if (warnings == 0) {
        msg = "WARNING: " + killer.Name + "! Your kill rate is suspiciously high!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
} else if (warnings == 1) {
        msg = "FINAL WARNING " + killer.Name + "! You will be killed for your high kill rate!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.KillPlayer(killer.Name, 5);
} else if (warnings >= 2) {
        msg = "BANNING " + killer.Name + "! For ignoring warnings about kill rate!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, killer.Name, 60*24*7, "ignoring warnings about high kill rate");
}
server.RoundData.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by CBG*:

 

Thanks :smile:

Sorry to be a pain in the rear, how would I add a white list, for set members?

Also would it be possible to Yell the warning, to said player?

 

 

Regarding this request:

 

 

The X value is defined in maxKillRate, default is 30 per minute. To change it to something else, change the value 30 in the code where it says CUSTOMIZE.

 

The ban time is in the line of code with EABanPlayerWithMessage. The time is in minutes, so 60 x 24 x 7 is one week. To change that to another time, replace 60*24*7 with some other number of minutes.

 

Set limit to evaluate OnKill. Set Action to None.

 

Set first_check to this Expression:

 

Code:

( true )
Set second_check to this Code:

Code:

/* Version: V0.8/R1 */
int maxKillRate = 30; // CUSTOMIZE

String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(60); // Activations within 1 minute
 
if (limit.Activations(killer.Name, time) < maxKillRate) return false;

int warnings = 0;
if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

String msg = "none";
if (warnings == 0) {
        msg = "WARNING: " + killer.Name + "! Your kill rate is suspiciously high!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
} else if (warnings == 1) {
        msg = "FINAL WARNING " + killer.Name + "! You will be killed for your high kill rate!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.KillPlayer(killer.Name, 5);
} else if (warnings >= 2) {
        msg = "BANNING " + killer.Name + "! For ignoring warnings about kill rate!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, killer.Name, 60*24*7, "ignoring warnings about high kill rate");
}
server.RoundData.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by CBG*:

 

Hi,

 

I haven't tested this, but if I was to add this at the top

 

if (plugin.isInList(killer.Name, "admin_white_list")) return false;

 

Then use the list function in il, would that work?

 

 

For the yell would this work

 

Change this:

msg = "WARNING: " + killer.Name + "! Your kill rate is suspiciously high!";

 

For

msg = "WARNING Your kill rate is suspiciously high!";

plugin.ServerCommand("admin.yell", msg, "20", "player", killer.Name);

 

and do similar with the kill message?

 

 

Also what version of Insane Limits do I need, if v0.8 which patch do I need.

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

Originally Posted by PapaCharlie9*:

 

Hi,

 

I haven't tested this, but if I was to add this at the top

 

if (plugin.isInList(killer.Name, "admin_white_list")) return false;

 

Then use the list function in il, would that work?

 

 

For the yell would this work

 

Change this:

msg = "WARNING: " + killer.Name + "! Your kill rate is suspiciously high!";

 

For

msg = "WARNING Your kill rate is suspiciously high!";

plugin.ServerCommand("admin.yell", msg, "20", "player", killer.Name);

 

and do similar with the kill message?

 

 

Also what version of Insane Limits do I need, if v0.8 which patch do I need.

Bonus points for trying to help yourself and it is clear you are reading other posts and learning from them. I wish everyone did that! :smile:

 

The admin_white_list is on the right track, but the best way to use it is to put it in the first_check Expression, like this:

 

Code:

( !plugin.isInList(killer.Name, "admin_white_list") )
That replaces the ( true ) that was in the original.

 

Make sure you follow the instructions in the other post to create admin_white_list and populate it with correctly spelled names.

 

For the yell, it's easy enough for me to just add it directly to the code for you. Next time, tell me in the original request t. Actually, I'm still not sure what you want. Do you want both the chat and the yell? Or just the yell? Or do you want the chat and the yell to be just to the player, the original sent the chat to everyone.

 

I'm going to send the chat and the yell just to the player in this version and you can change it back if you want the chat to be global or just delete the chat, covers all bases that way:

 

Code:

/* Version: V0.8/R2 - added yell */
int maxKillRate = 30; // CUSTOMIZE

String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(60); // Activations within 1 minute
 
if (limit.Activations(killer.Name, time) < maxKillRate) return false;

int warnings = 0;
if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

String msg = "none";
if (warnings == 0) {
        msg = "Your kill rate is suspiciously high!";
        plugin.ServerCommand("admin.say", msg, "player", killer.Name);
        plugin.ServerCommand("admin.yell", msg, "20", "player", killer.Name);
        plugin.PRoConChat("ADMIN to " + killer.Name + "> " + msg);
} else if (warnings == 1) {
        msg = "FINAL WARNING! You will be killed for your high kill rate!";
        plugin.ServerCommand("admin.say", msg, "player", killer.Name);
        plugin.ServerCommand("admin.yell", msg, "10", "player", killer.Name);
        plugin.PRoConChat("ADMIN to " + killer.Name + "> " + msg);
        plugin.KillPlayer(killer.Name, 10);
} else if (warnings >= 2) {
        msg = "BANNING " + killer.Name + "! For ignoring warnings about kill rate!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, killer.Name, 60*24*7, "ignoring warnings about high kill rate");
}
server.RoundData.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by CBG*:

 

Hi,

 

Thanks, sorry about that I forgot about the Yell and whitelist.

Not 100% sure if I want both say and yell or just yell, will need to test it out and talk with the clan see how they feel.

If I want just yell, I would remove the line with admin.say?

 

I do have one other question, what version on Insane Limits will I need, do I need 0.8 with patch 3, or will it work on version 0.7?

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

Originally Posted by CBG*:

 

Is there away instead of using admin_white_list to use the player_white_list

In part 2 Whitelist, save having 2 whitelists

 

Would I change:

( !plugin.isInList(killer.Name, "admin_white_list") )

 

to:

( !plugin.isInList(killer.Name, "player_white_list") )

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

Originally Posted by CBG*:

 

Just tried the code and got this.

The first one is, ok but the second is now

 

[18:13:38 81] [insane Limits] ERROR: 6 errors compiling Expression

[18:13:38 81] [insane Limits] ERROR: (CS1026, line: 50, column: 53): ) expected

[18:13:38 81] [insane Limits] ERROR: (CS1002, line: 50, column: 77): ; expected

[18:13:38 81] [insane Limits] ERROR: (CS1525, line: 50, column: 77): Invalid expression term ')'

[18:13:38 81] [insane Limits] ERROR: (CS1026, line: 54, column: 53): ) expected

[18:13:38 81] [insane Limits] ERROR: (CS1002, line: 54, column: 77): ; expected

[18:13:38 81] [insane Limits] ERROR: (CS1525, line: 54, column: 77): Invalid expression term ')'

 

It is set to code not expression

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

Originally Posted by CBG*:

 

Ok think I go a fix for the errors

 

For Warnings 0 and 1 it is:

plugin.PRoConChat("ADMIN to + " killer.Name + "> " + msg);

 

I changed it to

plugin.PRoConChat("ADMIN to " + killer.Name + "> " + msg);

 

Got rid of the errors is that right?

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

Originally Posted by PapaCharlie9*:

 

Hi,

 

Thanks, sorry about that I forgot about the Yell and whitelist.

Not 100% sure if I want both say and yell or just yell, will need to test it out and talk with the clan see how they feel.

If I want just yell, I would remove the line with admin.say?

 

I do have one other question, what version on Insane Limits will I need, do I need 0.8 with patch 3, or will it work on version 0.7?

0.0.0.8 patch 3

 

 

Ok think I go a fix for the errors

 

For Warnings 0 and 1 it is:

plugin.PRoConChat("ADMIN to + " killer.Name + "> " + msg);

 

I changed it to

plugin.PRoConChat("ADMIN to " + killer.Name + "> " + msg);

 

Got rid of the errors is that right?

Yes, well done. I also fixed my original post.

 

 

Is there away instead of using admin_white_list to use the player_white_list

In part 2 Whitelist, save having 2 whitelists

 

Would I change:

( !plugin.isInList(killer.Name, "admin_white_list") )

 

to:

( !plugin.isInList(killer.Name, "player_white_list") )

If you created a list called "player_white_list", yes, that would be correct.
* Restored post. It could be that the author is no longer active.
Link to comment
  • 2 weeks later...

Originally Posted by PapaCharlie9*:

 

Regarding this request:

I am trying to modify the expression and code for an RPG/SMAW kill limit of 10 and kick player on the 11 kill. thanks

I also:

 

* Added yells

* Made the chat messages and initial warning yells go only to the player

 

Create a limit to evaluate OnKill, name it "Rocket Limit", and set Action to None.

 

Set first_check to this Expression:

 

Code:

( Regex.Match(kill.Weapon, @"(RPG-7|SMAW)", RegexOptions.IgnoreCase).Success )
Set second_check to this Code:

 

Code:

/* Version: V0.8/R1 */
String kCounter = killer.Name + "_TreatAsOne_Count_Rocket";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1
    
int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);

/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
if (warnings == 0) {
        msg = "Only 10 kills with " + kill.Weapon + " allowed or be kicked!";
        plugin.ServerCommand("admin.say", "Attention " + killer.Name + "! " + msg, "player", killer.Name);
        plugin.ServerCommand("admin.yell", msg, "15", "player", killer.Name);
        plugin.PRoConChat("ADMIN to " + killer.Name + "> " + msg);
        server.Data.setInt(kCounter, warnings+1);
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings < 10) {
        msg = " " + (warnings+1) + " of 10 kills with " + kill.Weapon + " left before being kicked!";
        plugin.ServerCommand("admin.say", "WARNING " + killer.Name + "!" + msg, "player", killer.Name);
        plugin.ServerCommand("admin.yell", msg, "15", "player", killer.Name);
        plugin.PRoConChat("ADMIN to " + killer.Name + ">" + msg);
} else {
        msg = "Kicking " + killer.Name + " for ignoring warnings and killing with " + kill.Weapon;
        plugin.SendGlobalMessage(msg);
        plugin.ServerCommand("admin.yell", msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.PRoConEvent(msg, "Insane Limits");
        plugin.KickPlayerWithMessage(killer.Name, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ADKGamers*:

 

Doing as you request Charlie for the code below.

 

 

Wanting to kill,kill,temp ban Without the yell, and just using "say" instead. To let that player know as well as others know the player has been killed/temp banned.

 

 

Thank you for your help.

 

 

Code:

/* Version: V0.8/R1 */
String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(2); // Activations within 2 seconds count as 1

int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);

/* Extract short weapon name */
Match m = Regex.Match(kill.Weapon, @"/[^/]+$");
String wn = kill.Weapon;
if (m.Success) wn = m.Groups[1].Value;
if (wn == "Roadkill") wn = "MAV";
    
/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
int delay = 12; // show yell for 12 seconds then kill
if (warnings == 0) {
        msg = plugin.R("Attention %k_n%! Do not use " + wn + "!"); // First warning message
        plugin.SendGlobalMessage(msg);
        plugin.ServerCommand("admin.yell", msg, delay.ToString(), "player", killer.Name);
        plugin.PRoConChat("ADMIN (pyell at " + killer.Name + ") > " + msg);
        plugin.KillPlayer(killer.Name, delay);
        server.Data.setInt(kCounter, warnings+1);
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings == 1) { // Kick
        msg = "for using " + wn + " on Metro!";
        plugin.SendGlobalMessage("Kicking " + killer.Name + " " + msg);
        plugin.PRoConChat("ADMIN > Kicking " + killer.Name + " " + msg);
        plugin.PRoConEvent("Kicking " + killer.Name + " " + msg, "Insane Limits");
        plugin.KickPlayerWithMessage(killer.Name, msg);        
} else if (warnings >= 2) {  // Temp ban
        msg = "for using " + wn + " on Metro!";
        plugin.SendGlobalMessage("Temporarily banning " + killer.Name + " " + msg);
        plugin.PRoConChat("ADMIN > Temporarily banning " + killer.Name + " " + msg);
        plugin.PRoConEvent("Temporarily banning " + killer.Name + " " + msg, "Insane Limits");
        plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60*60*12, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Wanting to kill,kill,temp ban Without the yell, and just using "say" instead. To let that player know as well as others know the player has been killed/temp banned.

You also said, in the other thread, you wanted to limit explosives. What exactly do you mean by explosives? Rockets and M320 or also grenades? What about mortar or C4? I'm going to assume just M320, rockets and grenades, but if you want more, let me know.

 

You didn't say how long you wanted the temp ban to be. I'm going to assume 12 hours.

 

This code works on all maps. If you only want it to work on Metro or whatever, let me know.

 

Create a limit to evaluate OnKill. Call it "No Explosives". Set Action to None.

 

Set first_check to this Expression:

 

Code:

( Regex.Match(kill.Weapon,  @"(M320|RPG|SMAW|M67)", RegexOptions.IgnoreCase).Success )
Set second_check to this Code:

 

Code:

/* Version: V0.8/R1 */
String kCounter = killer.Name + "_TreatAsOne_Count_NoBang";
TimeSpan time = TimeSpan.FromSeconds(2); // Activations within 2 seconds count as 1

int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);

/* Extract short weapon name */
Match m = Regex.Match(kill.Weapon, @"/([^/]+)$");
String wn = kill.Weapon;
if (m.Success) wn = m.Groups[1].Value;

    
/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
if (warnings == 0) {
        msg = plugin.R("Attention %k_n%! Do not use " + wn + " or be banned!"); // First warning message
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN (pyell at " + killer.Name + ") > " + msg);
        plugin.KillPlayer(killer.Name, 3);
        server.Data.setInt(kCounter, warnings+1);
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings == 1) { // Kill
        msg = plugin.R("FINAL WARNING: %k_n%! Do not use " + wn + "!"); // Final warning message
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > Kicking " + killer.Name + " " + msg);
        plugin.KillPlayer(killer.Name, 3);        
} else if (warnings >= 2) {  // Temp ban
        msg = "for using " + wn + "!";
        plugin.SendGlobalMessage("Temporarily banning " + killer.Name + " " + msg);
        plugin.PRoConChat("ADMIN > Temporarily banning " + killer.Name + " " + msg);
        plugin.PRoConEvent("Temporarily banning " + killer.Name + " " + msg, "Insane Limits");
        plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60*12, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by CBG*:

 

Hi,

 

I am using the code you did for me on page 5, thank you for that :smile:

I am using yell for the You will be killed message

 

But I have noticed some are asking why they was killed, so is it possible to delay the killing for 10 seconds while, the yell message is being displayed?

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

Originally Posted by HexaCanon*:

 

Hi,

 

I am using the code you did for me on page 5, thank you for that :smile:

I am using yell for the You will be killed message

 

But I have noticed some are asking why they was killed, so is it possible to delay the killing for 10 seconds while, the yell message is being displayed?

i have seen the code and the kill is already delayed for 10 seconds

 

Code:

/* Version: V0.8/R2 - added yell */
int maxKillRate = 30; // CUSTOMIZE

String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(60); // Activations within 1 minute
 
if (limit.Activations(killer.Name, time) < maxKillRate) return false;

int warnings = 0;
if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

String msg = "none";
if (warnings == 0) {
        msg = "Your kill rate is suspiciously high!";
        plugin.ServerCommand("admin.say", msg, "player", killer.Name);
        plugin.ServerCommand("admin.yell", msg, "20", "player", killer.Name);
        plugin.PRoConChat("ADMIN to " + killer.Name + "> " + msg);
} else if (warnings == 1) {
        msg = "FINAL WARNING! You will be killed for your high kill rate!";
        plugin.ServerCommand("admin.say", msg, "player", killer.Name);
        plugin.ServerCommand("admin.yell", msg, "10", "player", killer.Name);
        plugin.PRoConChat("ADMIN to " + killer.Name + "> " + msg);
        plugin.KillPlayer(killer.Name, [size=7][b]10[/b][/size]);
} else if (warnings >= 2) {
        msg = "BANNING " + killer.Name + "! For ignoring warnings about kill rate!";
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, killer.Name, 60*24*7, "ignoring warnings about high kill rate");
}
server.RoundData.setInt(kCounter, warnings+1);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ADKGamers*:

 

You also said, in the other thread, you wanted to limit explosives. What exactly do you mean by explosives? Rockets and M320 or also grenades? What about mortar or C4? I'm going to assume just M320, rockets and grenades, but if you want more, let me know.

 

You didn't say how long you wanted the temp ban to be. I'm going to assume 12 hours.

 

This code works on all maps. If you only want it to work on Metro or whatever, let me know.

 

Create a limit to evaluate OnKill. Call it "No Explosives". Set Action to None.

 

Set first_check to this Expression:

 

Code:

( Regex.Match(kill.Weapon,  @"(M320|RPG|SMAW|M67)", RegexOptions.IgnoreCase).Success )
Set second_check to this Code:

 

Code:

/* Version: V0.8/R1 */
String kCounter = killer.Name + "_TreatAsOne_Count_NoBang";
TimeSpan time = TimeSpan.FromSeconds(2); // Activations within 2 seconds count as 1

int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);

/* Extract short weapon name */
Match m = Regex.Match(kill.Weapon, @"/([^/]+)$");
String wn = kill.Weapon;
if (m.Success) wn = m.Groups[1].Value;

    
/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
if (warnings == 0) {
        msg = plugin.R("Attention %k_n%! Do not use " + wn + " or be banned!"); // First warning message
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN (pyell at " + killer.Name + ") > " + msg);
        plugin.KillPlayer(killer.Name, 3);
        server.Data.setInt(kCounter, warnings+1);
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings == 1) { // Kill
        msg = plugin.R("FINAL WARNING: %k_n%! Do not use " + wn + "!"); // Final warning message
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > Kicking " + killer.Name + " " + msg);
        plugin.KillPlayer(killer.Name, 3);        
} else if (warnings >= 2) {  // Temp ban
        msg = "for using " + wn + "!";
        plugin.SendGlobalMessage("Temporarily banning " + killer.Name + " " + msg);
        plugin.PRoConChat("ADMIN > Temporarily banning " + killer.Name + " " + msg);
        plugin.PRoConEvent("Temporarily banning " + killer.Name + " " + msg, "Insane Limits");
        plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60*60*12, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;

Thank you for the response, yes I will be using it for explosives, but I was just going to add in the ones that I was using, since I understood that part :smile: It was just the second part that I needed help with. And the temp ban time will be 2 hours

 

 

Thank you for your help!

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

Originally Posted by PapaCharlie9*:

 

Thank you for the response, yes I will be using it for explosives, but I was just going to add in the ones that I was using, since I understood that part :smile: It was just the second part that I needed help with. And the temp ban time will be 2 hours

 

 

Thank you for your help!

Oops! I got the units wrong for the time of the temp ban. It should be minutes, not seconds. So for 2 hours you want 60*2.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ADKGamers*:

 

Oops! I got the units wrong for the time of the temp ban. It should be minutes, not seconds. So for 2 hours you want 60*2.

Thank you and do you have a list for all the weapons?

 

I would like to add these as well: C4,M224 MORTAR, Claymore, RoadKill

 

 

Although I believe I entered them properly I just want to make sure.

 

 

Also, if I want it to Log to the log file, do I just need to use the "log action" or is there something else that needs to be done? Someone just got temp banned but it's not showing up in the log file, via the log action i set up.

 

 

Thanks for your help!

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

Originally Posted by PapaCharlie9*:

 

Thank you and do you have a list for all the weapons?

 

I would like to add these as well: C4,M224 MORTAR, Claymore, RoadKill

 

 

Although I believe I entered them properly I just want to make sure.

 

 

Also, if I want it to Log to the log file, do I just need to use the "log action" or is there something else that needs to be done? Someone just got temp banned but it's not showing up in the log file, via the log action i set up.

 

 

Thanks for your help!

All of the weapon codes are in the BF3.def file, which you will find in your PRoCon installation in the Configs folder. For long codes, like Weapons/Gadgets/C4/C4, you just need the unique substring of the code, so "C4" would do just fine.

 

No need to use a Log Action, code gives you more flexibility.

 

Which log file? If you want to log to the plugin.log file, use:

 

plugin.ConsoleWrite(String text);

 

If you want to log into the chat.log file, use:

 

plugin.PRoConChat(String text);

 

If you want to log into the event.log file, use:

 

plugin.PRoConEvent(String text, String identifier);

 

I usually use "Insane Limits" as the identifier, but the name of your limit or the name of a player may be used, as appropriate.

 

To log into a custom log file, use:

 

plugin.Log(String filepath, String text);

 

Where filepath is relative to your PRoCon folder, so plugin.R("Logs/%server_host%_%server_port%/mylog.log") would put it in the standard procon/Logs/serverIP_port/ folder.

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

Originally Posted by PapaCharlie9*:

 

Is it possible to do a white list for the clantag?

Regarding: myrcon.net/...insane-limits-warn-then-punish-pattern#entry23545

 

I'm going to assume that you mean add the capability of using clan tags, as well as names, to the admin_white_list you already have in your first_check.

 

Change your first_check to this Code (used to be Expression, so make sure you change it to Code):

 

Code:

String tag = killer.Tag;
if (String.IsNullOrEmpty(tag)) {
	// Maybe they are using [_-=]XXX[=-_]PlayerName format
	Match tm = Regex.Match(killer.Name, @"^[=_\-]_([^=_\-]{2,4})[=_\-]");
	if (tm.Success) {
		tag = tm.Groups[1].Value;
	} else {
		tag = "no tag";
	}
}

return ( ! (plugin.isInList(killer.Name, "admin_white_list") || plugin.isInList(tag, "admin_white_list")) );
If you meant have a separate list from admin_white_list for clan tags, just change the "admin_white_list" string parameter in the second plugin.isInList call.
* Restored post. It could be that the author is no longer active.
Link to comment

Archived

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




  • Our picks

    • Game Server Hosting:

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

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

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

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

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

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

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


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



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

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



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

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

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



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


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


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




      Procon Layer will be $2 USD per month.


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


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


      Each layer will automatically restart if Procon crashes. 


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


      Custom plugins can be installed by submitting a support ticket.




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


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





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

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

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

       
      • 9 replies
×
×
  • Create New...

Important Information

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