Jump to content

Insane Limits - Examples


Recommended Posts

Originally Posted by Singh400*:

 

I use the following to catch the hackers with insanely high SPM's. Works very well. Caught 4 hackers that weren't caught by PB, PBBans or GGC.

 

Set limit to evaluate OnJoin, set action to PBBan or any other action you wish.

 

Set first_check to this Expression:

Code:

( player.Spm > 1150 )
You may change the SPM value from 1150 to whatever value you want.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

Singh400, Thanks for the example, I just noticed there was no Battlelog SPM Kicker example. I indexed your example under "Battlelog Spm Kicker" ... I also fixed a simple error it had with the capitalization "Player" vs "player".

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

Originally Posted by PapaCharlie9*:

 

Okay, looks like plenty of interest! As it happens, I got a request from my clan to create an in-game command that "forces" a lone wolf player to join my squad, or that "forces" all lone wolf players to join squads. So I'm going to be working on that command (!recruit PlayerName) first. Then I'll work on the !makeroom/!clear queue/whatever command. This is all assuming that the admin.movePlayer command will work within the same team to move from squad 0 to squad >0 -- barring locked squads, full squads, random move failures, etc. I'll have to test it out manually first to see if it is even worth it.

 

Keep kicking the people who just joined (that were in queue), unless is the VIP you are looking for.

I think there should be a few policy options. Opinions differ on what's best. I was actually leaning more towards the idea that players who have been in the game the longest would be kicked instead of fresh off the join queue. Having waited 20 minutes in a queue only to be DC'd on join myself, believe me, it's rage inducing. Never occurred to me the EA DC messsage might be bogus -- LOL!

 

Possible policies:

 

* Kick based on current round score, kills, membership in squad, etc.

* Kick shortest time in round until VIP joins. Should kick those that were just in the queue.

* Kick longest time in game (all rounds) until VIP joins. Should give people in queue a chance to play.

 

If someone else wants to work on this rather than wait for me, by all means. Just let me know so I don't duplicate your effort.

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

Originally Posted by Singh400*:

 

Singh400, Thanks for the example, I just noticed there was no Battlelog SPM Kicker example. I indexed your example under "Battlelog Spm Kicker" ... I also fixed a simple error it had with the capitalization "Player" vs "player".

Ah, I didn't realise the code was case-sensitive.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by WaxMyCarrot*:

 

I was actually leaning more towards the idea that players who have been in the game the longest would be kicked instead of fresh off the join queue. Having waited 20 minutes in a queue only to be DC'd on join myself, believe me, it's rage inducing.

I think as a server owner.. I would rather keep guys who have been there longest cause they are the foundation. Maybe make a few options in the plugin and leave it up to the admin to decide what method to use.. here are a few ideas.

 

Last joiner

lone Wolves

Lowest/Highest kills

Lowest/highest deaths

Largest/smallest K/D

Largest/smallest SPM

 

 

Just a few

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

Originally Posted by PapaCharlie9*:

 

Already a plugin for that is it gives you any additional hints on some of the steps.

 

www.phogue.net/forumvb/showth...-01-13-12)-BF3*

Awesome. It doesn't have the in-game command I want, but I can probably steal code out of it. :smile:

 

Some good additional policies -- I forgot about idle. I might have to use a custom list as the UI, e.g., list your policies in descending priority order: Idle, LowKills, LowScore, Oldest

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

Originally Posted by PapaCharlie9*:

 

This example displays a formatted clan tag leaderboard table at the end of every Conquest or TDM round. The leaderboard is displayed up to 3 times at the end of the round: at 20% of tickets left, at 10% and finally at 5%.

 

Clan tags are sorted and first, second and third place determined by average score and average kills. A clan tag is included only if there are at least 2 players with that tag in the round when the table is calculated. All players without a tag are averaged as the "no tag" entry. If there are insufficient players to fill up the 3rd or 2nd place slot, "--" is displayed. By using averages, a clan that only has 3 players in the round has a fighting chance against a clan with 11 players in the round for first place, etc. Solitary players with a tag are excluded, since one hot-shot pro can dominate a mix of players from another clan. Clans are all about team play anyway. :smile:

 

Here are a couple of screenshots:

 

Posted Image

 

Posted Image

 

NOTE: Coders should see the detailed notes at the bottom of the post. There are some re-usable subroutines that you can put in your toolbox.

 

Set limit to evaluate OnKill, set action to None

 

Set first_check to this Expression:

 

Code:

( Regex.Match(server.Gamemode, "(Conquest|Team)", RegexOptions.IgnoreCase).Success && (server.RemainTicketsPercent(1) < 20 || server.RemainTicketsPercent(2) < 20) )
Set second_check to this Code:

 

Code:

/* Check if near end of round */

int level = 2;

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

if (!limit.RoundData.issetDouble("EOR")) { // EOR: End Of Round
	limit.RoundData.setDouble("EOR", 20); // Threshhold
}

/* First activation is a gimme, check for 2nd and 3rd */

double thresh = limit.RoundData.getDouble("EOR");

if (server.RemainTicketsPercent(1) > thresh && server.RemainTicketsPercent(2) > thresh) {
	if (level >= 5) {
		plugin.ConsoleWrite("^bEOR Debug^n: T1/T2 = " + String.Format("{0:F1}",server.RemainTicketsPercent(1)) +"/"+ String.Format("{0:F1}",server.RemainTicketsPercent(2)));
	}
	return false; // don't do anything;
}

/* Set the next threshhold */

if (thresh == 20) {
	// Set up the 2nd threshhold
	limit.RoundData.setDouble("EOR", 10);
} else if (thresh == 10) {
	// Set up the 3rd threshhold
	limit.RoundData.setDouble("EOR", 5);
} else if (thresh == 5) {
	// Set up the last threshhold
	limit.RoundData.setDouble("EOR", 0);
} else if (thresh == 0) {
	// Stop announcing
	return false;
}

/* Logging */

Dictionary<String, String> shortMap = new Dictionary<String,String>();
shortMap.Add("MP_001", "Bazaar");
shortMap.Add("MP_003", "Teheran");
shortMap.Add("MP_007", "Caspian");
shortMap.Add("MP_011", "Seine");
shortMap.Add("MP_012", "Firestorm");
shortMap.Add("MP_013", "Damavand");
shortMap.Add("MP_017", "Canals");
shortMap.Add("MP_018", "Kharg");
shortMap.Add("MP_Subway", "Metro");
shortMap.Add("MP_SUBWAY", "Metro");
shortMap.Add("XP1_001", "Karkand");
shortMap.Add("XP1_002", "Oman");
shortMap.Add("XP1_003", "Sharqi");
shortMap.Add("XP1_004", "Wake");

