Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

Originally Posted by Singh400*:

 

I've tested this:-

 

Code:

if (Regex.Match(chatword, "^"+racism+"[s]_[!_]_[_!]_$", RegexOptions.IgnoreCase).Success)
As best I can, and it seems to be working fine. I've also modified it so it picks up the plural now. So now the first part looks like this:-

 

Code:

string fancy_time = DateTime.Now.ToString("HH:mm:ss");

string fancy_date = DateTime.Now.ToString("yyyy-MM-dd");

List<string> racisms = new List<string>();
	racisms.Add("nigger");
	racisms.Add("nigga");
	racisms.Add("paki");
	
string[] chatwords = Regex.Split(player.LastChat, @"\s+");
    
foreach(string chatword in chatwords) 
{
	foreach(string racism in racisms)
	{
		if (Regex.Match(chatword, "^"+racism+"[s]_[!_]_[_!]_$", 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("[" + fancy_date + "] [" + fancy_time + "] %p_n% said [" + player.LastChat + "]"));
			return true;
			
		}
	}
}
* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 3.2k
  • Created
  • Last Reply

Originally Posted by Dudenell*:

 

Forget the above request, I found a work around.

 

Basically I got my admins to join a service called cel.ly

once they join this a player can request an admin by typing

!admin

 

and the messaged will be sent as a text to everyone in the group on cel.ly

The only issue I could see is if A. someone spammed it or B. someone is requesting an admin when an admin is on. I guess my next question is there a way to check through a list to see if a player is on the server?

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

Originally Posted by HexaCanon*:

 

Forget the above request, I found a work around.

 

Basically I got my admins to join a service called cel.ly

once they join this a player can request an admin by typing

!admin

 

and the messaged will be sent as a text to everyone in the group on cel.ly

The only issue I could see is if A. someone spammed it or B. someone is requesting an admin when an admin is on. I guess my next question is there a way to check through a list to see if a player is on the server?

there is a way to limit the spam through limiting the amount of activation per round for each player.

there is a way to check on the players and see if there is an admin on.

 

can you give me the original code you use so that i can modify it ?

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

Originally Posted by Dudenell*:

 

there is a way to limit the spam through limiting the amount of activation per round for each player.

there is a way to check on the players and see if there is an admin on.

 

can you give me the original code you use so that i can modify it ?

This is onanychat and the first check is code

 

Code:

string msg1 = " You have requeted an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin, so are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and JetStreak54";
List<String> info_words = new List<String>();
info_words.Add(@"!admin+(s_)_");
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	foreach(String chat_word in chat_words)
		foreach(String info_word in info_words)
            if (Regex.Match(chat_word, "^"+info_word+"$", RegexOptions.IgnoreCase).Success){
			
				if(plugin.isInList(player.Name, "admins")){
					plugin.ServerCommand("admin.yell", (player.Name + msg3));
					}
				else{
					plugin.Tweet(plugin.R(player.Name + msg2 + player.LastChat));
					plugin.ServerCommand("admin.yell", (player.Name + msg1),"30", "player", player.Name);
					plugin.ServerCommand ( "admin.say" , (player.Name + msg1), "player" , player.Name );
				}
			}
return false;
the list admins holds all the current admins in the group. It will send a message to twitter where cel.ly will then take the message and send it to the group.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by HexaCanon*:

 

This is onanychat and the first check is code

 

Code:

string msg1 = " You have requeted an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin, so are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and JetStreak54";
List<String> info_words = new List<String>();
info_words.Add(@"!admin+(s_)_");
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	foreach(String chat_word in chat_words)
		foreach(String info_word in info_words)
            if (Regex.Match(chat_word, "^"+info_word+"$", RegexOptions.IgnoreCase).Success){
			
				if(plugin.isInList(player.Name, "admins")){
					plugin.ServerCommand("admin.yell", (player.Name + msg3));
					}
				else{
					plugin.Tweet(plugin.R(player.Name + msg2 + player.LastChat));
					plugin.ServerCommand("admin.yell", (player.Name + msg1),"30", "player", player.Name);
					plugin.ServerCommand ( "admin.say" , (player.Name + msg1), "player" , player.Name );
				}
			}
return false;
the list admins holds all the current admins in the group. It will send a message to twitter where cel.ly will then take the message and send it to the group.
please please test this, i have not even applied any kind of logic into it xD just mashed things together very fast because i have to go to work

 

Code:

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
if (team3.players.Count > 0) all.AddRange(team3.players);
if (team4.players.Count > 0) all.AddRange(team4.players);


string msg1 = " You have requeted an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin, so are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and JetStreak54";


