Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

Originally Posted by purebattlefield*:

 

I'm trying now to make a limit that will announce "Server News" to a player on their first spawn of each map or if they type "/news". I probably will need two limits for this, one for the on first spawn of a new map not including first spawn after join, and a second for when they type "/news". The /news one will be easy. We have a welcome message that comes up on the first spawn after they join. I was thinking maybe either using some integer type expression like,

Code:

int count = (int) limit.Activations(player.Name);
   
  if (count == 1)
I think I might need to put that into the welcome message limit then, and I'm not sure I want to do that. Or even if it would be better to just have a separate limit.

 

Perhaps,

 

Name: Server News

Evaluation, OnSpawn

First Check, Expression

Code:

player deaths > 1 (clearly I need to find the right parameter for this.)
Second Check, Code

Code:

limit.Activations(player.Name) < 1);
List<String> News = new List<String>();
News.Add("We've changed our server /help information. Doing maintence on the 31st.");

    foreach(string X in News)
       plugin.ServerCommand("admin.yell", X, "20", "player", player.Name);

return false;
Hoping something like this would activate on their second spawn after they join and then get reset each new map so it would show up their first spawn of each new map. This might be a little obnoxious on the first map. Is there a better way to handle this, or could I make it so it doesn't come up their first round?
* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 3.2k
  • Created
  • Last Reply

Originally Posted by PapaCharlie9*:

 

Charlie, just double check this code for me and see that I haven't made an error anywhere please...

 

Evaluation: OnAnyChat

First_Check as Expression: ( true )

Second_Check as Code:-

Code:

List<String> racisms = new List<String>();
	racisms.Add("nigger");
	racisms.Add("niggers");
	racisms.Add("paki");
	racisms.Add("pakis");
	racisms.Add("nigga");
	racisms.Add("niggas");

String[] chatwords = Regex.Split(player.LastChat, @"\s+");
    
foreach(String chatword in chatwords) 
{
	foreach(String racism in racisms)
	{
		if (Regex.Match(chatword, "^"+racism+"$", RegexOptions.IgnoreCase).Success)
		{
			plugin.SendGlobalMessage(plugin.R("%p_n% was auto-kicked for using the word: "+racism+"!"));
			plugin.SendGlobalMessage(plugin.R("We operate a zero tolerance policy on racism"));
			plugin.KickPlayerWithMessage(player.Name, plugin.R("[Auto-Admin] Racist Language"));
			plugin.ConsoleWarn(plugin.R("%p_n% used the word: "+racism+""));
			plugin.ConsoleWarn(plugin.R("%p_n% was auto-kicked for using the word: "+racism+"!"));			
			plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% %p_n% said [" + player.LastChat + "]"));
			
			return true;
			
		}
	}
}

List<String> swears = new List<String>();
	swears.Add("cunt");
	swears.Add("cunts");
	swears.Add("jew");
	swears.Add("jews");
	swears.Add("nazi");
	swears.Add("nazis");

String[] chat_words = Regex.Split(player.LastChat, @"\s+");
    
foreach(String chat_word in chat_words) 
{
	foreach(String swear in swears)
	{
		if (Regex.Match(chat_word, "^"+swear+"$", RegexOptions.IgnoreCase).Success)
		{
			plugin.SendGlobalMessage(plugin.R("%p_n% please stop using the word: "+swear+"! This is your only warning!"));
			plugin.ConsoleWarn(plugin.R("%p_n% used the word: "+swear+""));
			plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% %p_n% said [" + player.LastChat + "]"));
			
			double count = limit.Activations ( player.Name );

			if (count == 2)
				{
					plugin.KickPlayerWithMessage(player.Name, plugin.R("[Auto-Admin] Bad Language"));
					plugin.SendGlobalMessage(plugin.R("%p_n% was auto-kicked for using the word: "+swear+" - after a warning!"));
					plugin.ConsoleWarn(plugin.R("%p_n% was auto-kicked for using the word: "+swear+" - after a warning!"));
				}
			
			return true;
			
		}
	}
}
Just recently combined the two separate codes into one. And checking the logs some player was able to spam cunt without being kicked.
There is a problem in the second part, where you use limit.Activations. The limit activates on any chat by the player, so by the time your git started spamming swear words, his count might have been 3, or 19, or 42.

 

Just use a Data counter and it will work fine. Don't use limit.Activations unless you have a first_check that you are counting.

 

Philosophically, I wouldn't repeat the offending word in Global chat, kind of works at cross purposes to the server restriction, right? Admin ought to kick itself, eh? I just use "Player XXX used a racist remark" or "Player XXX is swearing too much". Keep it generic.

 

Also, the warning about swearing could be updated to send the warning only to the offender, instead of everyone. Unless you meant it to go to everyone.

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

Originally Posted by PapaCharlie9*:

 

I'm trying now to make a limit that will announce "Server News" to a player on their first spawn of each map or if they type "/news". I probably will need two limits for this, one for the on first spawn of a new map not including first spawn after join, and a second for when they type "/news". The /news one will be easy. We have a welcome message that comes up on the first spawn after they join. I was thinking maybe either using some integer type expression like,

Code:

int count = (int) limit.Activations(player.Name);
   
  if (count == 1)
I think I might need to put that into the welcome message limit then, and I'm not sure I want to do that. Or even if it would be better to just have a separate limit.

 

Perhaps,

 

Name: Server News

Evaluation, OnSpawn

First Check, Expression

Code:

player deaths > 1 (clearly I need to find the right parameter for this.)
Second Check, Code

Code:

limit.Activations(player.Name) < 1);
List<String> News = new List<String>();
News.Add("We've changed our server /help information. Doing maintence on the 31st.");

    foreach(string X in News)
       plugin.ServerCommand("admin.yell", X, "20", "player", player.Name);

return false;
Hoping something like this would activate on their second spawn after they join and then get reset each new map so it would show up their first spawn of each new map. This might be a little obnoxious on the first map. Is there a better way to handle this, or could I make it so it doesn't come up their first round?
Several ways to handle this.

 

The easiest is to just tell them in the welcome message to type /news if they want to see news and forget about the spawn limit. Let them opt in. Also saves having to store the news in two separate limits, which is one of the most annoying deficiencies of Insane Limits (though it can be overcome, see below).

 

If you really want to have two limits with two copies of news, just let limit.ActivationsTotal do all the work for you.

 

Set the limit to evaluate OnSpawn.

 

Set first_check to this Expression:

 

Code:

(true)
Set second_check to this Code:

 

Code:

if (limit.ActivationsTotal(player.Name) != 2) return false;
... all your news stuff goes here ...
This insures that the player only ever sees the news once (while he's connected) and it will happen on his second spawn.

 

If you want to make it happen on the 2nd spawn of his 2nd round on the server, do this:

 

Code:

if (!(player.RoundsTotal == 2 && limit.Activations(player.Name) == 2)) return false;
.. all your news stuff goes here ...
Note that we use limit.Activations here, because we want the 2nd spawn relative to a certain round, not for all time.

 

Finally, if you don't want to store the news in two different places, you can use three limits to achieve that.

 

1) OnAnyChat, check for /news command and

 

Code:

plugin.ServerCommand("admin.say", "Server news will be sent to you within 30 seconds!", "player", player.Name);
player.Data.setBool("SendServerNews", true);
return false;
2) OnSpawn, all you do is set a flag like this:

 

 

Code:

... whatever condition from above you want to use to return false here ...
// Otherwise ...
player.Data.setBool("SendServerNews", true);
return false;
3) OnIntervalServer set to 30 seconds, check every player to see who wants news and send it

 

second_check Code

Code:

.... Your news goes here, this is the only limit that has to store it ...

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
foreach (PlayerInfoInterface p in team1.players) all.Add(p);
foreach (PlayerInfoInterface p in team2.players) all.Add(p);
if (team3.players.Count > 0) foreach (PlayerInfoInterface p in team3.players) all.Add(p);
if (team4.players.Count > 0) foreach (PlayerInfoInterface p in team4.players) all.Add(p);