String mfname = server.MapFileName.ToUpper();
String map = mfname;
if (shortMap.ContainsKey(mfname)) map = shortMap[mfname];


if (level >= 4) {
	double t1 = Math.Round(server.RemainTickets(1));
	double t2 = Math.Round(server.RemainTickets(2));
	String t1p = String.Format("{0:F1}",server.RemainTicketsPercent(1));
	String t2p = String.Format("{0:F1}",server.RemainTicketsPercent(2));
	plugin.ConsoleWrite(@"^b[EOR]^n: ^b^4" + map + "^0^n T1/T2 T1%/T2% = " + t1 +"/"+ t2 + " " + t1p + "/" + t2p + ", threshhold=" + thresh);
}

/* Collect clan statistics */

List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
players.AddRange(team1.players);
players.AddRange(team2.players);
Dictionary<String, double> clanCounts = new Dictionary<String, double>();
Dictionary<String, double> clanScores = new Dictionary<String, double>();
Dictionary<String, double> clanKills = new Dictionary<String, double>();

foreach(PlayerInfoInterface player_info in players)
{
	String tag = player_info.Tag;
	if(tag.Length == 0) {
		// Maybe they are using [_-=]XXX[=-_]PlayerName format
		Match tm = Regex.Match(player_info.Name, @"^[=_\-]_([^=_\-]{2,4})[=_\-]");
		if (tm.Success) {
			tag = tm.Groups[1].Value;
			if (level >= 4 && !clanCounts.ContainsKey(tag)) plugin.ConsoleWrite("^b[EOR]^n extracted [" + tag + "] from " + player_info.Name);
		} else {
			// Use the default "everybody else" tag
			tag = "no tag";
		}
	}	

	if (!clanCounts.ContainsKey(tag)) clanCounts.Add(tag, 0);

	clanCounts[tag] += 1;

	if (!clanScores.ContainsKey(tag)) clanScores.Add(tag, 0);

	clanScores[tag] += player_info.ScoreRound;

	if (!clanKills.ContainsKey(tag)) clanKills.Add(tag, 0);

	clanKills[tag] += player_info.KillsRound;
}

/* Sort all clans by average score */

String[] scoreTags = { "--", "--", "--" };

List<KeyValuePair<String, double>> list = new List<KeyValuePair<String, double>>();

foreach (KeyValuePair<String, double> pair in clanScores) {
	list.Add(pair);
}

if (list.Count > 0) {

	list.Sort(
		delegate(KeyValuePair<String, double> firstPair, KeyValuePair<String, double> nextPair) {
			double na = clanCounts[firstPair.Key];
			double nb = clanCounts[nextPair.Key];
			
			if (na != 0 && nb == 0) return -1;
			if (na == 0 && nb != 0) return 1;
			if (na == 0 && nb == 0) return 0;
			
			double a = firstPair.Value/na;
			double b = nextPair.Value/nb;
			
			if (a > B) return -1;
			if (a < B) return 0;
			return 0; // equal
		}
	);

	// Example: #1[LGN]/9: 2039.1, #2no tag/27: 1689.3, #3[SOG]/2: 588.5, ...

	int place = 0;
	String message = ": ";
	foreach(KeyValuePair<String, double> pair in list) {
		double n = clanCounts[pair.Key];
		if (n < 2) continue; // Skip solitary players
		String tmp = String.Empty;
		if (!pair.Key.Equals("no tag")) {
			tmp = "[" + pair.Key + "]";
		} else {
			tmp = pair.Key;
		}
		if (place < 3) {
			scoreTags[place] = tmp;
		}
		place += 1;
		message = message + "#" + place + tmp + "/" + n + ": " + String.Format("{0:F1}",(pair.Value/n)) + ", ";
		if (place >= 6) break; // Limit to top 6
	}
	if (level >= 3 && place > 0) {
		message = "Tags by avg score" + message + "...";
		plugin.ConsoleWrite("^b[EOR]^n: " + message);
	}
}


/* Sort all clans by average kills */

String[] killTags = { "--", "--", "--" };

list.Clear();

foreach (KeyValuePair<String, double> pair in clanKills) {
	list.Add(pair);
}

if (list.Count > 0) {

	list.Sort(
		delegate(KeyValuePair<String, double> firstPair, KeyValuePair<String, double> nextPair) {
			double na = clanCounts[firstPair.Key];
			double nb = clanCounts[nextPair.Key];
			
			if (na != 0 && nb == 0) return -1;
			if (na == 0 && nb != 0) return 1;
			if (na == 0 && nb == 0) return 0;
			
			double a = firstPair.Value/na;
			double b = nextPair.Value/nb;
			
			if (a > B) return -1;
			if (a < B) return 1;
			return 0; // equal
		}
	);

	// Example: #1[SOG]/9: 17.3, #2[365]/2: 11.5, #3no tag/40: 6.6, ...

	int place = 0;
	String message = ": ";
	foreach(KeyValuePair<String, double> pair in list) {
		double n = clanCounts[pair.Key];
		if (n < 2) continue; // Skip solitary players
		String tmp = String.Empty;
		if (!pair.Key.Equals("no tag")) {
			tmp = "[" + pair.Key + "]";
		} else {
			tmp = pair.Key;
		}
		if (place < 3) {
			killTags[place] = tmp;
		}
		place += 1;
		message = message + "#" + place + tmp + "/" + n + ": " + String.Format("{0:F1}",(pair.Value/n)) + ", ";
		if (place >= 6) break; // Limit to top 6
	}
	if (level >= 3 && place > 0) {
		message = "Tags by avg kills" + message + "...";
		plugin.ConsoleWrite("^b[EOR]^n: " + message);
	}
}

/* Chat character width table for formatting scoreboard */