List<String> info_words = new List<String>();
info_words.Add(@"!admin+(s_)_");
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	foreach(String chat_word in chat_words)
		foreach(String info_word in info_words)
            if (Regex.Match(chat_word, "^"+info_word+"$", RegexOptions.IgnoreCase).Success){
                if (limit.Activations ( player.Name ) <= 3) {
                    foreach (PlayerInfoInterface p in all) {
                    if(plugin.isInList(p.Name, "admins") && player.RoundData.getBool("NoAdmin") == false){
                        plugin.ServerCommand("admin.yell", (p.Name + msg3));
                        player.RoundData.setBool("NoAdmin", true);
                        }}
                    else {
                        plugin.Tweet(plugin.R(player.Name + msg2 + player.LastChat));
                        plugin.ServerCommand("admin.yell", (player.Name + msg1),"30", "player", player.Name);
                        plugin.ServerCommand ( "admin.say" , (player.Name + msg1), "player" , player.Name );
                        player.RoundData.setBool("NoAdmin", false);
                    }
                    }
                }
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Dudenell*:

 

Ok so, there was a missing or misplaced { somewhere, I couldn't compile with limit.Activations (doesn't exist in current context) and from testing it (I may have the } at the wrong spot it created a never ending loop after it was said. Here's the code with as much fixing as I could figure out.

 

Code:

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
if (team3.players.Count > 0) all.AddRange(team3.players);
if (team4.players.Count > 0) all.AddRange(team4.players);


string msg1 = " You have requeted an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin, so are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and JetStreak54";


List<String> info_words = new List<String>();
info_words.Add(@"!admin+(s_)_");
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	foreach(String chat_word in chat_words)
		foreach(String info_word in info_words)
            if (Regex.Match(chat_word, "^"+info_word+"$", RegexOptions.IgnoreCase).Success){
               // if (limit.Activations ( player.Name ) <= 3) {
                    foreach (PlayerInfoInterface p in all) {
                    if(plugin.isInList(p.Name, "admins") && player.RoundData.getBool("NoAdmin") == false){
                        plugin.ServerCommand("admin.yell", (p.Name + msg3));
                        player.RoundData.setBool("NoAdmin", true);
						}
						
                    else {
                        plugin.Tweet(plugin.R(player.Name + msg2 + player.LastChat));
                        plugin.ServerCommand("admin.yell", (player.Name + msg1),"30", "player", player.Name);
                        plugin.ServerCommand ( "admin.say" , (player.Name + msg1), "player" , player.Name );
                        player.RoundData.setBool("NoAdmin", false);
                    }
                    }
                }
				
return false;
BUT using this example:

 

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

 

I was able to go in and get the activation limit to work

Onanychat

 

First check code

Code:

List<String> info_words = new List<String>();
info_words.Add(@"!admin+(s_)_");

String[] chat_words = Regex.Split(player.LastChat, @"\s+");
foreach(String chat_word in chat_words)
	foreach(String info_word in info_words)
		if (Regex.Match(chat_word, "^"+info_word+"$", RegexOptions.IgnoreCase).Success)
			return true;
return false;
Second check code

 

Code:

string msg1 = " You have requeted an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin, so are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and JetStreak54";
string msg4 = " you have activated request admin too many times";
int count = (int) limit.Activations(player.Name);
if (count <=  2) {
	if(plugin.isInList(player.Name, "admins")){
		plugin.ServerCommand("admin.yell", (player.Name + msg3));
	}
	else{
		plugin.Tweet(plugin.R(player.Name + msg2 + player.LastChat));
		plugin.ServerCommand("admin.yell", (player.Name + msg1),"30", "player", player.Name);
		plugin.ServerCommand ( "admin.say" , (player.Name + msg1), "player" , player.Name );
	}
}
else{
	plugin.ServerCommand("admin.yell", (player.Name + msg4),"30", "player", player.Name);
	plugin.ServerCommand ( "admin.say" , (player.Name + msg4), "player" , player.Name );
	server.RoundData.setBool(player.Name, true);
I'm wondering if I need to just go ahead and create a second limit checking on player join if that player is in the group admins or not to return something like adminon or if I'm just missing something else you had in your code that would make it simpler
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Dudenell*:

 

Only thing I still need help with is trying to figure out if a admin is on and to send a different message if they are.

 

Here's my proposal.

 

I already have a limit checking if a player has spawned and if that player is an admin to send a different message to that player

 

So I would edit that spawn script (limited by activations) and do

plugin.Data.setBool("adminon", true);

 

Then I would create a second (third) limit and check if an admin has left.

 

Here is my admin left script so far:

Code:

if(plugin.isInList(player.Name, "admins")){
	plugin.PRoConChat("ADMIN > " + player.Name + " is a Admin and has joined the server");
	}
then I would just add

plugin.Data.setBool("adminon", false);

 

The only issue I have is if multiple admins were on... I guess I could change that spawn script to check if an admin was on after every spawn, but would there be a way to check over the list of players to see if an admin was in that group before throwing the message admin has left?

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

Originally Posted by PapaCharlie9*:

 

I've tested this:-

 

Code:

if (Regex.Match(chatword, "^"+racism+"[s]_[!_]_[_!]_$", RegexOptions.IgnoreCase).Success)
Yeah, that's good. Technically, you could simplify ? to s_, the square brackets are for a list of characters. Also, if you want to match any number of ! or ? at the end, so you could catch for example paki!!!!!!!_!!_!_!!!, use * instead of _. * means zero or more matches, while ? means zero or one match.

 

So:

 

Code:

if (Regex.Match(chatword, "^"+racism+@"s_[!_]*$", RegexOptions.IgnoreCase).Success)
Finally, if you want to invert the list, meaning, match everything except for what's in the list, you add ^ to the front of the list. So [^a-z0-9]* will match everything that isn't a letter or digit. That would catch nigga$ or paki_________, etc., as well as nigger!!! and paki___!_.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by HexaCanon*:

 

Only thing I still need help with is trying to figure out if a admin is on and to send a different message if they are.

 

Here's my proposal.

 

I already have a limit checking if a player has spawned and if that player is an admin to send a different message to that player

 

So I would edit that spawn script (limited by activations) and do

plugin.Data.setBool("adminon", true);

 

Then I would create a second (third) limit and check if an admin has left.

 

Here is my admin left script so far:

Code:

if(plugin.isInList(player.Name, "admins")){
	plugin.PRoConChat("ADMIN > " + player.Name + " is a Admin and has joined the server");
	}
then I would just add

plugin.Data.setBool("adminon", false);

 

The only issue I have is if multiple admins were on... I guess I could change that spawn script to check if an admin was on after every spawn, but would there be a way to check over the list of players to see if an admin was in that group before throwing the message admin has left?

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

Originally Posted by Dudenell*:

 

onintervalplayer

Ok so onintervalplayer

Code:

if(plugin.isInList(player.Name, "admins")){
	plugin.Data.setBool("adminon", true);
	}
else {
	plugin.Data.setBool("adminon", false);
	}
wont work because it will return false if other players are on that are not admins. Would I still have to keep my admin leaving script? Because it has to return false at some point
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Ok so onintervalplayer

Code:

if(plugin.isInList(player.Name, "admins")){
	plugin.Data.setBool("adminon", true);
	}
else {
	plugin.Data.setBool("adminon", false);
	}
wont work because it will return false if other players are on that are not admins. Would I still have to keep my admin leaving script? Because it has to return false at some point
I think you can do this all in one limit. In fact, I think you can do it all in one line of code.

 

Take your original OnSpawn limit for your admins. Then, instead of plugin.Data.setBool, do:

 

Code:

player.Data.setBool("adminon", true);
The player object is automatically destroyed when the player leaves, so you don't need to track when the admin leaves. You could just set the flag on every spawn, but if you want to reduce the redundant sets, you can test first.

 

So the entire additional code is:

 

Code:

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

Originally Posted by Dudenell*:

 

I think you can do this all in one limit. In fact, I think you can do it all in one line of code.

 

Take your original OnSpawn limit for your admins. Then, instead of plugin.Data.setBool, do:

 

Code:

player.Data.setBool("adminon", true);
The player object is automatically destroyed when the player leaves, so you don't need to track when the admin leaves. You could just set the flag on every spawn, but if you want to reduce the redundant sets, you can test first.

 

So the entire additional code is:

 

Code:

if (!player.Data.issetBool("adminon")) player.Data.setBool("adminon", plugin.isInList(player.Name, "admins"));
Thing is this code is being sent to a second limit which is checking to see if a player said !admin

 

The second limit is onanychat

 

First check

Code:

List<String> info_words = new List<String>();
info_words.Add(@"!admin+(s_)_");

String[] chat_words = Regex.Split(player.LastChat, @"\s+");
foreach(String chat_word in chat_words)
	foreach(String info_word in info_words)
		if (Regex.Match(chat_word, "^"+info_word+"$", RegexOptions.IgnoreCase).Success)
			return true;
return false;
second check

Code:

string msg1 = " You have requeted an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin, so are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and JetStreak54";
string msg4 = " you have activated request admin too many times";
string msg5 = ", there is an admin on the server! Current admins are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and Jetstreak54";
int count = (int) limit.Activations(player.Name);

if (count ==  1) {
	if(plugin.isInList(player.Name, "admins")){
		plugin.ServerCommand("admin.yell", (player.Name + msg3));
		
	}
	else if (plugin.Data.getBool("adminon")){
	plugin.ServerCommand("admin.yell", (player.Name + msg5),"30", "player", player.Name);
	plugin.ServerCommand ( "admin.say" , (player.Name + msg5), "player" , player.Name );
	plugin.PRoConChat("ADMIN > " + player.Name + " Has requested an admin, with an admin on");
	}
	else{
		plugin.Tweet(plugin.R(player.Name + msg2 + player.LastChat));
		plugin.ServerCommand("admin.yell", (player.Name + msg1),"30", "player", player.Name);
		plugin.ServerCommand ( "admin.say" , (player.Name + msg1), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + " Has requested an admin" + count + " times with no admin on");
	}
}
else{
	if (plugin.Data.getBool("adminon")){
		plugin.ServerCommand("admin.yell", (player.Name + msg5),"30", "player", player.Name);
		plugin.ServerCommand ( "admin.say" , (player.Name + msg5), "player" , player.Name );
		server.RoundData.setBool(player.Name, true);
	}
	else{
		plugin.ServerCommand("admin.yell", (player.Name + msg4),"30", "player", player.Name);
		plugin.ServerCommand ( "admin.say" , (player.Name + msg4), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + " Has requested an admin" + count + " times with no admin on");
		server.RoundData.setBool(player.Name, true);
	}
}
which is why I need to know if it's true or false. It seems through testing that it's activating both the else if and the else (I thought it was only supposed to pick one_)
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Thing is this code is being sent to a second limit which is checking to see if a player said !admin

Yes, I know. Using player.Data automates listing all the current admins that are on. For example, instead of pre-canning all your admin names in msg5, you can do this instead:

 

Code:

String msg5 = ", there is an admin on the server! Current admins are ";

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
if (team3.players.Count > 0) all.AddRange(team3.players);
if (team4.players.Count > 0) all.AddRange(team4.players);

bool first = true;
bool isAnyAdminOn = false;
foreach (PlayerInfoInterface p in all) {

    if (p.Data.getBool("adminon")) {
         isAnyAdminOn = true;
         if (!first) {
            msg5 = msg5 + ", ";
         }
         msg5 = msg5 + p.Name;
         first = false;
    }
}
In the above, "p.Data" is the same as player.Data, but for each player rather than just the player that typed the chat. The flag isAnyAdminOn can then be used in the rest of your code to decide if there is any admin on or not.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Dudenell*:

 

Yes, I know. Using player.Data automates listing all the current admins that are on. For example, instead of pre-canning all your admin names in msg5, you can do this instead:

 

Code:

String msg5 = ", there is an admin on the server! Current admins are ";

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
if (team3.players.Count > 0) all.AddRange(team3.players);
if (team4.players.Count > 0) all.AddRange(team4.players);

bool first = true;
bool isAnyAdminOn = false;
foreach (PlayerInfoInterface p in all) {

    if (p.Data.getBool("adminon")) {
         isAnyAdminOn = true;
         if (!first) {
            msg5 = msg5 + ", ";
         }
         msg5 = msg5 + p.Name;
         first = false;
    }
}
In the above, "p.Data" is the same as player.Data, but for each player rather than just the player that typed the chat. The flag isAnyAdminOn can then be used in the rest of your code to decide if there is any admin on or not.
Thanks for the help so far, I just spent an hour trying to figure out why the message was being spammed twice (overwrote another limit by accident). So I'm adding this to my spawn check limit to see if a player is an admin or not or is this going straight into my second check for the admin (i'm assuming the second check for admin_).

 

 

