ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 Originally Posted by HexaCanon*: oh yeah i remembered limit activation should be in 2nd check * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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 addplugin.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
ImportBot Posted September 16, 2012 Author Share Posted September 16, 2012 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
ImportBot Posted September 17, 2012 Author Share Posted September 17, 2012 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 addplugin.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
ImportBot Posted September 17, 2012 Author Share Posted September 17, 2012 Originally Posted by Dudenell*: onintervalplayerOk so onintervalplayerCode: 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
ImportBot Posted September 18, 2012 Author Share Posted September 18, 2012 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 pointI 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
ImportBot Posted September 18, 2012 Author Share Posted September 18, 2012 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 checkCode: 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
ImportBot Posted September 18, 2012 Author Share Posted September 18, 2012 Originally Posted by PapaCharlie9*: Thing is this code is being sent to a second limit which is checking to see if a player said !adminYes, 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
ImportBot Posted September 19, 2012 Author Share Posted September 19, 2012 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 codeCode: 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
ImportBot Posted September 19, 2012 Author Share Posted September 19, 2012 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
ImportBot Posted September 20, 2012 Author Share Posted September 20, 2012 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_checkCode: 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
ImportBot Posted September 20, 2012 Author Share Posted September 20, 2012 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
ImportBot Posted September 20, 2012 Author Share Posted September 20, 2012 Originally Posted by MDV666*: thx for help! & delete this post * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted September 22, 2012 Author Share Posted September 22, 2012 Originally Posted by PapaCharlie9*: SQDM balancer request, see: http://www.phogue.net/forumvb/showth...ll=1#post59602* * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted September 22, 2012 Author Share Posted September 22, 2012 Originally Posted by HexaCanon*: is it possible to get a certain weapon stats for a player ? such as shots fired , gun accuracy , headshots , kills. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted September 23, 2012 Author Share Posted September 23, 2012 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
ImportBot Posted September 23, 2012 Author Share Posted September 23, 2012 Originally Posted by Rucki*: 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 * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted September 23, 2012 Author Share Posted September 23, 2012 Originally Posted by Dudenell*: Everything been working great Papa, no issues with the script since. I did have to rearrange some messages but it's a lot better than what I could have done. Thanks again! * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted September 23, 2012 Author Share Posted September 23, 2012 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
ImportBot Posted September 23, 2012 Author Share Posted September 23, 2012 Originally Posted by Rucki*: what ? can you be more clear ?I will try. 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
ImportBot Posted September 23, 2012 Author Share Posted September 23, 2012 Originally Posted by HexaCanon*: I will try. 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 Edit : add me battlelog HexaCanon. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted September 24, 2012 Author Share Posted September 24, 2012 Originally Posted by PapaCharlie9*: I will try. 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
ImportBot Posted September 24, 2012 Author Share Posted September 24, 2012 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
ImportBot Posted September 24, 2012 Author Share Posted September 24, 2012 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.