/* 
This was done entirely by eyeball, so it is just an estimate. It is
normalized to the pixel width of the lower case 'x' character. That is 1.0.
Values less than 1.0, such as 0.8, are narrower than 'x'. Values greater
than 1.0, such as 1.2, are wider than 'x'.

I estimated the width of a tab column to be 4.7. That errs on the
side of being too low, which means it's possible for the next
column to be too far over. The resulting table might look like
this:

Score   Kills
[XXX]       [YYY]

I thought that was less confusing than being too close:

Score   Kills
[XXX][YYY]

Finally, the table is incomplete. It doesn't have all possible
character codes in it. Any character that is not found in
the table is assumed to be 1.0 in the code that uses the table.
*/

Dictionary<Char, double> widths = new Dictionary<Char, double>();

widths.Add('-', 0.8);

widths.Add('0', 1.3); widths.Add('1', 0.7); widths.Add('2', 1.2); widths.Add('3', 1.2); widths.Add('4', 1.2); widths.Add('5', 1.2); widths.Add('6', 1.1); widths.Add('7', 1.0); widths.Add('8', 1.1); widths.Add('9', 1.1);

widths.Add(':', 1.0); widths.Add(';', 1.0); widths.Add('<', 1.0); widths.Add('=', 1.0); widths.Add('>', 1.0); widths.Add('_', 1.2); widths.Add('@', 2.0);

widths.Add('A', 1.3); widths.Add('B', 1.25); widths.Add('C', 1.3); widths.Add('D', 1.3); widths.Add('E', 1.1); widths.Add('F', 0.9); widths.Add('G', 1.3); widths.Add('H', 1.3); widths.Add('I', 0.5); widths.Add('J', 1.2); widths.Add('K', 1.2); widths.Add('L', 1.1); widths.Add('M', 1.4); widths.Add('N', 1.3); widths.Add('O', 1.3); widths.Add('P', 1.2); widths.Add('Q', 1.3); widths.Add('R', 1.25); widths.Add('S', 1.3); widths.Add('T', 1.2); widths.Add('U', 1.3); widths.Add('V', 1.25); widths.Add('W', 1.8); widths.Add('X', 1.25); widths.Add('Y', 1.25); widths.Add('Z', 1.25);


widths.Add('[', 0.65); widths.Add(']', 0.65); widths.Add('^', 1.0); widths.Add('_', 1.0); widths.Add('`', 1.0);

widths.Add('a', 1.05); widths.Add('b', 1.1); widths.Add('c', 1.0); widths.Add('d', 1.1); widths.Add('e', 1.05); widths.Add('f', 0.7); widths.Add('g', 1.1); widths.Add('h', 1.15); widths.Add('i', 0.35); widths.Add('j', 0.35); widths.Add('k', 1.0); widths.Add('l', 0.35); widths.Add('m', 1.6); widths.Add('n', 1.15); widths.Add('o', 1.1); widths.Add('p', 1.1); widths.Add('q', 1.1); widths.Add('r', 0.75); widths.Add('s', 1.1); widths.Add('t', 0.5); widths.Add('u', 1.15); widths.Add('v', 1.1); widths.Add('w', 1.5); widths.Add('x', 1.0); widths.Add('y', 1.05); widths.Add('z', 0.9);

widths.Add('|', 0.2); widths.Add('~', 1.0);

/* Compute number of tabs needed */

double[] tagWidth = {0,0,0};

for (int i = 0; i < 3; ++i) {
	Char[] cs = scoreTags[i].ToCharArray();
	foreach ( Char c in cs ) {
		if (widths.ContainsKey(c)) {
			tagWidth[i] += widths[c];
		} else {
			tagWidth[i] += 1.0;
		}
	}
}

String[] tab = {"\t", "\t", "\t"};
for (int i = 0; i < 3; ++i) {
	if (level >= 4) plugin.ConsoleWrite("^b[EOR]^n widths: " + scoreTags[i] + " " + tagWidth[i]);
	if (tagWidth[i] < 4.7001) { // Use two tabs
		tab[i] += "\t";
	}
}

/* Send clan tag leaderboard to the chat window */

String lb = "Place by:\tScore\tKills   <- Clan Tag Leaderboard\n1st:\t\t"+scoreTags[0]+tab[0]+killTags[0]+"\n2nd:\t\t"+scoreTags[1]+tab[1]+killTags[1]+"\n3rd:\t\t"+scoreTags[2]+tab[2]+killTags[2];
if (level >= 3) plugin.ConsoleWrite("^b[EOR]^n ^4"+map+"^0:\n"+lb);
plugin.SendGlobalMessage(lb);

return false;
Detailed notes for Coders

 

There are several re-usable subroutines in this example that you might find useful. Here's a summary in the order that they appear in the example:

 

* "Near end of round" code for spacing out execution at the end of a round. The code is written for the last 20%, 10% and 5% of tickets remaining, but that condition can be replaced with something else, or the values changed. It uses a RoundData scratchpad variable in conjunction with an event that is expect to happen fairly often: OnKill in this case, but it could be OnInterval instead.

 

* "Sort" Comparison function delegates for sorting a list of KeyValuePair items in descending order by Value.

 

* Chat text character width table for formatting chat into tabular columns. See the comment in the code for a long list of disclaimers -- I created these values by trial-and-error and eyeballing my screen!

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

Originally Posted by phrogz*:

 

It's looks nice, I've change the foolowing in the First_check expression to have rush too:

 

Code:

( Regex.Match(server.Gamemode, "(Conquest|Rush|Team)", RegexOptions.IgnoreCase).Success && (server.RemainTicketsPercent(1) < 20 || server.RemainTicketsPercent(2) < 20) )
but I've this in debug log:

Code:

----------------------------------------------
Version: InsaneLimits 0.0.0.7
Date: 28/01/2012 12:42:38
System.Reflection.TargetParameterCountException: Parameter count mismatch.

Stack Trace: 
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at PRoConEvents.InsaneLimits.executeLimitCheck(Limit limit, String method, PlayerInfoInterface player, PlayerInfoInterface killer, PlayerInfoInterface victim, KillInfoInterface kill)
   at PRoConEvents.InsaneLimits.evaluateLimitChecks(Limit limit, PlayerInfoInterface player, PlayerInfoInterface killer, PlayerInfoInterface victim, KillInfoInterface kill)
   at PRoConEvents.InsaneLimits.executeLimitAction(Limit limit, PlayerInfoInterface player, PlayerInfoInterface killer, PlayerInfoInterface victim, KillInfoInterface kill)
   at PRoConEvents.InsaneLimits.evaluateLimit(Limit limit, PlayerInfo killer, KillInfo kill, PlayerInfo victim)
   at PRoConEvents.InsaneLimits.<>c__DisplayClass26.<evaluateLimitsForEvent>b__12(Limit limit)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at PRoConEvents.InsaneLimits.evaluateLimitsForEvent(BaseEvent type, PlayerInfo player, PlayerInfo killer, PlayerInfo victim, Kill info)
   at PRoConEvents.InsaneLimits.OnPlayerKilled(Kill info)