If it does need to be in the second check on the admin limit then it is not picking up whether an admin is on or not (assuming I want to be checking this on every player spawning in, every time they do).

 

If so am I also keeping this line in the spawn check

Code:

if (!player.Data.issetBool("adminon")) player.Data.setBool("adminon", plugin.isInList(player.Name, "admins"));
and do I want that checking it on every spawn or just on the first activation for the round?

 

Here is my two full limits at this current time.

 

First up is the spawn checker limit. I use this to yell messages at players when they spawn, check to see if they are in specific groups and to yell different messages at them, and to check everyone coming into my server to see if they have our clan tags on but are NOT in the clan. The code can be cleaned, but it works.

 

and I added your addition

Code:

if (!player.Data.issetBool("adminon")) player.Data.setBool("adminon", plugin.isInList(player.Name, "admins"));
to the start

 

The evaluation is on spawn and the first check is set to an expression

(true)

Second check is code

Code:

if (!player.Data.issetBool("adminon")) player.Data.setBool("adminon", plugin.isInList(player.Name, "admins"));

if (limit.ActivationsTotal(player.Name) == 1 ){
	if(plugin.isInList(player.Name, "admins")){
		plugin.PRoConChat("ADMIN > " + player.Name + " is a Admin and has joined the server");
		plugin.ServerCommand("admin.yell", ("ATTENTION: " + player.FullName + " is an admin and has joined the server!"),"20");
	}
	else if(plugin.isInList(player.Name, "reserve")){
		plugin.ServerCommand("admin.yell", ("Welcome " + player.FullName + " Reserve slot, protection from !punish, and protection from autobalance active. Thanks for donating!"),"15", "player", player.Name);
		}
	else if (player.Tag == "RUF"){
		if(plugin.isInList(player.Name, "member_list")){
			plugin.PRoConChat("ADMIN > " + player.Name + " is a RUF member and has joined the server");
			plugin.ServerCommand("admin.yell", ("Welcome " + player.FullName + "!"),"15", "player", player.Name);
		}
		else{
			plugin.PRoConChat("ADMIN > " + player.Name + " IS NOT A RUF CLAN MEMBER AND HAS BEEN KICKED!");
			plugin.Tweet(plugin.R(player.Name + " was kicked for using RUF clan tags when not a clan member #kicked"));
			plugin.KickPlayerWithMessage(player.Name, plugin.R("RUF tags are for clan members only!, speak to Dudenell / Ice Man"));
		}
	}
	else {
		plugin.ServerCommand("admin.yell", ("Welcome " + player.FullName + " to [RUF] TDM! type !rules for rules"),"15", "player", player.Name);
	}	
}