foreach (PlayerInfoInterface p in all) {
    if (!p.Data.issetBool("SendServerNews")) continue;
    if (!p.Data.getBool("SendServerNews")) continue;
    // else, send the news and then reset the flag so we don't send it again unless they type /news
   ... put your news sending code here, but use this line to send it:
        plugin.ServerCommand("admin.say", ... one chat line of news as a string ..., "player", p.Name);
   ... in other words, use p the same way you would use player, e.g., p.Name
    // finally, reset the flag so they don't see news again
    p.Data.setBool("SendServerNews", false);
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Singh400*:

 

There is a problem in the second part, where you use limit.Activations. The limit activates on any chat by the player, so by the time your git started spamming swear words, his count might have been 3, or 19, or 42.

Ah crap. I totally forgot that. Crap :\ That's what I get for changing code about at 5am.

 

Just use a Data counter and it will work fine. Don't use limit.Activations unless you have a first_check that you are counting.

Ah yes, good idea. About time I got to grips with that.

 

Philosophically, I wouldn't repeat the offending word in Global chat, kind of works at cross purposes to the server restriction, right? Admin ought to kick itself, eh? I just use "Player XXX used a racist remark" or "Player XXX is swearing too much". Keep it generic.

 

Also, the warning about swearing could be updated to send the warning only to the offender, instead of everyone. Unless you meant it to go to everyone.

I prefer the server population knows what isn't allowed. Normally one or two example gets the message across perfectly.

 

For now I've gone back to the old limit:-

 

Code:

List<String> racisms = new List<String>();
	racisms.Add("nigger");
	racisms.Add("niggers");
	racisms.Add("paki");
	racisms.Add("pakis");
	racisms.Add("nigga");
	racisms.Add("niggas");

String[] chatwords = Regex.Split(player.LastChat, @"\s+");
    
foreach(String chatword in chatwords) 
{
	foreach(String racism in racisms)
	{
		if (Regex.Match(chatword, "^"+racism+"$", RegexOptions.IgnoreCase).Success)
		{
			plugin.SendGlobalMessage(plugin.R("%p_n% was auto-kicked for using the word: "+racism+"!"));
			plugin.SendGlobalMessage(plugin.R("We operate a zero tolerance policy on racism"));
			plugin.KickPlayerWithMessage(player.Name, plugin.R("[Auto-Admin] Racist Language"));
			plugin.ConsoleWarn(plugin.R("%p_n% used the word: "+racism+""));
			plugin.ConsoleWarn(plugin.R("%p_n% was auto-kicked for using the word: "+racism+"!"));			
			plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% %p_n% said [" + player.LastChat + "]"));
			return true;
			
		}
	}
}

List<String> swears = new List<String>();
	swears.Add("cunt");
	swears.Add("cunts");
	swears.Add("jew");
	swears.Add("jews");
	swears.Add("nazi");
	swears.Add("nazis");

String[] chat_words = Regex.Split(player.LastChat, @"\s+");
    
foreach(String chat_word in chat_words) 
{
	foreach(String swear in swears)
	{
		if (Regex.Match(chat_word, "^"+swear+"$", RegexOptions.IgnoreCase).Success)
		{
			plugin.SendGlobalMessage(plugin.R("%p_n% please stop using the word: "+swear+"! This is your only warning!"));
			plugin.ConsoleWarn(plugin.R("%p_n% used the word: "+swear+""));
			plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% %p_n% said [" + player.LastChat + "]"));;
			return true;
			
		}
	}
}
Code:
double count = limit.Activations ( player.Name );

if (count == 2)
	{
		plugin.KickPlayerWithMessage(player.Name, plugin.R("[Auto-Admin] Bad Language"));
		plugin.SendGlobalMessage(plugin.R("%p_n% was kicked for using a prohibited word - after a warning!"));
		plugin.ConsoleWarn(plugin.R("%p_n% was kicked for using a prohibited word - after a warning!"));
	}

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

Originally Posted by purebattlefield*:

 

Several ways to handle this.

 

The easiest is to just tell them in the welcome message to type /news if they want to see news and forget about the spawn limit. Let them opt in. Also saves having to store the news in two separate limits, which is one of the most annoying deficiencies of Insane Limits (though it can be overcome, see below).

 

If you really want to have two limits with two copies of news, just let limit.ActivationsTotal do all the work for you.

 

Set the limit to evaluate OnSpawn.

 

Set first_check to this Expression:

 

Code:

(true)
Set second_check to this Code:

 

Code:

if (limit.ActivationsTotal(player.Name) != 2) return false;
... all your news stuff goes here ...
This insures that the player only ever sees the news once (while he's connected) and it will happen on his second spawn.

 

If you want to make it happen on the 2nd spawn of his 2nd round on the server, do this:

 

Code:

if (!(player.RoundsTotal == 2 && limit.Activations(player.Name) == 2)) return false;
.. all your news stuff goes here ...
Note that we use limit.Activations here, because we want the 2nd spawn relative to a certain round, not for all time.

 

Finally, if you don't want to store the news in two different places, you can use three limits to achieve that.

 

1) OnAnyChat, check for /news command and

 

Code:

plugin.ServerCommand("admin.say", "Server news will be sent to you within 30 seconds!", "player", player.Name);
player.Data.setBool("SendServerNews", true);
return false;
2) OnSpawn, all you do is set a flag like this:

 

 

Code:

... whatever condition from above you want to use to return false here ...
// Otherwise ...
player.Data.setBool("SendServerNews", true);
return false;
3) OnIntervalServer set to 30 seconds, check every player to see who wants news and send it

 

second_check Code

Code:

.... Your news goes here, this is the only limit that has to store it ...

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
foreach (PlayerInfoInterface p in team1.players) all.Add(p);
foreach (PlayerInfoInterface p in team2.players) all.Add(p);
if (team3.players.Count > 0) foreach (PlayerInfoInterface p in team3.players) all.Add(p);
if (team4.players.Count > 0) foreach (PlayerInfoInterface p in team4.players) all.Add(p);

foreach (PlayerInfoInterface p in all) {
    if (!p.Data.issetBool("SendServerNews")) continue;
    if (!p.Data.getBool("SendServerNews")) continue;
    // else, send the news and then reset the flag so we don't send it again unless they type /news
   ... put your news sending code here, but use this line to send it:
        plugin.ServerCommand("admin.say", ... one chat line of news as a string ..., "player", p.Name);
   ... in other words, use p the same way you would use player, e.g., p.Name
    // finally, reset the flag so they don't see news again
    p.Data.setBool("SendServerNews", false);
}
return false;
Wow, thanks Papa!

 

Gonna have to put this in! I didn't know I could set a first check expression to true allowing me to put more detailed code in the second check. For the part about the second round, could I finagle that code a little bit to make it so it would show up on every third round excluding the first? Perhaps something like,

 

Code:

if (!(player.RoundsTotal == 2, 5, 8, 11, 14, 17, 20 && limit.Activations(player.Name) = 1)) return false;
.. all your news stuff goes here ...
The server owner changed his mind and wants to do it every third round now. Which is good for me because it's a new change to learn some new ways to convert my logic into code that Insane Limits can understand. Hoping the above amended code would make it show up on every third round after the first up to the 20th round played of the session on the first spawn.

 

Definitely will be using the three limit method to only have one spot to record the news though. Thank you! :smile:

 

Also, another quick question. I remember reading earlier (i think from you, Papa) that the OnServerInterval is unreliable past 60. I am trying to set up a twitter feed that will send a tweet when the server population is over 12 but not more than every 6 hours. I have it set up with

 

OnServerInterval 21600

First Check, Expression

Code:

(server.PlayerCount <11)
Second check, Code

Code:

if (limit.ActivationsTotal() > 1) return false;
Action, Tweet: Message to be tweeted.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

I still haven't figured out the mysterious "ERROR: 1 error compiling Code". I've never seen those myself, so I have no idea what causes them.

 

Try to do a dump of your limit code. It uses your limit number, so if your limit is #21, type this command at the top of the Plugin Settings:

 

!dump limit 21

 

That creates a file called LimitEvaluator21.cs in your procon folder. Use whatever your actual limit number is and post the file.

 

it gives no other line

 

this is the code (original vote-kick code works but this one does not)

 

Code:

double percent = 25;

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-kick */
if (!kickMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;
    
if (target.Name.Equals(player.Name))
{   if (player.Data.issetBool("ENG") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("FR") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("GE") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("SP") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("IT") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("PO") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("SW") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("RU") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("DA") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
    }
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("votekick"))
    player.DataRound.setObject("votekick", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("votekick"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1) {
    foreach (PlayerInfoInterface p in all) {
    if (p.Data.issetBool("ENG") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    } else if (p.Data.issetBool("FR") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    } else if (p.Data.issetBool("GE") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    } else if (p.Data.issetBool("SP") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    }else if (p.Data.issetBool("IT") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    }else if (p.Data.issetBool("PO") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    }else if (p.Data.issetBool("SW") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    }else if (p.Data.issetBool("RU") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    }else if (p.Data.issetBool("DA") == true ) {
        plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
    }
} }
else if (remain > 0) {    
    foreach (PlayerInfoInterface p in all) {
    if (p.Data.issetBool("ENG") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    } else if (p.Data.issetBool("FR") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    } else if (p.Data.issetBool("GE") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    } else if (p.Data.issetBool("SP") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    }else if (p.Data.issetBool("IT") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    }else if (p.Data.issetBool("PO") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    }else if (p.Data.issetBool("SW") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    }else if (p.Data.issetBool("RU") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    }else if (p.Data.issetBool("DA") == true ) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
    }
}


if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");

if (votes >= needed)
{

foreach (PlayerInfoInterface p in all) {
    if (p.Data.issetBool("ENG") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    } else if (p.Data.issetBool("FR") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    } else if (p.Data.issetBool("GE") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    } else if (p.Data.issetBool("SP") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    }else if (p.Data.issetBool("IT") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    }else if (p.Data.issetBool("PO") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    }else if (p.Data.issetBool("SW") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    }else if (p.Data.issetBool("RU") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    }else if (p.Data.issetBool("DA") == true ) {
        String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
        String message = target.Name + " was vote-kicked " + count ;
        plugin.ServerCommand("admin.say", message, "player", player.Name);
    }
}
if (target.Data.issetBool("ENG") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("FR") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("GE") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("SP") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("IT") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("PO") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("SW") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("RU") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
} else if (target.Data.issetBool("DA") == true ) {
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
}

return true;

}

return false;
and to be honest this whole thing about flagging a player with a language is confusing.

 

Edit: it will be nice if someone can give us a lesson or guide to links where we can learn from.

 

 

Edit 2 : this is also something i am trying to do yet the flags are not set on players.

 

it is a command to change language

 

Code:

if (Regex.Match ( player.LastChat, @"^\s*[!](_:English)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", true);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("you have chosen English for auto-admin language"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:German)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", true);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("German translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:French)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", true);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("French translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Spanish)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", true);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("Spanish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Italian)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", true);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("Italian translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Portuguese)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", true);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("Portuguese translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Swedish)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", true);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("Swedish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Russian)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", true);
    player.Data.setBool("DA", false);
    plugin.ServerCommand ( "admin.say" , plugin.R("Russian translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Danish)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", false);
    player.Data.setBool("FR", false);
    player.Data.setBool("GE", false);
    player.Data.setBool("SP", false);
    player.Data.setBool("IT", false);
    player.Data.setBool("PO", false);
    player.Data.setBool("SW", false);
    player.Data.setBool("RU", false);
    player.Data.setBool("DA", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("Danish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
}
Beyond the compilation error, I see two logic errors. In the first limit:

 

All the code that says:

 

Code:

if (p.Data.issetBool("ENG") == true )
Should be:

 

Code:

if (p.Data.getBool("ENG") == true )
In the second limit, if you set all the flags to false first, you only have to set one to true, like this:

 

Code:

// Reset all flags
 player.Data.setBool("ENG", false);
 player.Data.setBool("FR", false);
 player.Data.setBool("GE", false);
 player.Data.setBool("SP", false);
 player.Data.setBool("IT", false);
 player.Data.setBool("PO", false);
 player.Data.setBool("SW", false);
 player.Data.setBool("RU", false);
 player.Data.setBool("DA", false);

if (Regex.Match ( player.LastChat, @"^\s*[!](_:English)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("you have chosen English for auto-admin language"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:German)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("GE", true);
} ...
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Wow, thanks Papa!

 

For the part about the second round, could I finagle that code a little bit to make it so it would show up on every third round excluding the first? Perhaps something like,

 

Code:

if (!(player.RoundsTotal == 2, 5, 8, 11, 14, 17, 20 && limit.Activations(player.Name) = 1)) return false;
.. all your news stuff goes here ...
The server owner changed his mind and wants to do it every third round now. Which is good for me because it's a new change to learn some new ways to convert my logic into code that Insane Limits can understand. Hoping the above amended code would make it show up on every third round after the first up to the 20th round played of the session on the first spawn.
The second spawn of every third round would be:

 

Code:

if (!(player.RoundsTotal > 2 && player.RoundsTotal % 3 == 0 && limit.Activations(player.Name) == 2)) return false;
.. all your news stuff goes here ...

Also, another quick question. I remember reading earlier (i think from you, Papa) that the OnServerInterval is unreliable past 60. I am trying to set up a twitter feed that will send a tweet when the server population is over 12 but not more than every 6 hours. I have it set up with

 

OnServerInterval 21600

It is unreliable because every 120 seconds all interval counters get reset (it's a bug). At 60 seconds, you either drop an activation if you were unlucky, or, one of your activations gets delayed by up to 60-1 seconds. Any value greater than 120 will never activate, so your limit won't work.

 

It's better to use your own timer for that. Just record the time of your last tweet and compare against that time the next time the server goes over 12. Base the limit on OnJoin instead of OnInterval -- that way you have the most current value (if you were detecting below 12, you would do it OnLeave -- make sense_). If less than 6 hours, return false (skip the tweet). If 6 hours or more, do the tweet and reset the clock.

 

The basic clock code is this:

 

Code:

String kLastTime = "TheLastTweetTime";

DateTime since = DateTime.Now;
bool firstTime = false;
if (plugin.Data.issetObject(kLastTime)) {
    since = (DateTime)plugin.Data.getObject(kLastTime);
} else {
    firstTime = true;
}

double minutes = DateTime.Now.Subtract(since).TotalMinutes;

...

if (!firstTime && minutes < 6*60) return false;
... otherwise, do your tweet ...

// Set the clock
plugin.Data.setObject(kLastTime, (Object)DateTime.Now);
return true; // If you are using an Action to do the Tweet
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by purebattlefield*:

 

Evaluation, OnJoin

First Check, Expression:

Code:

(server.PlayerCount >11)
Second Check, Code:

Code:

String kLastTime = "TheLastTweetTime";

DateTime since = DateTime.Now;
bool firstTime = false;
if (plugin.Data.issetObject(kLastTime)) {
    since = (DateTime)plugin.Data.getObject(kLastTime);
} else {
    firstTime = true;
}

double minutes = DateTime.Now.Subtract(since).TotalMinutes;

if (!firstTime && minutes < 6*60) return false;


// Set the clock
plugin.Data.setObject((Object)DateTime.Now);
Action, Tweet: Message to be tweeted.

 

I'm getting an error:

[16:57:52 00] [insane Limits] Thread(settings): ERROR: 1 error compiling Expression

[16:57:52 00] [insane Limits] Thread(settings): ERROR: (CS1501, line: 51, column: 13): No overload for method 'setObject' takes '1' arguments

 

So I have the limit checking if the population is over 11, if it is, it should check the clock code to make sure it has been over 6 hours, and if that also passes, run the tweet. I'm sorry if this is very trivial and I should be able to figure it out on my own. I need to go to school for computer science. :smile:

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

Originally Posted by Singh400*:

 

Is there an ETA on the next revision of insane limits?

You can find the latest version on . Me and Charlie are working on it when we can, it's a patch-4 revision at the moment.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by supermillhouse*:

 

You can find the latest version on . Me and Charlie are working on it when we can, it's a patch-4 revision at the moment.

What has changed since 0.0.0.8 patch 3 as there is no change log?

 

Thanx

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

Originally Posted by droopie*:

 

im trying to make a keyword trigger to display messages from examples found in the forums and so far have

 

 

( Regex.Match(player.LastChat, @"\s*(_:admin_)", RegexOptions.IgnoreCase).Success )

 

 

 

String msg = "hey, stop crying! if you need an admin just type";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

msg = " !admin [MESSAGE]";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

// Teamspeak server address

msg = " !calladmin [MESSAGE]";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

msg = " !report [PLAYER] [REASON]";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

msg = "and remember, donate to support the admins!";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

return false;

 

 

 

 

so if someone types and hits the keyword "admin" like "is there an admin on_" the messages are displayed for calling and reporting to admins. but how do i ignore if they type !admin so it doesnt display the text? or ignoring all trigger keywords that start with ! in general?

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

Originally Posted by HexaCanon*:

 

I still haven't figured out the mysterious "ERROR: 1 error compiling Code". I've never seen those myself, so I have no idea what causes them.

 

Try to do a dump of your limit code. It uses your limit number, so if your limit is #21, type this command at the top of the Plugin Settings:

 

!dump limit 21

 

That creates a file called LimitEvaluator21.cs in your procon folder. Use whatever your actual limit number is and post the file.

 

 

 

Beyond the compilation error, I see two logic errors. In the first limit:

 

All the code that says:

 

Code:

if (p.Data.issetBool("ENG") == true )
Should be:

 

Code:

if (p.Data.getBool("ENG") == true )
In the second limit, if you set all the flags to false first, you only have to set one to true, like this:

 

Code:

// Reset all flags
 player.Data.setBool("ENG", false);
 player.Data.setBool("FR", false);
 player.Data.setBool("GE", false);
 player.Data.setBool("SP", false);
 player.Data.setBool("IT", false);
 player.Data.setBool("PO", false);
 player.Data.setBool("SW", false);
 player.Data.setBool("RU", false);
 player.Data.setBool("DA", false);

if (Regex.Match ( player.LastChat, @"^\s*[!](_:English)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("you have chosen English for auto-admin language"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:German)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("GE", true);
} ...
i tried so many variation with setting a flag, yet every time i type "myflag" it returns ENG

 

Code:

// Edit rules here
List<String> Languages = new List<String>();
Languages.Add("please choose an auto-admin language");
Languages.Add("----- Auto-admin language -----");
Languages.Add("!English | !German | !French");
Languages.Add("!Spanish |!Italian | !Portuguese");
Languages.Add("!Swedish |!Russian | !Danish");
// Try not to add more Rules.Add because it won't fit in the chat box.
if (Regex.Match ( player.LastChat, @"^\s*[!](_:English|German|French|Spanish|Italian|Portuguese|Swedish|Russian|Danish)", RegexOptions.IgnoreCase).Success) {
 player.Data.setBool("ENG", false);
 player.Data.setBool("FR", false);
 player.Data.setBool("GE", false);
 player.Data.setBool("SP", false);
 player.Data.setBool("IT", false);
 player.Data.setBool("PO", false);
 player.Data.setBool("SW", false);
 player.Data.setBool("RU", false);
 player.Data.setBool("DA", false);
 
if (Regex.Match ( player.LastChat, @"^\s*[!](_:English)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("ENG", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("you have chosen English for auto-admin language"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:German)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("GE", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("German translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:French)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("FR", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("French translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Spanish)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("SP", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("Spanish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Italian)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("IT", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("Italian translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Portuguese)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("PO", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("Portuguese translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Swedish)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("SW", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("Swedish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Russian)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("RU", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("Russian translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:Danish)", RegexOptions.IgnoreCase).Success) {
    player.Data.setBool("DA", true);
    plugin.ServerCommand ( "admin.say" , plugin.R("Danish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
}
} else if (Regex.Match ( player.LastChat, @"^\s*[!](_:languages)", RegexOptions.IgnoreCase).Success) {
    foreach(string Rule in Languages)
    plugin.ServerCommand("admin.say", Rule, "player", player.Name);
}
else if (Regex.Match ( player.LastChat, @"^\s*[!](_:myflag)", RegexOptions.IgnoreCase).Success) {
     if (player.Data.issetBool("ENG")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is ENG!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("FR")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is FR!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("GE")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is GE!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("SP")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is SP!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("IT")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is IT!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("PO")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is PO!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("SW")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is SW!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("RU")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is RU!"), "player" , player.Name ) ;
    } else if (player.Data.issetBool("DA")) {
        plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is DA!"), "player" , player.Name ) ;
    }
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Singh400*:

 

Try this:-

Code:

// Edit rules here
List<String> Languages = new List<String>();
	Languages.Add("please choose an auto-admin language");
	Languages.Add("----- Auto-admin language -----");
	Languages.Add("!English |!German  | !French");
	Languages.Add("!Spanish |!Italian | !Portuguese");
	Languages.Add("!Swedish |!Russian | !Danish");

// Try not to add more Rules.Add because it won't fit in the chat box

// !lang command
if ( Regex.Match ( player.LastChat, @"^\s*[!](_:lang)", RegexOptions.IgnoreCase ) .Success ) 
	{
		foreach(string Rule in Languages)
			plugin.ServerCommand("admin.say", Rule, "player", player.Name);
	}

// Set lang
if ( Regex.Match ( player.LastChat, @"^\s*[!](_:English|German|French|Spanish|Italian|Portuguese|Swedish|Russian|Danish)", RegexOptions.IgnoreCase ) .Success ) 
	{
		player.Data.setBool("ENG", false);
		player.Data.setBool("FR", false);
		player.Data.setBool("GE", false);
		player.Data.setBool("SP", false);
		player.Data.setBool("IT", false);
		player.Data.setBool("PO", false);
		player.Data.setBool("SW", false);
		player.Data.setBool("RU", false);
		player.Data.setBool("DA", false);
 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:English)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("ENG", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("you have chosen English for auto-admin language"), "player" , player.Name ) ;
			} 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:German)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("GE", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("German translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			} 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:French)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("FR", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("French translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			} 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:Spanish)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("SP", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("Spanish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			} 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:Italian)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("IT", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("Italian translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			} 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:Portuguese)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("PO", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("Portuguese translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			} 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:Swedish)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("SW", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("Swedish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			}
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:Russian)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("RU", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("Russian translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			} 
		if (Regex.Match ( player.LastChat, @"^\s*[!](_:Danish)", RegexOptions.IgnoreCase).Success) 
			{
				player.Data.setBool("DA", true);
				plugin.ServerCommand ( "admin.say" , plugin.R("Danish translation is not yet implemented. English messages will be sent"), "player" , player.Name ) ;
			}
	} 

//Check with !myflag
if ( Regex.Match ( player.LastChat, @"^\s*[!](_:flag)", RegexOptions.IgnoreCase ) .Success ) 
	{
		if (player.Data.getBool("ENG")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is ENG!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("FR"))
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is FR!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("GE")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is GE!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("SP")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is SP!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("IT")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is IT!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("PO")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is PO!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("SW")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is SW!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("RU")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is RU!"), "player" , player.Name ) ;
			} 
		if (player.Data.getBool("DA")) 
			{
				plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, Your Flag is DA!"), "player" , player.Name ) ;
			}
	}

return false;
I've tried it and it works fine for me. Changing !French and checking with !flag reports back the correct language.

 

Posted Image

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

Originally Posted by droopie*:

 

im trying to make a keyword trigger to display messages from examples found in the forums and so far have

 

 

( Regex.Match(player.LastChat, @"\s*(_:admin_)", RegexOptions.IgnoreCase).Success )

 

 

 

String msg = "hey, stop crying! if you need an admin just type";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

msg = " !admin [MESSAGE]";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

// Teamspeak server address

msg = " !calladmin [MESSAGE]";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

msg = " !report [PLAYER] [REASON]";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

msg = "and remember, donate to support the admins!";

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

 

return false;

 

 

 

 

so if someone types and hits the keyword "admin" like "is there an admin on_" the messages are displayed for calling and reporting to admins. but how do i ignore if they type !admin so it doesnt display the text? or ignoring all trigger keywords that start with ! in general?

i have updated the code to show only to the player who triggered the keyword admin....

 

plugin.ServerCommand("admin.say", "hey, stop crying! if you need an admin just type", "player", player.Name);

plugin.ServerCommand("admin.say", " !admin REASON", "player", player.Name);

plugin.ServerCommand("admin.say", " !calladmin REASON", "player", player.Name);

plugin.ServerCommand("admin.say", " !report PLAYER REASON", "player", player.Name);

plugin.ServerCommand("admin.say", "and remember, donate to support the admins!", "player", player.Name);

 

but i still hope for a way to ignore the keywords if its a ! command

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

Originally Posted by PapaCharlie9*:

 

I'm getting an error:

[16:57:52 00] [insane Limits] Thread(settings): ERROR: 1 error compiling Expression

[16:57:52 00] [insane Limits] Thread(settings): ERROR: (CS1501, line: 51, column: 13): No overload for method 'setObject' takes '1' arguments

 

So I have the limit checking if the population is over 11, if it is, it should check the clock code to make sure it has been over 6 hours, and if that also passes, run the tweet. I'm sorry if this is very trivial and I should be able to figure it out on my own. I need to go to school for computer science. :smile:

My bad. Go back and look at post #369, I corrected it.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

so if someone types and hits the keyword "admin" like "is there an admin on_" the messages are displayed for calling and reporting to admins. but how do i ignore if they type !admin so it doesnt display the text? or ignoring all trigger keywords that start with ! in general?

Your first_check is close, but it should be:

 

Code:

( Regex.Match(player.LastChat, @"[^!]admin", RegexOptions.IgnoreCase).Success )
The clause [^!] means any character except for !. You can also add other characters, like [^!@#/], which means any character except for : ! @ # /

 

Are you sure you want to send all that to global chat? You can send those message just to the player who typed chat with:

 

Code:

plugin.ServerCommand("admin.say", msg, "player", player.Name);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

i tried so many variation with setting a flag, yet every time i type "myflag" it returns ENG

You still are using Data.issetBool instead of Data.getBool. Notice that Singh's working version uses Data.getBool.

 

issetBool means, someone set the flag, regardless of the value of the flag. They are all set to false at first, so this is ALWAYS going to return true, regardless of what you type.

 

getBool returns the actual value you set, true or false.

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

Originally Posted by purebattlefield*:

 

Thanks for the help, Papa. :smile:

 

Is there a simple (traditional) replacement for server player count I can use in the action tweet filed? I'd like to be able to put something like "Our server now has %player_count% and is growing! Come join!" I looked on the list of replacements and can't seem to find one. I know there is server.PlayerCount but I assume that only works for code in the first or second check inside the limit and not output for the twitter action text. Maybe I have to put the send twitter message command within the second check code of my limit using a string with that?

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

Originally Posted by Singh400*:

 

Thanks for the help, Papa. :smile:

 

Is there a simple (traditional) replacement for server player count I can use in the action tweet filed? I'd like to be able to put something like "Our server now has %player_count% and is growing! Come join!" I looked on the list of replacements and can't seem to find one. I know there is server.PlayerCount but I assume that only works for code in the first or second check inside the limit and not output for the twitter action text. Maybe I have to put the send twitter message command within the second check code of my limit using a string with that?

Don't use the Action secton. Instead use plugin.Tweet in code.

 

Code:

string msg = "Our server now has " + server.PlayerCount + " and is growing! Get your slots while they're hot!";

plugin.Tweet( msg ) ;

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

Originally Posted by purebattlefield*:

 

Don't use the Action secton. Instead use plugin.Tweet in code.

 

Code:

string msg = "Our server now has " + server.PlayerCount + " and is growing! Get your slots while they're hot!";

plugin.Tweet( msg ) ;

return false;
Awesome! Pretty sure I have it all set up now. Thanks to both of you!

 

I don't suppose there is a way to check server population within a time span, is there?

 

I need to alter the code again to make it not send the tweet if the server's population has not dropped below the threshold since the last tweet.

 

So if the server population is >11 and it has been 6 hours and the server population has dropped below 11 since the last tweet, then tweet.

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

Originally Posted by HexaCanon*:

 

I still haven't figured out the mysterious "ERROR: 1 error compiling Code". I've never seen those myself, so I have no idea what causes them.

 

Try to do a dump of your limit code. It uses your limit number, so if your limit is #21, type this command at the top of the Plugin Settings:

 

!dump limit 21

 

That creates a file called LimitEvaluator21.cs in your procon folder. Use whatever your actual limit number is and post the file.

getbool fixed lots of issues, still do not know why this limit is not compiling. (dump file)

 

(votekick limit)

 

Code:

namespace PRoConEvents
{
    using System;
    using System.IO;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Collections.Generic;
    using System.Collections;
    using System.Net;
    using System.Net.Mail;
    using System.Web;
    using System.Data;
    using System.Threading;


    class LimitEvaluator9
    {
        public bool FirstCheck(PlayerInfoInterface player, ServerInfoInterface server, PluginInterface plugin, TeamInfoInterface team1, TeamInfoInterface team2, TeamInfoInterface team3, TeamInfoInterface team4)
        {
            try
            {
            double percent = 25;
            
            /* Verify that it is a command */
            if (!plugin.IsInGameCommand(player.LastChat))
                return false;
            
            /* Extract the command */
            String command = plugin.ExtractInGameCommand(player.LastChat);
            
            /* Sanity check the command */
            if (command.Length == 0)
                return false;
                
            /* Parse the command */
            Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);
            
            /* Bail out if not a vote-kick */
            if (!kickMatch.Success)
                return false;
                
            /* Extract the player name */
            PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);
            
            if (target == null)
                return false;
                
            if (target.Name.Equals(player.Name))
            {   if (player.Data.getBool("ENG") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("FR") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("GE") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("SP") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("IT") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("PO") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("SW") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("RU") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                } else if (player.Data.getBool("DA") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick yourself!"), "player" , player.Name ) ;
                }
                return false;
            }
                
            /* Account the vote in the voter's dictionary */
            /* Votes are kept with the voter, not the votee */
            /* If the voter leaves, his votes are not counted */
            
            if (!player.DataRound.issetObject("votekick"))
                player.DataRound.setObject("votekick", new Dictionary<String, bool>());
            
            Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");
            
            if (!vdict.ContainsKey(target.Name))
                vdict.Add(target.Name, true);
            
            
            /* Tally the votes against the target player */
            double votes = 0;
            List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
            all.AddRange(team1.players);
            all.AddRange(team2.players);
            all.AddRange(team3.players);
            all.AddRange(team4.players);
            
            foreach(PlayerInfoInterface p in all)
                if (p.DataRound.issetObject("votekick"))
                {
                   Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
                   if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
                       votes++;
                }
            
            if (all.Count == 0)
                return false;
                
            int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
            int remain = (int) ( needed - votes);
            
            if (remain == 1) {
                foreach (PlayerInfoInterface p in all) {
                if (p.Data.getBool("ENG") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                } else if (p.Data.getBool("FR") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                } else if (p.Data.getBool("GE") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                } else if (p.Data.getBool("SP") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                }else if (p.Data.getBool("IT") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                }else if (p.Data.getBool("PO") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                }else if (p.Data.getBool("SW") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                }else if (p.Data.getBool("RU") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                }else if (p.Data.getBool("DA") == true ) {
                    plugin.ServerCommand("admin.say", target.Name + " is about to get vote-kicked, 1 more vote needed", "player", player.Name);
                }
            } }
            else if (remain > 0) {    
                foreach (PlayerInfoInterface p in all) {
                if (p.Data.getBool("ENG") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                } else if (p.Data.getBool("FR") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                } else if (p.Data.getBool("GE") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                } else if (p.Data.getBool("SP") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("IT") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("PO") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("SW") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("RU") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("DA") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }
            }
            
            
            if (remain > 0)
                plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");
            
            if (votes >= needed)
            {
            
            foreach (PlayerInfoInterface p in all) {
                if (p.Data.getBool("ENG") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                } else if (p.Data.getBool("FR") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                } else if (p.Data.getBool("GE") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                } else if (p.Data.getBool("SP") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                }else if (p.Data.getBool("IT") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                }else if (p.Data.getBool("PO") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                }else if (p.Data.getBool("SW") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                }else if (p.Data.getBool("RU") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                }else if (p.Data.getBool("DA") == true ) {
                    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                    String message = target.Name + " was vote-kicked " + count ;
                    plugin.ServerCommand("admin.say", message, "player", player.Name);
                }
            }
            if (target.Data.getBool("ENG") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("FR") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("GE") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("SP") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("IT") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("PO") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("SW") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("RU") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            } else if (target.Data.getBool("DA") == true ) {
                String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
                plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
            }
            
            return true;
            
            }
            
            return false;
            return false;
            }
            catch(Exception e)
            {
                plugin.DumpException(e, this.GetType().Name);
            }
            return false;
        }

        public bool SecondCheck(PlayerInfoInterface player, ServerInfoInterface server, PluginInterface plugin, TeamInfoInterface team1, TeamInfoInterface team2, TeamInfoInterface team3, TeamInfoInterface team4, LimitInfoInterface limit)
        {
            try
            {
            
            return true;
            }
            catch(Exception e)
            {
               plugin.DumpException(e, this.GetType().Name);
            }
            return true;
        }
    }  
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

getbool fixed lots of issues, still do not know why this limit is not compiling. (dump file)

 

(votekick limit)

Aha!

 

You have mismatched curly braces. I think that is what is causing the compiler error. This is the block of code which introduces an open curly { that does not have a corresponding close. I colored them to show what the matches are. There is no matching red }.

 

Code:

else if (remain > 0) [b]{[/b]    
                foreach (PlayerInfoInterface p in all) [b]{[/b]
                if (p.Data.getBool("ENG") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                } else if (p.Data.getBool("FR") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                } else if (p.Data.getBool("GE") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                } else if (p.Data.getBool("SP") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("IT") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("PO") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("SW") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("RU") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }else if (p.Data.getBool("DA") == true ) {
                    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"), "player" , player.Name ) ;
                }
            [b]}[/b]

            if (remain > 0)
                plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");
You need to add another } after the final purple one.

 

Now I know what to look for when someone else reports the same cryptic error. Thanks!

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

Originally Posted by HexaCanon*:

 

i know i have been asking a lot, but i really want this multi-language autoadmin to work.

 

votekick limit is working now.

 

i have issue with knife message rotation. this is the full dump

full dump:

 

 

Code:

namespace PRoConEvents
{
    using System;
    using System.IO;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Collections.Generic;
    using System.Collections;
    using System.Net;
    using System.Net.Mail;
    using System.Web;
    using System.Data;
    using System.Threading;


    class LimitEvaluator29
    {
        public bool FirstCheck(PlayerInfoInterface player, PlayerInfoInterface killer, KillInfoInterface kill, PlayerInfoInterface victim, ServerInfoInterface server, PluginInterface plugin, TeamInfoInterface team1, TeamInfoInterface team2, TeamInfoInterface team3, TeamInfoInterface team4)
        {
            try
            {
            return ( (( Regex.Match(kill.Weapon, @"(ACB-90|Knife|Melee)", RegexOptions.IgnoreCase).Success )) == true);
            }
            catch(Exception e)
            {
                plugin.DumpException(e, this.GetType().Name);
            }
            return false;
        }

        public bool SecondCheck(PlayerInfoInterface player, PlayerInfoInterface killer, KillInfoInterface kill, PlayerInfoInterface victim, ServerInfoInterface server, PluginInterface plugin, TeamInfoInterface team1, TeamInfoInterface team2, TeamInfoInterface team3, TeamInfoInterface team4, LimitInfoInterface limit)
        {
            try
            {
            List<String> shameENG = new List<String>();
            shameENG.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameENG.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameENG.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameENG.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameENG.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameENG.Add("%v_n% was shanked by %k_n%!");
            shameENG.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameENG.Add("%k_n% stabbed his way through %v_n%!");
            shameENG.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameENG.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameENG.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameENG.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameENG.Add("%v_n% has been slashed by %k_n%");
            shameENG.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameENG.Add("%k_n% owned %v_n% with a knife!");
            shameENG.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameENG.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameENG.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameENG.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameENG.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameENG.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameENG.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameENG.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameENG.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameENG.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameENG.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameENG.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameENG.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameENG.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameENG.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameENG.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameENG.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameENG.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameENG.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameENG.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameENG.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameENG.Add("%k_n% sliced %v_n% throat and burned his body");
            shameENG.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameENG.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameENG.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameENG.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameENG.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameENG.Add("%k_n% split %v_n% throat and urinated on him");
            shameENG.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameENG.Add("%k_n% Humiliated %v_n%");
            shameENG.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameENG.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameENG.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameENG.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameENG.Add("%v_n% is a knife magnet today!");
            shameENG.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameENG.Add("...");
            List<String> shameFR = new List<String>();
            shameFR.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameFR.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameFR.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameFR.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameFR.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameFR.Add("%v_n% was shanked by %k_n%!");
            shameFR.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameFR.Add("%k_n% stabbed his way through %v_n%!");
            shameFR.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameFR.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameFR.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameFR.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameFR.Add("%v_n% has been slashed by %k_n%");
            shameFR.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameFR.Add("%k_n% owned %v_n% with a knife!");
            shameFR.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameFR.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameFR.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameFR.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameFR.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameFR.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameFR.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameFR.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameFR.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameFR.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameFR.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameFR.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameFR.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameFR.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameFR.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameFR.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameFR.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameFR.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameFR.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameFR.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameFR.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameFR.Add("%k_n% sliced %v_n% throat and burned his body");
            shameFR.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameFR.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameFR.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameFR.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameFR.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameFR.Add("%k_n% split %v_n% throat and urinated on him");
            shameFR.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameFR.Add("%k_n% Humiliated %v_n%");
            shameFR.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameFR.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameFR.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameFR.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameFR.Add("%v_n% is a knife magnet today!");
            shameFR.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameFR.Add("...");
            List<String> shameGE = new List<String>();
            shameGE.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameGE.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameGE.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameGE.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameGE.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameGE.Add("%v_n% was shanked by %k_n%!");
            shameGE.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameGE.Add("%k_n% stabbed his way through %v_n%!");
            shameGE.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameGE.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameGE.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameGE.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameGE.Add("%v_n% has been slashed by %k_n%");
            shameGE.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameGE.Add("%k_n% owned %v_n% with a knife!");
            shameGE.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameGE.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameGE.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameGE.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameGE.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameGE.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameGE.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameGE.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameGE.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameGE.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameGE.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameGE.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameGE.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameGE.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameGE.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameGE.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameGE.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameGE.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameGE.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameGE.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameGE.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameGE.Add("%k_n% sliced %v_n% throat and burned his body");
            shameGE.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameGE.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameGE.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameGE.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameGE.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameGE.Add("%k_n% split %v_n% throat and urinated on him");
            shameGE.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameGE.Add("%k_n% Humiliated %v_n%");
            shameGE.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameGE.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameGE.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameGE.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameGE.Add("%v_n% is a knife magnet today!");
            shameGE.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameGE.Add("...");
            List<String> shameSP = new List<String>();
            shameSP.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameSP.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameSP.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameSP.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameSP.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameSP.Add("%v_n% was shanked by %k_n%!");
            shameSP.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameSP.Add("%k_n% stabbed his way through %v_n%!");
            shameSP.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameSP.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameSP.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameSP.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameSP.Add("%v_n% has been slashed by %k_n%");
            shameSP.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameSP.Add("%k_n% owned %v_n% with a knife!");
            shameSP.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameSP.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameSP.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameSP.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameSP.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameSP.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameSP.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameSP.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameSP.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameSP.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameSP.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameSP.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameSP.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameSP.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameSP.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameSP.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameSP.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameSP.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameSP.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameSP.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameSP.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameSP.Add("%k_n% sliced %v_n% throat and burned his body");
            shameSP.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameSP.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameSP.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameSP.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameSP.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameSP.Add("%k_n% split %v_n% throat and urinated on him");
            shameSP.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameSP.Add("%k_n% Humiliated %v_n%");
            shameSP.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameSP.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameSP.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameSP.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameSP.Add("%v_n% is a knife magnet today!");
            shameSP.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameSP.Add("...");
            List<String> shameIT = new List<String>();
            shameIT.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameIT.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameIT.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameIT.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameIT.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameIT.Add("%v_n% was shanked by %k_n%!");
            shameIT.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameIT.Add("%k_n% stabbed his way through %v_n%!");
            shameIT.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameIT.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameIT.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameIT.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameIT.Add("%v_n% has been slashed by %k_n%");
            shameIT.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameIT.Add("%k_n% owned %v_n% with a knife!");
            shameIT.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameIT.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameIT.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameIT.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameIT.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameIT.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameIT.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameIT.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameIT.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameIT.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameIT.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameIT.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameIT.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameIT.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameIT.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameIT.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameIT.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameIT.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameIT.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameIT.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameIT.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameIT.Add("%k_n% sliced %v_n% throat and burned his body");
            shameIT.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameIT.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameIT.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameIT.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameIT.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameIT.Add("%k_n% split %v_n% throat and urinated on him");
            shameIT.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameIT.Add("%k_n% Humiliated %v_n%");
            shameIT.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameIT.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameIT.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameIT.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameIT.Add("%v_n% is a knife magnet today!");
            shameIT.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameIT.Add("...");
            List<String> shamePO = new List<String>();
            shamePO.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shamePO.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shamePO.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shamePO.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shamePO.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shamePO.Add("%v_n% was shanked by %k_n%!");
            shamePO.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shamePO.Add("%k_n% stabbed his way through %v_n%!");
            shamePO.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shamePO.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shamePO.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shamePO.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shamePO.Add("%v_n% has been slashed by %k_n%");
            shamePO.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shamePO.Add("%k_n% owned %v_n% with a knife!");
            shamePO.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shamePO.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shamePO.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shamePO.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shamePO.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shamePO.Add("%k_n% just Tweeted about knifing %v_n%!");
            shamePO.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shamePO.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shamePO.Add("%k_n% is now wearing %v_n% trophy tags!");
            shamePO.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shamePO.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shamePO.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shamePO.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shamePO.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shamePO.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shamePO.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shamePO.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shamePO.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shamePO.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shamePO.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shamePO.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shamePO.Add("%k_n% sliced %v_n% throat and burned his body");
            shamePO.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shamePO.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shamePO.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shamePO.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shamePO.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shamePO.Add("%k_n% split %v_n% throat and urinated on him");
            shamePO.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shamePO.Add("%k_n% Humiliated %v_n%");
            shamePO.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shamePO.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shamePO.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shamePO.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shamePO.Add("%v_n% is a knife magnet today!");
            shamePO.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shamePO.Add("...");
            List<String> shameSW = new List<String>();
            shameSW.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameSW.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameSW.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameSW.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameSW.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameSW.Add("%v_n% was shanked by %k_n%!");
            shameSW.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameSW.Add("%k_n% stabbed his way through %v_n%!");
            shameSW.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameSW.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameSW.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameSW.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameSW.Add("%v_n% has been slashed by %k_n%");
            shameSW.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameSW.Add("%k_n% owned %v_n% with a knife!");
            shameSW.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameSW.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameSW.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameSW.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameSW.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameSW.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameSW.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameSW.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameSW.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameSW.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameSW.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameSW.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameSW.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameSW.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameSW.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameSW.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameSW.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameSW.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameSW.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameSW.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameSW.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameSW.Add("%k_n% sliced %v_n% throat and burned his body");
            shameSW.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameSW.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameSW.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameSW.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameSW.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameSW.Add("%k_n% split %v_n% throat and urinated on him");
            shameSW.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameSW.Add("%k_n% Humiliated %v_n%");
            shameSW.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameSW.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameSW.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameSW.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameSW.Add("%v_n% is a knife magnet today!");
            shameSW.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameSW.Add("...");
            List<String> shameRU = new List<String>();
            shameRU.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameRU.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameRU.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameRU.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameRU.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameRU.Add("%v_n% was shanked by %k_n%!");
            shameRU.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameRU.Add("%k_n% stabbed his way through %v_n%!");
            shameRU.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameRU.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameRU.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameRU.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameRU.Add("%v_n% has been slashed by %k_n%");
            shameRU.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameRU.Add("%k_n% owned %v_n% with a knife!");
            shameRU.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameRU.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameRU.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameRU.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameRU.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameRU.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameRU.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameRU.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameRU.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameRU.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameRU.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameRU.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameRU.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameRU.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameRU.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameRU.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameRU.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameRU.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameRU.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameRU.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameRU.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameRU.Add("%k_n% sliced %v_n% throat and burned his body");
            shameRU.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameRU.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameRU.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameRU.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameRU.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameRU.Add("%k_n% split %v_n% throat and urinated on him");
            shameRU.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameRU.Add("%k_n% Humiliated %v_n%");
            shameRU.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameRU.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameRU.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameRU.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameRU.Add("%v_n% is a knife magnet today!");
            shameRU.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameRU.Add("...");
            List<String> shameDA = new List<String>();
            shameDA.Add("%v_n% hold still, %k_n% is trying to cut you out of your gimp costume");
            shameDA.Add("could you please have a look for %k_n%'s knife, it was last seen in the vicinity of %v_n%");
            shameDA.Add("%k_n% whispers (you are my bitch now) as he pull knife out of %v_n%");
            shameDA.Add("%k_n% just sliced %v_n%'s throat, what a shame, bro!");
            shameDA.Add("as %k_n% knifes %v_n% he wonders if O.J Simpson's lawyer is available");
            shameDA.Add("%v_n% was shanked by %k_n%!");
            shameDA.Add("%v_n% regrets playing (pin the tail on the donkey) with %k_n%");
            shameDA.Add("%k_n% stabbed his way through %v_n%!");
            shameDA.Add("%k_n% starts the bidding for %v_n%'s organs at £1");
            shameDA.Add("%k_n% just sliced %v_n%'s throat, what a bloody mess!");
            shameDA.Add("%k_n%'s knife is ribbed for your pleasure %v_n%");
            shameDA.Add("%k_n% just took %v_n%'s tags and made him cry!");
            shameDA.Add("%v_n% has been slashed by %k_n%");
            shameDA.Add("%k_n% slipped a shiv into %v_n%'s back!");
            shameDA.Add("%k_n% owned %v_n% with a knife!");
            shameDA.Add("%k_n% tells %v_n% (stop screaming, i've seen men put bigger things into you on porntube)");
            shameDA.Add("%v_n% now knows why %k_n%'s nickname is McStabby");
            shameDA.Add("%k_n% knifed %v_n% and Insane Limits approves!");
            shameDA.Add("%v_n%, you gonna let %k_n% get away with taking your tags_");
            shameDA.Add("%k_n% just finished bathing in the blood of %v_n%!");
            shameDA.Add("%k_n% just Tweeted about knifing %v_n%!");
            shameDA.Add("%v_n% smashed the keyboard in anger after %k_n% took his tags!");
            shameDA.Add("%k_n% just posted %v_n%'s tags on Facebook!");
            shameDA.Add("%k_n% is now wearing %v_n% trophy tags!");
            shameDA.Add("%k_n%: 'Just die already, %v_n%'"); // From BC2
            shameDA.Add("%k_n%: 'Hey %v_n%, you want summa this_'"); // From BC2
            shameDA.Add("%v_n% took a gun to a knife fight with %k_n%, and LOST!");
            shameDA.Add("%k_n% it's fair enough that you killed %v_n% but why you putting a dress and make-up on him... ");
            shameDA.Add("Disturbing... %k_n% laughs like a 12 year old school girl as he repeatedly knifes %v_n% and dances around in his blood");
            shameDA.Add("Did you see the YouTube of %k_n% knifing %v_n%_");
            shameDA.Add("%k_n% just added +1 knife kills to his Battlelog stats, thanks to %v_n%");
            shameDA.Add("as %k_n% removed knife from %v_n% he wonders why it's so hard to make friends ...");
            shameDA.Add("%v_n% Just made %k_n% knife dirty,by falling on his knife!");
            shameDA.Add("%k_n%: 'Hey %v_n%, check your six next time!'");
            shameDA.Add("%v_n%, go tell your momma you lost your tags to %k_n%!");
            shameDA.Add("%k_n% Lost his knife in the fat of %v_n% body");
            shameDA.Add("%k_n% sliced %v_n% throat and burned his body");
            shameDA.Add("%v_n% regrets taking the piss out of %k_n%'s kitten...Mr fluffykins");
            shameDA.Add("%k_n% pulled out %v_n% heart, and fed it to the dog.");
            shameDA.Add("%k_n% added %v_n% dogtags to his dogtags trophy section.");
            shameDA.Add("%k_n% shoved the knife into %v_n% eyeball,and kicked him off the ledge screaming: This is SPAAAAAARTAAA!");
            shameDA.Add("%k_n%, %v_n%'s mam has been on the phone asking for his dogtags back");
            shameDA.Add("%k_n% split %v_n% throat and urinated on him");
            shameDA.Add("%k_n% just chopped %v_n% balls off! that gotta hurt !!");
            shameDA.Add("%k_n% Humiliated %v_n%");
            shameDA.Add("%v_n%'s blood is now sprayed everywhere due to %k_n% knife's action!");
            shameDA.Add("Sad music plays on the background, while %v_n% bleeds to death ...");
            shameDA.Add("%k_n% Cutted out %v_n% ribs and shouted: BBQ Tonight at my place.");
            shameDA.Add("%v_n% regrets betting %k_n% that he couldn't guess what he had for lunch");
            shameDA.Add("%v_n% is a knife magnet today!");
            shameDA.Add("%v_n% surrendered his tags to %k_n% by way of a knife!");
            // Add additional messages here with shameDA.Add("...");
             
            
            int level = 2;
            
            try {
            	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
            } catch (Exception e) {}
            
            int next = Convert.ToInt32(limit.ActivationsTotal());
            next = next % shame.Count; // Ensure rotation of messages
            
            if ( Regex.Match(kill.Weapon, @"(ACB-90|Knife|Melee)", RegexOptions.IgnoreCase).Success ) {
            foreach (PlayerInfoInterface p in all) {
                if (p.Data.getBool("ENG")) {
                    String knifemessage = plugin.R(shameENG[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                } else if (p.Data.getBool("FR")) {
                    String knifemessage = plugin.R(shameFR[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                } else if (p.Data.getBool("GE")) {
                    String knifemessage = plugin.R(shameGE[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                } else if (p.Data.getBool("SP")) {
                    String knifemessage = plugin.R(shameSP[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("IT")) {
                    String knifemessage = plugin.R(shameIT[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("PO")) {
                    String knifemessage = plugin.R(shamePO[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("SW")) {
                    String knifemessage = plugin.R(shameSW[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("RU")) {
                    String knifemessage = plugin.R(shameRU[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("DA")) {
                    String knifemessage = plugin.R(shameDA[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }
            }
                return false;	
            }
            return true;
            }
            catch(Exception e)
            {
               plugin.DumpException(e, this.GetType().Name);
            }
            return true;
        }
    }  
}

 

 

 

error is at this part

Code:

int level = 2;
            
            try {
            	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
            } catch (Exception e) {}
            
            int next = Convert.ToInt32(limit.ActivationsTotal());
            next = next % shame.Count; // Ensure rotation of messages
            
            if ( Regex.Match(kill.Weapon, @"(ACB-90|Knife|Melee)", RegexOptions.IgnoreCase).Success ) {
            foreach (PlayerInfoInterface p in all) {
                if (p.Data.getBool("ENG")) {
                    String knifemessage = plugin.R(shameENG[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                } else if (p.Data.getBool("FR")) {
                    String knifemessage = plugin.R(shameFR[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                } else if (p.Data.getBool("GE")) {
                    String knifemessage = plugin.R(shameGE[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                } else if (p.Data.getBool("SP")) {
                    String knifemessage = plugin.R(shameSP[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("IT")) {
                    String knifemessage = plugin.R(shameIT[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("PO")) {
                    String knifemessage = plugin.R(shamePO[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("SW")) {
                    String knifemessage = plugin.R(shameSW[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("RU")) {
                    String knifemessage = plugin.R(shameRU[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }else if (p.Data.getBool("DA")) {
                    String knifemessage = plugin.R(shameDA[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                }
            }
error messages

Code:

[13:58:30 13] [Insane Limits] Thread(settings): ERROR: 2 errors compiling Expression
[13:58:30 13] [Insane Limits] Thread(settings): ERROR: (CS0103, line: 521, column: 27):  The name 'shame' does not exist in the current context
[13:58:30 13] [Insane Limits] Thread(settings): ERROR: (CS0103, line: 524, column: 47):  The name 'all' does not exist in the current context
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

You need to post the full code. And from the errors it looks like you have properly defined 'shame' or 'all'.

I don't think you need the 'all'. The all is only when you want to search the entire player list or do some commant, other than global chat/yell, to every player. You are just sending the shame to the killer and victim, right? If so, you should remove the foreach and change all the p to killer and victim, e.g., instead of p.Data, use killer.Data AND victim.Data. Also, instead of player.Name, use killer.Name and victim.Name. This is all OnKill or OnDeath, right? This means you have to do your language check for each of killer and victim separately, since they might use different languages. So instead of

 

Code:

if (p.Data.getBool("ENG")) {
                    String knifemessage = plugin.R(shameENG[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", player.Name);
                } else if (p.Data.getBool("FR")) {
You want first:

 

Code:

if (killer.Data.getBool("ENG")) {
                    String knifemessage = plugin.R(shameENG[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", killer.Name);
                } else if (killer.Data.getBool("FR")) { ...
then copy that whole block of if/else if/else and do it again, only with victim:

 

Code:

if (victim.Data.getBool("ENG")) {
                    String knifemessage = plugin.R(shameENG[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", victim.Name);
                } else if (victim.Data.getBool("FR")) { ...
The 'shame' has to be moved into each of your if statements, since you have language specific ones. Like for ENG, you need this:

 

This line:

Code:

next = next % shame.Count; // Ensure rotation of messages
Has to be moved into each of your if statements, for example, for ENG:

 

Code:

if (killer.Data.getBool("ENG")) {
                    next = next % shameENG.Count; // Ensure rotation of messages
                    String knifemessage = plugin.R(shameENG[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", killer.Name);
Or better yet, if all the phrase Lists are all the same length, then keep it outside and just use one of them as a representative.

 

Code:

int next = Convert.ToInt32(limit.ActivationsTotal());
            next = next % shameENG.Count; // shameENG.Count is the same as all other shame Lists
            
            if ( Regex.Match(kill.Weapon, @"(ACB-90|Knife|Melee)", RegexOptions.IgnoreCase).Success ) {
                if (killer.Data.getBool("ENG")) {
                    String knifemessage = plugin.R(shameENG[next]);
                    plugin.ServerCommand("admin.yell", knifemessage, "player", killer.Name);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by chuckinbeast*:

 

Per your request from my other thread, I'm looking for a competitive BF3 plugin/plugin mod.

 

At the end of the round a CSV file would be generated and stored in an easily accessible location that would simply include the following information (revives = revives applied if posssible):

 

Playername1,GUID,Team,Kills,Deaths,Headshots,Score ,Revives

Playername2,GUID,Team,Kills,Deaths,Headshots,Score ,Revives

etc

etc

 

Thanks!

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