MSIL Stack Trace:
    System.Object Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean), IL: 0x0
    System.Object Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo), IL: 0x0
    Boolean executeLimitCheck(Limit, System.String, PRoConEvents.PlayerInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.KillInfoInterface), IL: 0x8C
    Boolean evaluateLimitChecks(Limit, PRoConEvents.PlayerInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.KillInfoInterface), IL: 0xE0
    Boolean executeLimitAction(Limit, PRoConEvents.PlayerInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.PlayerInfoInterface, PRoConEvents.KillInfoInterface), IL: 0x33
    Boolean evaluateLimit(Limit, PRoConEvents.PlayerInfo, PRoConEvents.KillInfo, PRoConEvents.PlayerInfo), IL: 0x0
    Void <evaluateLimitsForEvent>b__12(Limit), IL: 0x0
    Void ForEach(System.Action`1[T]), IL: 0xD
    Void evaluateLimitsForEvent(PRoConEvents.BaseEvent, PRoConEvents.PlayerInfo, PRoConEvents.PlayerInfo, PRoConEvents.PlayerInfo, PRoCon.Core.Kill), IL: 0x12C
    Void OnPlayerKilled(PRoCon.Core.Kill), IL: 0xAF
And one more question can we have just 1 time?

 

[EDIT]

 

I've change the First Check expression to:

Code:

( Regex.Match(server.Gamemode, "(ConquestSmall0|ConquestSmall1|RushLarge0|TeamDeathMatch0)", RegexOptions.IgnoreCase).Success && (server.RemainTicketsPercent(1) < 20 || server.RemainTicketsPercent(2) < 20) )
And no errors atm, I really want to change to have this limit to have it just one or two times at the end.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

And no errors atm, I really want to change to have this limit to have it just one or two times at the end.

I don't think it will work for Rush, that's why I didn't include that mode. Since Rush resets the tickets at every stage, my logic to space-out annoucements at "end of round" by ticket percentage will not work. If you include Rush, what will probably happen is that the leaderboard will be displayed at the end of every stage, so as many as 12 times during a round.

 

To make it display no more than twice, in second_check, change the number 20 struck out to the number 10 in red in the code that looks like this:

 

Code:

if (!limit.RoundData.issetDouble("EOR")) { // EOR: End Of Round
	limit.RoundData.setDouble("EOR", <strike>20</strike> 10); // Threshhold
}
To make it display no more than once, make the same change above and change the number 5 struck out to the number 0 in red in the code that looks like this, which is a little below the previous change:

 

Code:

} else if (thresh == 10) {
	// Set up the 3rd threshhold
	limit.RoundData.setDouble("EOR", <strike>5</strike> 0);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

NOTE: Compiles without error, but not tested for correct behavior.

 

This example shows how to change server settings for two periods of time, the prime-time hours and the late-night hours. As an example, this code uses vars.gameModeCounter to set double the number of tickets in a round during prime-time and sets it back to normal tickets late at night, but you can execute any code between the two time intervals that you want, for example, change the idle timeout, friendly fire, hardcore, etc.

 

Server settings are changed during the OnRoundOver event, to give maximum flexibility in what you can change and reducing the chance of confusing your players or the server.

 

Set limit to evaluate OnRoundOver, set action to None

 

Set first_check to this Code:

 

Code:

// Bracket the start and end times of the late-night settings
// startOClock must be between 20 (8pm) and 23 (11pm) inclusive, or 0 (midnight)
// endOClock must be between 1 (1am) and 5 (5:59am) inclusive

int startOClock = 22; // 22:00 at night (10pm)
int endOClock = 4; // 4:59 in the morning of the next day (4am)

// Assert(8pm >= startOClock <= midnight), sanity check
if ((startOClock != 0 && startOClock < 20) || startOClock > 23) {
    plugin.ConsoleError("startOClock must be between 20 and 23 inclusive, or 0 for midnight!");
    return false;
}

// Assert(1am <= endOClock <= 5am), sanity check
if (endOClock > 5 || endOClock < 1) {
    plugin.ConsoleError("endOClock must be between 1 and 5 inclusive!");
    return false;
}

int hour = DateTime.Now.Hour;

// Adjust for midnight transition
hour = (hour <= 5) _ hour + 24 : hour;
int adjustedEnd = endOClock + 24;
int adjustedStart = (startOClock == 0) _ 24 : startOClock;

if (hour >= adjustedStart && hour <= adjustedEnd) {
    // Late-night settings
    plugin.ServerCommand("vars.gameModeCounter", "100");
    plugin.ConsoleWrite("Running late-night settings!");
} else {
    // Prime-time hours settings
    plugin.ServerCommand("vars.gameModeCounter", "200");
    plugin.ConsoleWrite("Running prime-time settings!");
}
return true;
Leave second_check Disabled

 

To set a different start and end hour for the late-night period, change the value of startOClock and/or endOClock and the comments that follow them. Only specify the hour -- the limit doesn't support minutes -- for example, instead of 10:30pm and 1:15am, use 10 and 1 respectively. Note that the example (arbitrarily) limits startOClock to between 8pm and midnight and endOClock to between 1am and 6am (5:59), in order to have a reasonable correspondence with "late-night" and to simplify the calculations.

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

Originally Posted by xFaNtASyGiRLx*:

 

Code:

// this matches nigger, n1g3r, nig3, etc

bad_words.Add(@"n+[1i]+g+[3ea]+r*");   

// this matches faggot, f4g0t, fagat, etc

bad_words.Add(@"f+[a4]+g+[ao0]+t*");

// this matches fag, f4g, fagggg, fa4g, etc.

bad_words.Add(@"f+[a4]+g+");
hi, i used the code: bad_words.Add(@"n+[1i]+g+[3ea]+r*");

 

but what can i add so that if someone says "niggerbitch" or niggerwhateverwordafter or even niggr.

 

and how can i make it so that the whole server sees the warning messages and the kick and not just the player saying it?

 

thanks!!

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

Originally Posted by GitSum*:

 

hi, i used the code: bad_words.Add(@"n+[1i]+g+[3ea]+r*");

 

but what can i add so that if someone says "niggerbitch" or niggerwhateverwordafter or even niggr.

 

and how can i make it so that the whole server sees the warning messages and the kick and not just the player saying it?

 

thanks!!

I would like to stop using my other chat filter and incorporate one of these limits, if someone could flesh it out a little more...
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

hi, i used the code: bad_words.Add(@"n+[1i]+g+[3ea]+r*");

 

but what can i add so that if someone says "niggerbitch" or niggerwhateverwordafter or even niggr.

 

and how can i make it so that the whole server sees the warning messages and the kick and not just the player saying it?

 

thanks!!

My advise is ... Regular Expressions are awesome, but you can't always match all possible spellings/combinations with just one Regular Expression. It can become an unreadable, and unmaintainable ...

 

Also something else ... matching sub-strings within words is strongly discouraged! It works very well to catch the bad words. In fact it works too well, and that makes it a bad thing. Image someone typing

 

I call shenanigans!

Can you spot the racist sub-string?

 

shenanigans

 

Try this

 

Code:

bad_words.Add(@"n+[1i]+g+[3ea]+r*(bitch|word1|word2|etc)_");
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by xFaNtASyGiRLx*:

 

oh i don't care if it works too well :smile: cuz at least they get a warning and not a kick. so for bad_words.Add(@"n+[1i]+g+[3ea]+r*(bitch|word1|word2|etc)_"); for word1 word2 i put other made up words?

 

do you know how i could make it so the whole server sees the messages?

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

Originally Posted by micovery*:

 

oh i don't care if it works too well :smile: cuz at least they get a warning and not a kick. so for bad_words.Add(@"n+[1i]+g+[3ea]+r*(bitch|word1|word2|etc)_"); for word1 word2 i put other made up words?

 

do you know how i could make it so the whole server sees the messages?

Take a look at the documentation in the original post. The plugin object gives you three functions for different kinds of messages.

 

Code:

plugin.SendGlobalMessage
plugin.SendTeamMessage
pluign.SendSquadMessage
In your case, use the "SendGlobalMessage" one.

 

Code:

plugin.SendGlobalMessage(plugin.R("player.Name do not use profanity in this server!"));
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by phrogz*:

 

Thx for the tip PapaCharlie9 !

 

Is it possible to have a fair play limit like IE: if there is no more than 10 players I want to kill peoples that kills with vehicles? So I can keep my normal settings in the master browser instead of change to infantry only.

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

Originally Posted by PapaCharlie9*:

 

Thx for the tip PapaCharlie9 !

 

Is it possible to have a fair play limit like IE: if there is no more than 10 players I want to kill peoples that kills with vehicles? So I can keep my normal settings in the master browser instead of change to infantry only.

Basically, it's not possible to distinguish vehicle kills from other types of kills. It is much easier to just turn off vehicle spawns (go effectively infantry only), that's just one line of code.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Since micovery has been updating us with progress on 0.8, I thought I'd update everyone on my progress with limits I'm working on. Simple limits I publish as soon as I write them (usually untested), but more complex ones I test before publishing, thus the delay.

 

* Player Count Tracker

 

Final testing. I just need one more series of active rounds to test my latest bug fix, then I'll be ready. It's looking good, but unfortunately my server has been empty the last two days, so testing has been delayed. Here's some sample console output:

 

[20:01:56] [insane Limits] Thread(enforcer): [PCT]: Bazaar/CQ64/2/2, 38/40, -1 net change. Round (min-max) 30-39

[20:02:17] [insane Limits] Thread(enforcer): [PCT]: Bazaar/CQ64/2/2, 37/40, -1 net change. Round (min-max) 30-39

[20:02:39] [insane Limits] Thread(enforcer): [PCT]: Bazaar/CQ64/2/2, 36/40,-1 net change. Round (min-max) 30-39

[20:03:01] [insane Limits] Thread(enforcer): [PCT]: Bazaar/CQ64/2/2, 35/40,-1 net change. Round (min-max) 30-39

[20:03:44] [insane Limits] Thread(enforcer): [PCT]: Bazaar/CQ64/2/2, 34/40,-1 net change. Round (min-max) 30-39

[20:04:06] [insane Limits] Thread(enforcer): [PCT]: Seine/CQ64/1/2, 25/32,-9 net change. Round (min-max) 25-25

[20:04:28] [insane Limits] Thread(enforcer): [PCT]: Seine/CQ64/1/2, 24/32,-1 net change. Round (min-max) 24-25

[20:04:49] [insane Limits] Thread(enforcer): [PCT]: Seine/CQ64/1/2, 23/32,-1 net change. Round (min-max) 23-25

[20:05:11] [insane Limits] Thread(enforcer): [PCT]: Seine/CQ64/1/2, 19/24,-4 net change. Round (min-max) 19-25

[20:05:33] [insane Limits] Thread(enforcer): [PCT]: Seine/CQ64/1/2, 20/24, +1 net change. Round (min-max) 19-25

 

* Squad Recruiter

 

I've finished coding but haven't been able to do a first test on it. It adds an in-game command:

 

$draft (on|off)

 

If draft mode is on, OnDeath players not in a squad are moved into a squad with space, or an empty squad if there are none. It tries a couple of times and then leaves the player alone. Players on the whitelist are exempt from the draft.

 

It also adds this in-game command:

 

$recruit player

 

Which lets the player typing the command move another player with the same clan tag into their squad, even if the other player is already in another squad. Again, players on the whitelist are exempt from recruitment.

 

* Make Room For VIP

 

I haven't started coding this yet, but I have it all planned out. I'll use one custom list for settings, like the maximum number of automatic kicks to use, and another for a priority order of named policies. The command will be:

 

!vip player

 

This will kick players according to the list of policies until a player with matching name joins. Note the ! instead of $ for the command. I'm hoping 0.8 will be out by the time I start coding this one up. :smile:

 

BTW, I'm planning to use a syntax inspired by CSS for settings. For example, to specify no more than 4 automatic kicks and to set the "end of round" blockade (no kicks will occur near the end of round, based on ticket percentage) to 15%, you would put this text into a custom list called "vip_settings":

 

max-kicks:4; end-of-round-blockade:15

 

If I don't need a list of values, I'll use command instead of semi-colon as a separator.

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

Originally Posted by Disturbed11B*:

 

having some issues with the Admin Announcer Limit..

 

 

I Get this error

 

[12:41:59 12] [insane Limits] EXCEPTION: : System.ArgumentException: Must specify valid information for parsing in the string.

[12:41:59 12] [insane Limits] Extra information dumped in file InsaneLimits.dump

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

Originally Posted by TMiland*:

 

This example displays a formatted clan tag leaderboard table at the end of every Conquest or TDM round. The leaderboard is displayed up to 3 times at the end of the round: at 20% of tickets left, at 10% and finally at 5%.

 

Clan tags are sorted and first, second and third place determined by average score and average kills. A clan tag is included only if there are at least 2 players with that tag in the round when the table is calculated. All players without a tag are averaged as the "no tag" entry. If there are insufficient players to fill up the 3rd or 2nd place slot, "--" is displayed. By using averages, a clan that only has 3 players in the round has a fighting chance against a clan with 11 players in the round for first place, etc. Solitary players with a tag are excluded, since one hot-shot pro can dominate a mix of players from another clan. Clans are all about team play anyway. :smile:

 

Here are a couple of screenshots:

 

Posted Image

 

Posted Image

 

NOTE: Coders should see the detailed notes at the bottom of the post. There are some re-usable subroutines that you can put in your toolbox.

 

Set limit to evaluate OnKill, set action to None

 

Set first_check to this Expression:

 

Code:

( Regex.Match(server.Gamemode, "(Conquest|Team)", RegexOptions.IgnoreCase).Success && (server.RemainTicketsPercent(1) < 20 || server.RemainTicketsPercent(2) < 20) )
Set second_check to this Code:

 

Code:

/* Check if near end of round */

int level = 2;

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

if (!limit.RoundData.issetDouble("EOR")) { // EOR: End Of Round
	limit.RoundData.setDouble("EOR", 20); // Threshhold
}

/* First activation is a gimme, check for 2nd and 3rd */

double thresh = limit.RoundData.getDouble("EOR");

if (server.RemainTicketsPercent(1) > thresh && server.RemainTicketsPercent(2) > thresh) {
	if (level >= 5) {
		plugin.ConsoleWrite("^bEOR Debug^n: T1/T2 = " + String.Format("{0:F1}",server.RemainTicketsPercent(1)) +"/"+ String.Format("{0:F1}",server.RemainTicketsPercent(2)));
	}
	return false; // don't do anything;
}

/* Set the next threshhold */

if (thresh == 20) {
	// Set up the 2nd threshhold
	limit.RoundData.setDouble("EOR", 10);
} else if (thresh == 10) {
	// Set up the 3rd threshhold
	limit.RoundData.setDouble("EOR", 5);
} else if (thresh == 5) {
	// Set up the last threshhold
	limit.RoundData.setDouble("EOR", 0);
} else if (thresh == 0) {
	// Stop announcing
	return false;
}

/* Logging */

Dictionary<String, String> shortMap = new Dictionary<String,String>();
shortMap.Add("MP_001", "Bazaar");
shortMap.Add("MP_003", "Teheran");
shortMap.Add("MP_007", "Caspian");
shortMap.Add("MP_011", "Seine");
shortMap.Add("MP_012", "Firestorm");
shortMap.Add("MP_013", "Damavand");
shortMap.Add("MP_017", "Canals");
shortMap.Add("MP_018", "Kharg");
shortMap.Add("MP_Subway", "Metro");
shortMap.Add("MP_SUBWAY", "Metro");
shortMap.Add("XP1_001", "Karkand");
shortMap.Add("XP1_002", "Oman");
shortMap.Add("XP1_003", "Sharqi");
shortMap.Add("XP1_004", "Wake");

String mfname = server.MapFileName.ToUpper();
String map = mfname;
if (shortMap.ContainsKey(mfname)) map = shortMap[mfname];


if (level >= 4) {
	double t1 = Math.Round(server.RemainTickets(1));
	double t2 = Math.Round(server.RemainTickets(2));
	String t1p = String.Format("{0:F1}",server.RemainTicketsPercent(1));
	String t2p = String.Format("{0:F1}",server.RemainTicketsPercent(2));
	plugin.ConsoleWrite(@"^b[EOR]^n: ^b^4" + map + "^0^n T1/T2 T1%/T2% = " + t1 +"/"+ t2 + " " + t1p + "/" + t2p + ", threshhold=" + thresh);
}

/* Collect clan statistics */

List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
players.AddRange(team1.players);
players.AddRange(team2.players);
Dictionary<String, double> clanCounts = new Dictionary<String, double>();
Dictionary<String, double> clanScores = new Dictionary<String, double>();
Dictionary<String, double> clanKills = new Dictionary<String, double>();

foreach(PlayerInfoInterface player_info in players)
{
	String tag = player_info.Tag;
	if(tag.Length == 0) {
		// Maybe they are using [_-=]XXX[=-_]PlayerName format
		Match tm = Regex.Match(player_info.Name, @"^[=_\-]_([^=_\-]{2,4})[=_\-]");
		if (tm.Success) {
			tag = tm.Groups[1].Value;
			if (level >= 4 && !clanCounts.ContainsKey(tag)) plugin.ConsoleWrite("^b[EOR]^n extracted [" + tag + "] from " + player_info.Name);
		} else {
			// Use the default "everybody else" tag
			tag = "no tag";
		}
	}	

	if (!clanCounts.ContainsKey(tag)) clanCounts.Add(tag, 0);

	clanCounts[tag] += 1;

	if (!clanScores.ContainsKey(tag)) clanScores.Add(tag, 0);

	clanScores[tag] += player_info.ScoreRound;

	if (!clanKills.ContainsKey(tag)) clanKills.Add(tag, 0);

	clanKills[tag] += player_info.KillsRound;
}

/* Sort all clans by average score */

String[] scoreTags = { "--", "--", "--" };

List<KeyValuePair<String, double>> list = new List<KeyValuePair<String, double>>();

foreach (KeyValuePair<String, double> pair in clanScores) {
	list.Add(pair);
}

if (list.Count > 0) {

	list.Sort(
		delegate(KeyValuePair<String, double> firstPair, KeyValuePair<String, double> nextPair) {
			double na = clanCounts[firstPair.Key];
			double nb = clanCounts[nextPair.Key];
			
			if (na != 0 && nb == 0) return -1;
			if (na == 0 && nb != 0) return 1;
			if (na == 0 && nb == 0) return 0;
			
			double a = firstPair.Value/na;
			double b = nextPair.Value/nb;
			
			if (a > B) return -1;
			if (a < B) return 0;
			return 0; // equal
		}
	);

	// Example: #1[LGN]/9: 2039.1, #2no tag/27: 1689.3, #3[SOG]/2: 588.5, ...

	int place = 0;
	String message = ": ";
	foreach(KeyValuePair<String, double> pair in list) {
		double n = clanCounts[pair.Key];
		if (n < 2) continue; // Skip solitary players
		String tmp = String.Empty;
		if (!pair.Key.Equals("no tag")) {
			tmp = "[" + pair.Key + "]";
		} else {
			tmp = pair.Key;
		}
		if (place < 3) {
			scoreTags[place] = tmp;
		}
		place += 1;
		message = message + "#" + place + tmp + "/" + n + ": " + String.Format("{0:F1}",(pair.Value/n)) + ", ";
		if (place >= 6) break; // Limit to top 6
	}
	if (level >= 3 && place > 0) {
		message = "Tags by avg score" + message + "...";
		plugin.ConsoleWrite("^b[EOR]^n: " + message);
	}
}


/* Sort all clans by average kills */

String[] killTags = { "--", "--", "--" };

list.Clear();

foreach (KeyValuePair<String, double> pair in clanKills) {
	list.Add(pair);
}

if (list.Count > 0) {

	list.Sort(
		delegate(KeyValuePair<String, double> firstPair, KeyValuePair<String, double> nextPair) {
			double na = clanCounts[firstPair.Key];
			double nb = clanCounts[nextPair.Key];
			
			if (na != 0 && nb == 0) return -1;
			if (na == 0 && nb != 0) return 1;
			if (na == 0 && nb == 0) return 0;
			
			double a = firstPair.Value/na;
			double b = nextPair.Value/nb;
			
			if (a > B) return -1;
			if (a < B) return 1;
			return 0; // equal
		}
	);

	// Example: #1[SOG]/9: 17.3, #2[365]/2: 11.5, #3no tag/40: 6.6, ...

	int place = 0;
	String message = ": ";
	foreach(KeyValuePair<String, double> pair in list) {
		double n = clanCounts[pair.Key];
		if (n < 2) continue; // Skip solitary players
		String tmp = String.Empty;
		if (!pair.Key.Equals("no tag")) {
			tmp = "[" + pair.Key + "]";
		} else {
			tmp = pair.Key;
		}
		if (place < 3) {
			killTags[place] = tmp;
		}
		place += 1;
		message = message + "#" + place + tmp + "/" + n + ": " + String.Format("{0:F1}",(pair.Value/n)) + ", ";
		if (place >= 6) break; // Limit to top 6
	}
	if (level >= 3 && place > 0) {
		message = "Tags by avg kills" + message + "...";
		plugin.ConsoleWrite("^b[EOR]^n: " + message);
	}
}

/* Chat character width table for formatting scoreboard */

/* 
This was done entirely by eyeball, so it is just an estimate. It is
normalized to the pixel width of the lower case 'x' character. That is 1.0.
Values less than 1.0, such as 0.8, are narrower than 'x'. Values greater
than 1.0, such as 1.2, are wider than 'x'.

I estimated the width of a tab column to be 4.7. That errs on the
side of being too low, which means it's possible for the next
column to be too far over. The resulting table might look like
this:

Score   Kills
[XXX]       [YYY]

I thought that was less confusing than being too close:

Score   Kills
[XXX][YYY]

Finally, the table is incomplete. It doesn't have all possible
character codes in it. Any character that is not found in
the table is assumed to be 1.0 in the code that uses the table.
*/

Dictionary<Char, double> widths = new Dictionary<Char, double>();

widths.Add('-', 0.8);

widths.Add('0', 1.3); widths.Add('1', 0.7); widths.Add('2', 1.2); widths.Add('3', 1.2); widths.Add('4', 1.2); widths.Add('5', 1.2); widths.Add('6', 1.1); widths.Add('7', 1.0); widths.Add('8', 1.1); widths.Add('9', 1.1);

widths.Add(':', 1.0); widths.Add(';', 1.0); widths.Add('<', 1.0); widths.Add('=', 1.0); widths.Add('>', 1.0); widths.Add('_', 1.2); widths.Add('@', 2.0);

widths.Add('A', 1.3); widths.Add('B', 1.25); widths.Add('C', 1.3); widths.Add('D', 1.3); widths.Add('E', 1.1); widths.Add('F', 0.9); widths.Add('G', 1.3); widths.Add('H', 1.3); widths.Add('I', 0.5); widths.Add('J', 1.2); widths.Add('K', 1.2); widths.Add('L', 1.1); widths.Add('M', 1.4); widths.Add('N', 1.3); widths.Add('O', 1.3); widths.Add('P', 1.2); widths.Add('Q', 1.3); widths.Add('R', 1.25); widths.Add('S', 1.3); widths.Add('T', 1.2); widths.Add('U', 1.3); widths.Add('V', 1.25); widths.Add('W', 1.8); widths.Add('X', 1.25); widths.Add('Y', 1.25); widths.Add('Z', 1.25);


widths.Add('[', 0.65); widths.Add(']', 0.65); widths.Add('^', 1.0); widths.Add('_', 1.0); widths.Add('`', 1.0);

widths.Add('a', 1.05); widths.Add('b', 1.1); widths.Add('c', 1.0); widths.Add('d', 1.1); widths.Add('e', 1.05); widths.Add('f', 0.7); widths.Add('g', 1.1); widths.Add('h', 1.15); widths.Add('i', 0.35); widths.Add('j', 0.35); widths.Add('k', 1.0); widths.Add('l', 0.35); widths.Add('m', 1.6); widths.Add('n', 1.15); widths.Add('o', 1.1); widths.Add('p', 1.1); widths.Add('q', 1.1); widths.Add('r', 0.75); widths.Add('s', 1.1); widths.Add('t', 0.5); widths.Add('u', 1.15); widths.Add('v', 1.1); widths.Add('w', 1.5); widths.Add('x', 1.0); widths.Add('y', 1.05); widths.Add('z', 0.9);

widths.Add('|', 0.2); widths.Add('~', 1.0);

/* Compute number of tabs needed */

double[] tagWidth = {0,0,0};

for (int i = 0; i < 3; ++i) {
	Char[] cs = scoreTags[i].ToCharArray();
	foreach ( Char c in cs ) {
		if (widths.ContainsKey(c)) {
			tagWidth[i] += widths[c];
		} else {
			tagWidth[i] += 1.0;
		}
	}
}

String[] tab = {"\t", "\t", "\t"};
for (int i = 0; i < 3; ++i) {
	if (level >= 4) plugin.ConsoleWrite("^b[EOR]^n widths: " + scoreTags[i] + " " + tagWidth[i]);
	if (tagWidth[i] < 4.7001) { // Use two tabs
		tab[i] += "\t";
	}
}

/* Send clan tag leaderboard to the chat window */

String lb = "Place by:\tScore\tKills   <- Clan Tag Leaderboard\n1st:\t\t"+scoreTags[0]+tab[0]+killTags[0]+"\n2nd:\t\t"+scoreTags[1]+tab[1]+killTags[1]+"\n3rd:\t\t"+scoreTags[2]+tab[2]+killTags[2];
if (level >= 3) plugin.ConsoleWrite("^b[EOR]^n ^4"+map+"^0:\n"+lb);
plugin.SendGlobalMessage(lb);

return false;
Detailed notes for Coders

 

There are several re-usable subroutines in this example that you might find useful. Here's a summary in the order that they appear in the example:

 

* "Near end of round" code for spacing out execution at the end of a round. The code is written for the last 20%, 10% and 5% of tickets remaining, but that condition can be replaced with something else, or the values changed. It uses a RoundData scratchpad variable in conjunction with an event that is expect to happen fairly often: OnKill in this case, but it could be OnInterval instead.

 

* "Sort" Comparison function delegates for sorting a list of KeyValuePair items in descending order by Value.

 

* Chat text character width table for formatting chat into tabular columns. See the comment in the code for a long list of disclaimers -- I created these values by trial-and-error and eyeballing my screen!

Hi PapaCharlie9 :-)

 