if (limit.ActivationsTotal(player.Name) == 3 && player.Tag != "RUF" ){
	if(plugin.isInList(player.Name, "admins") || plugin.isInList(player.Name, "reserve")){
	}
	else{
		plugin.ServerCommand("admin.yell", ("!rank is now available! You can also check your stats at stats.rufclan.com. Join us on teamspeak at ts.rufclan.com:4208"),"15", "player", player.Name);
	}
}

if (limit.ActivationsTotal(player.Name) == 5 && player.Tag != "RUF" ){
	if(plugin.isInList(player.Name, "admins") || plugin.isInList(player.Name, "reserve")){
	}
	else{
		plugin.ServerCommand("admin.yell", ("Tired of waiting in Queue_ Lifetime VIP / Reserve slots are available for a $5 donation! Contact Dudenell on Battlelog"),"15", "player", player.Name);
	}
}

if (limit.ActivationsTotal(player.Name) == 7 && player.Tag != "RUF" ){
	if(plugin.isInList(player.Name, "admins") || plugin.isInList(player.Name, "reserve")){
	}
	else{
		plugin.ServerCommand("admin.yell", ("[RUF] Has an Armored Kill server up and running for the new release! Search for RUF in battlelog"),"15", "player", player.Name);
	}
}
return false;
Here is the full admin check that I currently have

 

Evaluation is onanychat

first check is code

Code:

List<String> info_words = new List<String>();
info_words.Add(@"!admin+(s_)_");

String[] chat_words = Regex.Split(player.LastChat, @"\s+");
foreach(String chat_word in chat_words)
	foreach(String info_word in info_words)
		if (Regex.Match(chat_word, "^"+info_word+"$", RegexOptions.IgnoreCase).Success)
			return true;
return false;
Second check is code

Code:

string msg1 = " You have requested an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin, so are Dudenell, Adnoble, Gameblaster1, Antunica, TheShiz22, and JetStreak54";
string msg4 = " you have activated request admin too many times";
string msg5 = ", there is an admin on the server! Current admins are ";

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
if (team3.players.Count > 0) all.AddRange(team3.players);
if (team4.players.Count > 0) all.AddRange(team4.players);
int count = (int) limit.Activations(player.Name);

bool first = true;
bool isAnyAdminOn = false;
foreach (PlayerInfoInterface p in all) {

    if (p.Data.getBool("adminon")) {
         isAnyAdminOn = true;
         if (!first) {
            msg5 = msg5 + ", ";
         }
         msg5 = msg5 + p.Name;
         first = false;
    }
	
}

if (count == 1) {
	if(plugin.isInList(player.Name, "admins")){
		plugin.ServerCommand("admin.yell", (player.Name + msg3));
		plugin.PRoConChat("ADMIN > " + player.Name + "is an admin and has typed !admin test 3");			
	}
	/*
	else if (plugin.Data.getBool("adminon")){
	plugin.ServerCommand("admin.yell", (player.Name + msg5),"30", "player", player.Name);
	plugin.ServerCommand ( "admin.say" , (player.Name + msg5), "player" , player.Name );
	plugin.PRoConChat("ADMIN > " + player.Name + " Has requested an admin, with an admin on");
	}*/
	else{
		plugin.Tweet(plugin.R(player.Name + msg2 + player.LastChat));
		plugin.ServerCommand("admin.yell", (player.Name + msg1),"30", "player", player.Name);
		plugin.ServerCommand ( "admin.say" , (player.Name + msg1), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + " Has requested an admin " + count + " times with no admin on. test1");
	}
}
else{/*
	if (plugin.Data.getBool("adminon")){
		plugin.ServerCommand("admin.yell", (player.Name + msg5),"30", "player", player.Name);
		plugin.ServerCommand ( "admin.say" , (player.Name + msg5), "player" , player.Name );
		server.RoundData.setBool(player.Name, true);
		plugin.PRoConChat("ADMIN > " + player.Name + "is an admin and has typed !admin");
	}
	else{*/
		plugin.ServerCommand("admin.yell", (player.Name + msg4),"30", "player", player.Name);
		plugin.ServerCommand ( "admin.say" , (player.Name + msg4), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + " Has requested an admin " + count + " times with no admin on. test 2");
		server.RoundData.setBool(player.Name, true);
	//}
}
What I'm also assuming is once I get it working I can use add on more statements after the first

 

if

 

So for example

 

Code:

if (p.Data.getBool("adminon")) {
         isAnyAdminOn = true;
         if (!first) {
            msg5 = msg5 + ", ";
         }
         msg5 = msg5 + p.Name;
         first = false;
    }
else if (count == 1) {

}
else if 

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

Originally Posted by MDV666*:

 

Hello, help to write correctly please a script on a ratio of useful effects of the player by time. I Made an example, but it doesn't work. What in it not so?

 

Code:

double assault = player.Revives;
         double assault_time = player.AssaultTime;
         double assault_percent = (assault / assault_time)*60.0, 2;
         
         if (assault_percent < 0.20)
         {
             plugin.ConsoleWrite(plugin.R("%p_n% has " + assault_percent + ));
             return true;
         }
         
         return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Here is my two full limits at this current time.

Some overall comments.

 

Back around R-26, some server update broke limit.ActivationsTotal, so all your code that uses that won't work right. That's probably why you are seeing messages twice. We haven't been able to figure out what broke yet, I don't have a fix. I do have a workaround, though. You can keep your own per-player count.

 

Your first limit is pretty good. It just needs a few tweaks.

 

Your second limit has some problems, particularly second_check. For first_check, I simplified it -- it does exactly the same thing, but with just one line of code.

 

For second_check:

* I missed that msg3 also has admin names hardcoded, so I fixed that to work like msg5

* I cleaned up the logic, replacing plugin.Data with isAnyAdminOn flags

 

I took the liberty of changing both of them. I don't have a compiler handy, so you'll have to check these for syntax errors.

 

OnSpawn limit

 

first_check

 

Code:

(true)
second_check

 

Code:

String kCounter = "playerSpawnCounter";

if (!player.Data.issetBool("adminon")) player.Data.setBool("adminon", plugin.isInList(player.Name, "admins"));

/* Workaround for problems with limit.ActivationsTotal */
if (!player.Data.issetInt(kCounter)) {
	player.Data.setInt(kCounter, 0);
}
int spawnCount = player.Data.getInt(kCounter);
spawnCount = spawnCount + 1;
player.Data.setInt(kCounter, spawnCount);

if (spawnCount == 1 ){
	if(plugin.isInList(player.Name, "admins")){
		plugin.PRoConChat("ADMIN > " + player.Name + " is a Admin and has joined the server");
		plugin.ServerCommand("admin.yell", ("ATTENTION: " + player.FullName + " is an admin and has joined the server!"),"20");
	}
	else if(plugin.isInList(player.Name, "reserve")){
		plugin.ServerCommand("admin.yell", ("Welcome " + player.FullName + " Reserve slot, protection from !punish, and protection from autobalance active. Thanks for donating!"),"15", "player", player.Name);
		}
	else if (player.Tag == "RUF"){
		if(plugin.isInList(player.Name, "member_list")){
			plugin.PRoConChat("ADMIN > " + player.Name + " is a RUF member and has joined the server");
			plugin.ServerCommand("admin.yell", ("Welcome " + player.FullName + "!"),"15", "player", player.Name);
		}
		else{
			plugin.PRoConChat("ADMIN > " + player.Name + " IS NOT A RUF CLAN MEMBER AND HAS BEEN KICKED!");
			plugin.Tweet(plugin.R(player.Name + " was kicked for using RUF clan tags when not a clan member #kicked"));
			plugin.KickPlayerWithMessage(player.Name, plugin.R("RUF tags are for clan members only!, speak to Dudenell / Ice Man"));
		}
	}
	else {
		plugin.ServerCommand("admin.yell", ("Welcome " + player.FullName + " to [RUF] TDM! type !rules for rules"),"15", "player", player.Name);
	}	
}