Will my clan tag work with this limit? Remember the NBF-playername tag you changed for me in the other

announce top scoring clan limit? :ohmy:

 

Regards,

Tommy.

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

Originally Posted by Mootart*:

 

Greatings.....

 

after upgrading to ver. 8

 

procon starts tp freeze...

 

and recived this error.

 

 

[01:04:38 10] [insane Limits] Thread(fetch): EXCEPTION: Timeout(30 seconds) expired, while waiting for info_handle within getServerInfoSync

[01:05:08 67] [insane Limits] Thread(fetch): EXCEPTION: Timeout(30 seconds) expired, while waiting for list_handle within getMapListSync

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

Originally Posted by micovery*:

 

Greatings.....

 

after upgrading to ver. 8

 

procon starts tp freeze...

 

and recived this error.

 

 

[01:04:38 10] [insane Limits] Thread(fetch): EXCEPTION: Timeout(30 seconds) expired, while waiting for info_handle within getServerInfoSync

[01:05:08 67] [insane Limits] Thread(fetch): EXCEPTION: Timeout(30 seconds) expired, while waiting for list_handle within getMapListSync

You need .NET 3.5 or later.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by phrogz*:

 

If there is not more than 10 players on SQDM, and someone use mortar or vehicle he will be kill first time and kick the second time (Remember I'm not a dev guy)!

 

Set limit to evaluate OnKill, set action to None.

 

Set first_check to this Expression:

 

Code:

Regex.Match(kill.Weapon, @"(Death)", RegexOptions.IgnoreCase).Success && server.PlayerCount < 10 && Regex.Match(server.Gamemode, "(SquadDeathMatch0)", RegexOptions.IgnoreCase).Success && !killer.Name.Equals(victim.Name)
Take care, to copy the entire first check expression!

 

Set second_check to this Code:

 

 

Code:

int count = (int) limit.Activations(player.Name);
   
	if (count == 1)
		{
		String message1 = "Do not use vehicle or mortar under 10 players";
		plugin.SendGlobalMessage(plugin.R("%p_n% dont use vehicles or mortar!"));
		plugin.KillPlayer(player.Name);
		plugin.SendGlobalMessage(message1);
		plugin.SendGlobalMessage(plugin.R("There are only "+server.PlayerCount+" players"));
		}
	else if (count == 2)
		{
		String message1 = "Do not use vehicle or mortar under 10 players";
		plugin.SendGlobalMessage(plugin.R("%p_n%  dont use vehicles or mortar!"));
		plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n% you have been kicked for using vehicles or mortar"));
		plugin.SendGlobalMessage(message1);
		plugin.SendGlobalMessage(plugin.R("There are only "+server.PlayerCount+" players"));
		}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

having some issues with the Admin Announcer Limit..

 

I Get this error

 

[12:41:59 12] [insane Limits] EXCEPTION: : System.ArgumentException: Must specify valid information for parsing in the string.

[12:41:59 12] [insane Limits] Extra information dumped in file InsaneLimits.dump

Please get the InsaneLimits.dump file and copy&paste the section with the specific error to a post. Also, follow the directions in the original post of Insane Limits and !dump limit (id) of the limit number you added the Admin Announcer as and past that into a code block.

 

My guess is that your admins custom list has a problem in it, so copy&paste that list as well exactly as it is typed into the PRoCon window.

 

Will my clan tag work with this limit? Remember the NBF-playername tag you changed for me in the other

announce top scoring clan limit? :ohmy:

Yes, absolutely. I included the code we worked on earlier:

Code:

// Maybe they are using [_-=]XXX[=-_]PlayerName format
		Match tm = Regex.Match(player_info.Name, @"^[=_\-]_([^=_\-]{2,4})[=_\-]");

If there is not more than 10 players on SQDM, and someone use mortar or vehicle he will be kill first time and kick the second time (Remember I'm not a dev guy)!

As previously mentioned, you get "Death" for other kills besides vehicle and mortar. I think you get "Death" for "Bad Luck" as well, though I'm not sure who the killer is -- it might be the victim. So you might want to add to your first_check

 

Code:

&& !killer.Name.Equals(victim.Name)
Also, not sure what this code is for. It doesn't seem to get used in this limit:

 

Code:

if (!limit.Data.issetBool(player.Name))
         limit.Data.setBool(player.Name, true);
* Restored post. It could be that the author is no longer active.
Link to comment

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.