if (spawnCount == 3 && player.Tag != "RUF" ){
	if(plugin.isInList(player.Name, "admins") || plugin.isInList(player.Name, "reserve")){
	}
	else{
		plugin.ServerCommand("admin.yell", ("!rank is now available! You can also check your stats at stats.rufclan.com. Join us on teamspeak at ts.rufclan.com:4208"),"15", "player", player.Name);
	}
}

if (spawnCount == 5 && player.Tag != "RUF" ){
	if(plugin.isInList(player.Name, "admins") || plugin.isInList(player.Name, "reserve")){
	}
	else{
		plugin.ServerCommand("admin.yell", ("Tired of waiting in Queue_ Lifetime VIP / Reserve slots are available for a $5 donation! Contact Dudenell on Battlelog"),"15", "player", player.Name);
	}
}

if (spawnCount == 7 && player.Tag != "RUF" ){
	if(plugin.isInList(player.Name, "admins") || plugin.isInList(player.Name, "reserve")){
	}
	else{
		plugin.ServerCommand("admin.yell", ("[RUF] Has an Armored Kill server up and running for the new release! Search for RUF in battlelog"),"15", "player", player.Name);
	}
}
return false;
OnAnyChat limit

 

first_check

Code:

return(Regex.Match(player.LastChat, @"^\s*!admin", RegexOptions.IgnoreCase).Success);
second_check

Code:

string msg1 = ", you have requested an admin! This action has been logged!";
string msg2 = " requested an admin on the TDM server. Message: ";
string msg3 = " is an admin";
string msg4 = ", you have activated request admin too many times";
string msg5 = ", there is an admin on the server! Current admins are ";

List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
if (team3.players.Count > 0) all.AddRange(team3.players);
if (team4.players.Count > 0) all.AddRange(team4.players);

int count = (int) limit.Activations(player.Name);

bool first = true;
bool firstMsg3 = true;
bool isAnyAdminOn = false;
foreach (PlayerInfoInterface p in all) {

	if (p.Data.getBool("adminon")) {
		isAnyAdminOn = true;

		if (player.Name == p.Name) {
			msg3 = player.Name + msg3;
		} else {
			if (firstMsg3) {
				msg3 = msg3 + " and so is " + p.Name;
				firstMsg3 = false;
			} else {
				msg3 = msg3 + ", " + p.Name;
			}
		}
		if (!first) {
			msg5 = msg5 + ", ";
		}
		msg5 = msg5 + p.Name;
		first = false;
	}
}
bool playerIsAdmin = plugin.isInList(player.Name, "admins");

if (count == 1) {
	if (playerIsAdmin){
		plugin.ServerCommand("admin.yell", msg3);
		plugin.PRoConChat("ADMIN > " + msg3 + " !admin test 3");			
	} else if (isAnyAdminOn) {
		plugin.ServerCommand("admin.yell", (player.Name + msg5), "30", "player", player.Name);
		plugin.ServerCommand("admin.say" , (player.Name + msg5), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + ": Has requested an admin, with an admin on: " + msg3);
	} else {
		plugin.Tweet(player.Name + msg2 + player.LastChat);
		plugin.ServerCommand("admin.yell", (player.Name + msg1), "30", "player", player.Name);
		plugin.ServerCommand("admin.say" , (player.Name + msg1), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + ": Has requested an admin " + count + " times with no admin on. test1");
	}
} else {
	if (playerIsAdmin){
		plugin.ServerCommand("admin.yell", (player.Name + msg5), "30", "player", player.Name);
		plugin.ServerCommand("admin.say" , (player.Name + msg5), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + " is an admin and has typed !admin");
	} else if (isAnyAdminOn) {
		plugin.ServerCommand("admin.yell", (player.Name + msg4), "30", "player", player.Name);
		plugin.ServerCommand("admin.say" , (player.Name + msg4), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + ": Has requested an admin " + count + " times with admins on: " + msg3);
	} else {
		plugin.ServerCommand("admin.yell", (player.Name + msg4), "30", "player", player.Name);
		plugin.ServerCommand("admin.say" , (player.Name + msg4), "player" , player.Name );
		plugin.PRoConChat("ADMIN > " + player.Name + ": Has requested an admin " + count + " times with no admin on. test 2");
	}
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Hello, help to write correctly please a script on a ratio of useful effects of the player by time. I Made an example, but it doesn't work. What in it not so?

 

Code:

double assault = player.Revives;
         double assault_time = player.AssaultTime;
         double assault_percent = (assault / assault_time)*60.0, 2;
         
         if (assault_percent < 0.20)
         {
             plugin.ConsoleWrite(plugin.R("%p_n% has " + assault_percent + ));
             return true;
         }
         
         return false;
What ratio are you trying to calculate? Revives divided by Assault Time? Assault Time is in seconds, so are you trying to get revives per minute? That's not a ratio, that's a rate.

 

Code:

double reviveRate = (player.Revives / player.AssaultTime) * 60;

if (reviveRate < 0.20) { // less than 2 revives every 10 minutes of assault kit time
    plugin.ConsoleWrite(player.Name + " has " + reviveRate + " revives per minute of assault kit time.");
    return true;
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Znorsoica*:

 

Hi guys,

 

When I am searching for "no vehicles" I dont find the pluging for "no vehicles".

A lot of servers are using this pluging because they want play Infantry Only on the hardcore mode. When people are using any vehicles and they make a kill with it, they get an auto kill. (only they call it: auto death).

 

Who can PM me this plugin?

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

Originally Posted by HexaCanon*:

 

Hi,

looking for something like this:

 

If >1 equal Clantags are online -> proconchat (show me only one entry/line per round/hour/evening_)

 

Thx!

Regards, Rucki

what ? can you be more clear ?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Rucki*:

 

what ? can you be more clear ?

I will try. :ohmy:

 

If 2 ore more same Clantags are on the server, write in proconchat:

Example:

3 members from Clan [yxz] are online.

 

Maybe i will use this later as Globalmsg like:

Welcome [yxz]-Clan!

 

The msg should appear only once.

 

Thx!

Rucki

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

Originally Posted by HexaCanon*:

 

I will try. :ohmy:

 

If 2 ore more same Clantags are on the server, write in proconchat:

Example:

3 members from Clan [yxz] are online.

 

Maybe i will use this later as Globalmsg like:

Welcome [yxz]-Clan!

 

The msg should appear only once.

 

Thx!

Rucki

can do it. after this AK round :P

 

Edit : add me battlelog HexaCanon.

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

Originally Posted by PapaCharlie9*:

 

I will try. :ohmy:

 

If 2 ore more same Clantags are on the server, write in proconchat:

Example:

3 members from Clan [yxz] are online.

 

Maybe i will use this later as Globalmsg like:

Welcome [yxz]-Clan!

 

The msg should appear only once.

 

Thx!

Rucki

I'm pretty sure I wrote that limit for someone already. Did you search this thread? Search for player.Tag, that should find it.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Hi guys,

 

When I am searching for "no vehicles" I dont find the pluging for "no vehicles".

A lot of servers are using this pluging because they want play Infantry Only on the hardcore mode. When people are using any vehicles and they make a kill with it, they get an auto kill. (only they call it: auto death).

 

Who can PM me this plugin?

Here:

 

No vehicles, kill player if they kill with a vehicle*

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

Originally Posted by PapaCharlie9*:

 

is it possible to get a certain weapon stats for a player ?

 

such as shots fired , gun accuracy , headshots , kills.

You can get some information but not all of that, and not any per weapon. You can't get gun accuracy. You can get some total stats, but in some cases, only the Premium reset values, e.g., the value after a Premium member has done a reset.

 

Here's what you can get for the player object, e.g., player.ResetShotsFired:

 

Code:

/* Online statistics (battlelog.battlefield.com) */
        ...
        double Revives { get; }
        double Accuracy { get; }

        double KillAssists { get; }
        double ResetDeaths { get; }
        double ResetKills { get; }
        double ResetLosses { get; }
        double ResetWins { get; }
        double ResetScore { get; }
        double ResetShotsFired { get; }
        double ResetShotsHit { get; }
        double ResetTime { get; }
Note, if the player is not a Premium player or if they have not done a reset, the ResetXXX values will all be zero.

 

These are all totals for all weapons.

 

If you want to use those values, you need patch 4, which you get from here:

 

https://github.com/PapaCharlie9/insane-limits/downloads

 

Press the Download as Zip button.

 

Unzip and copy the InsaneLimits.cs file into your Plugins/BF3 folder, replacing the old one.

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