Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

Originally Posted by MRniceGuy*:

 

Players that leave and rejoin already get a randomly selected message.

 

 

Although the following is probably not the most efficient solution, it should do what you want (I added a few extra matches that may crop up, also, setting the value highlighted in red to true will cause these messages to be displayed to Admins):

 


Auto-Responder

 

Create a new limit to evaluate OnAnyChat. Set action to None.

 

Set first_check to this Code:

Code:

// Auto-Responder - Limit 1 of 1
// v1.0 - OnAnyChat - first_check
//

bool bShowToAdmin = [b]false[/b];

String[] sTriggers = { "HACK|CHEAT|CHEATER|HACKER|WALLHACK|AIMBOT|MULTIHACK",
                       "BALANCE|AUTOBALANCE|AUTO.BALANCE|AUTOBALANCE.TEAMS|BALANCE.TEAMS|EVEN.TEAMS|EVEN.THE.TEAMS|TEAM.STACKING",
                       "VIP|DONATION|DONATE",
                       "STACKED|SCRAMBLE|SCRAMBLE.TEAMS|SCRAMBLE.PLAYERS",
                       "REPORT|ADMINS|ADMIN",
                       "PROMOTION|PROMOTED",
                       "WEBSITE|FORUM|FORUMS",
                       "RECRUITING|RECRUITES",
                       "LAG|LAGGY|LAGGING",
                       "ANTICHEAT|ANTI.CHEAT",
                       "TEAMSPEAK|VOIP" };
String[] sResponses = { "/nWe strongly advice you to report suspects on our website or on their battlelog profile.",
                        "/nTeams are balanced automatically.",
                        "/nSupport us by donating or purchasing VIP slots.",
                        "/nTeams are scrambled every round based on player Score per Minute (SPM).",
                        "/nSorry an Admin can't respond right now.",
                        "/nCONGRATULATIONS ON YOUR NEW PROMOTION!",
                        "/nVisit our web page.",
                        "/nWe are recruiting new active members check us out.",
                        "/nThe server is NOT lagging out, check your Internet connection for network latency and packet loss.",
                        "/nThis server streams to PBBans, GGC and ACI for anti-cheat protection.",
                        "/nJoin us on Teamspeak if you want a chat or need an Admin." };
String sPatA = @"(_<=\W|^)(";
String sPatB = @")(_=\W|$)";
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;
int iMsg = -1;

if (!bShowToAdmin)
{
    if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
    {
        if (bKill && bKick && bBan && bMove & bLevel) return false;
    }
}

if (Regex.Match(player.LastChat, sPatA + sTriggers[0] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 0;
if (Regex.Match(player.LastChat, sPatA + sTriggers[1] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 1;
if (Regex.Match(player.LastChat, sPatA + sTriggers[2] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 2;
if (Regex.Match(player.LastChat, sPatA + sTriggers[3] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 3;
if (Regex.Match(player.LastChat, sPatA + sTriggers[4] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 4;
if (Regex.Match(player.LastChat, sPatA + sTriggers[5] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 5;
if (Regex.Match(player.LastChat, sPatA + sTriggers[6] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 6;
if (Regex.Match(player.LastChat, sPatA + sTriggers[7] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 7;
if (Regex.Match(player.LastChat, sPatA + sTriggers[8] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 8;
if (Regex.Match(player.LastChat, sPatA + sTriggers[9] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 9;
if (Regex.Match(player.LastChat, sPatA + sTriggers[10] + sPatB, RegexOptions.IgnoreCase).Success) iMsg = 10;
if (iMsg > -1) plugin.SendPlayerYell(player.Name, sResponses[iMsg], 8);

return false;

End of post.

Thank you so much for your help
* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 3.2k
  • Created
  • Last Reply

Originally Posted by God_Zilla*:

 

Insane Limits Requests:

 

Need a copy of the script analog "knife message" of ProkonRulz (BF3).

 

By killing the player with a knife he sent the %message%.

 

Code:

##################################################################################
# Knife message !knife in-game command
# Set your knife message with "!knife <message>"
# Victim will be given that message when you knife them
# View your message with "!knife_" or anyone's with "!knife_ <part player name>"
# You can check Configs/<server>_proconrulz.ini to see all saved messages
##################################################################################

On Say;Text !knife_
    TargetPlayer;Say %t% knife message = %ini_knife_message[%t%]%;End
    Say Your knife message = %ini_knife_message[%p%]%;End
    
On Say;Text !knife;log !knife;Set %ini_knife_message[%p%]% %targettext%;PlayerSay %p% your knife message is set

On Kill;Weapon Melee;If %ini_knife_message[%p%]% != 0
    VictimSay %p% say: %ini_knife_message[%p%]%
    PlayerSay You told %v%: %ini_knife_message[%p%]%
And if there is a minute of free time, please see my previous "Insane Limits Requests" (link*).
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by GR101*:

 

Players that leave and rejoin already get a randomly selected message.

 

 

Although the following is probably not the most efficient solution, it should do what you want (I added a few extra matches that may crop up, also, setting the value highlighted in red to true will cause these messages to be displayed to Admins):

 


Auto-Responder

 

Create a new limit to evaluate OnAnyChat. Set action to None.

 

Set first_check to this Code:

Code:

// Auto-Responder - Limit 1 of 1
// v2.0 - OnAnyChat - first_check
//

bool bShowToAdmin = [b]false[/b];

List<String> lTriggers = new List<String>();
List<String> lResponses = new List<String>();
// Add the trigger words
lTriggers.Add("HACK|CHEAT|CHEATER|HACKER|WALLHACK|AIMBOT|MULTIHACK");
lTriggers.Add("BALANCE|AUTOBALANCE|AUTO.BALANCE|AUTOBALANCE.TEAMS|BALANCE.TEAMS|EVEN.TEAMS|EVEN.THE.TEAMS|TEAM.STACKING");
lTriggers.Add("VIP|DONATION|DONATE");
lTriggers.Add("STACKED|SCRAMBLE|SCRAMBLE.TEAMS|SCRAMBLE.PLAYERS");
lTriggers.Add("REPORT|ADMINS|ADMIN");
lTriggers.Add("PROMOTION|PROMOTED|RANKED.UP");
lTriggers.Add("WEBSITE|FORUM|FORUMS");
lTriggers.Add("RECRUITING|RECRUITES|MEMBERS");
lTriggers.Add("LAG|LAGGY|LAGGING");
lTriggers.Add("ANTICHEAT|ANTI.CHEAT");
lTriggers.Add("TEAMSPEAK|VOIP|VOICE.COMMS");
// Add as many lTriggers.Add lines as you like, but there must be
// a corresponding lResponses.Add line for each lTriggers.Add line
lResponses.Add("/nWe strongly advice you to report suspects on\nour website or on their battlelog profile.");
lResponses.Add("/nTeams are balanced automatically.");
lResponses.Add("/nSupport us by donating or purchasing VIP slots.");
lResponses.Add("/nTeams are scrambled every round based on player Score per Minute (SPM).");
lResponses.Add("/nSorry an Admin can't respond right now.");
lResponses.Add("/nCONGRATULATIONS ON YOUR NEW PROMOTION!");
lResponses.Add("/nVisit our web page.");
lResponses.Add("/nWe are recruiting new active members check us out.");
lResponses.Add("/nThe server is NOT lagging out, check your Internet\nconnection for network latency and packet loss.");
lResponses.Add("/nThis server streams to PBBans, GGC and ACI\nfor anti-cheat protection.");
lResponses.Add("/nJoin us on Teamspeak if you want a chat or need an Admin.");
//
String sPatA = @"(_<=\W|^)(";
String sPatB = @")(_=\W|$)";
bool bComplete = false;
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;
int iCount = 0;

if (!bShowToAdmin)
{
    if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
    {
        if (bKill && bKick && bBan && bMove & bLevel) return false;
    }
}
while (!bComplete)
{
    if (Regex.Match(player.LastChat, sPatA + lTriggers[iCount] + sPatB, RegexOptions.IgnoreCase).Success)
    {
        plugin.SendPlayerYell(player.Name, lResponses[iCount], 8);
        bComplete = true;
    }
    else
    {
        iCount++;
        if (iCount > lTriggers.Count) bComplete = true;
    }
}

return false;

End of post.

Thanks LCARSx64, much appreciated.

 

Two things:-

 

1.) If I type a trigger word I don't get anything displayed on screen (I have full Procon access). If I enable “bShowToAdmin” then and only then, I see the message, but all admins do as well.

 

2.) Could you output the results to Procon chat via an on/off toggle. Example bShowToChat = true?

 

Once again, thank you for considering this.

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

Originally Posted by LCARSx64*:

 

Thanks LCARSx64, much appreciated.

 

Two things:-

 

1.) If I type a trigger word I don't get anything displayed on screen (I have full Procon access). If I enable "bShowToAdmin" then and only then, I see the message, but all admins do as well.

 

2.) Could you output the results to Procon chat via an on/off toggle. Example bShowToChat = true?

 

Once again, thank you for considering this.

1. That is exactly how that is suppose to work.

 

2. What do you want outputted to Procon chat? If you mean every time this is triggered, you do realize that is possibly going to spam Procon chat right?

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

Originally Posted by GR101*:

 

1. That is exactly how that is suppose to work.

I wasn't sure if that was the case, it's all good.

 

2. What do you want outputted to Procon chat? If you mean every time this is triggered, you do realize that is possibly going to spam Procon chat right?

Yes, every time trigger word is typed, out the response message with the player's name, but if you could make it so it can be turned off.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

I wasn't sure if that was the case, it's all good.

 

 

 

Yes, every time trigger word is typed, out the response message with the player's name, but if you could make it so it can be turned off.

Replace the Code with the following (change the value highlighted in red to true to enable Admin's to trigger theses messages, change the value highlighted in green to true to show the messages and who triggered it in Procon chat.):

 

Code:

// Auto-Responder - Limit 1 of 1
// v2.1 - OnAnyChat - first_check
//

bool bShowToAdmin = [b]false[/b];
bool bShowToChat = [b]false[/b];

List<String> lTriggers = new List<String>();
List<String> lResponses = new List<String>();
// Add the trigger words
lTriggers.Add("HACK|CHEAT|CHEATER|HACKER|WALLHACK|AIMBOT|MULTIHACK");
lTriggers.Add("BALANCE|AUTOBALANCE|AUTO.BALANCE|AUTOBALANCE.TEAMS|BALANCE.TEAMS|EVEN.TEAMS|EVEN.THE.TEAMS|TEAM.STACKING");
lTriggers.Add("VIP|DONATION|DONATE");
lTriggers.Add("STACKED|SCRAMBLE|SCRAMBLE.TEAMS|SCRAMBLE.PLAYERS");
lTriggers.Add("REPORT|ADMINS|ADMIN");
lTriggers.Add("PROMOTION|PROMOTED|RANKED.UP");
lTriggers.Add("WEBSITE|FORUM|FORUMS");
lTriggers.Add("RECRUITING|RECRUITES|MEMBERS");
lTriggers.Add("LAG|LAGGY|LAGGING");
lTriggers.Add("ANTICHEAT|ANTI.CHEAT");
lTriggers.Add("TEAMSPEAK|VOIP|VOICE.COMMS");
// Add as many lTriggers.Add lines as you like, but there must be
// a corresponding lResponses.Add line for each lTriggers.Add line
lResponses.Add("We strongly advice you to report suspects on\nour website or on their battlelog profile.");
lResponses.Add("Teams are balanced automatically.");
lResponses.Add("Support us by donating or purchasing VIP slots.");
lResponses.Add("Teams are scrambled every round based on player Score per Minute (SPM).");
lResponses.Add("Sorry an Admin can't respond right now.");
lResponses.Add("CONGRATULATIONS ON YOUR NEW PROMOTION!");
lResponses.Add("Visit our web page.");
lResponses.Add("We are recruiting new active members check us out.");
lResponses.Add("The server is NOT lagging out, check your Internet\nconnection for network latency and packet loss.");
lResponses.Add("This server streams to PBBans, GGC and ACI\nfor anti-cheat protection.");
lResponses.Add("Join us on Teamspeak if you want a chat or need an Admin.");
//
String sPatA = @"(_<=\W|^)(";
String sPatB = @")(_=\W|$)";
bool bComplete = false;
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;
int iCount = 0;

if (!bShowToAdmin)
{
    if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
    {
        if (bKill && bKick && bBan && bMove & bLevel) return false;
    }
}
while (!bComplete)
{
    if (Regex.Match(player.LastChat, sPatA + lTriggers[iCount] + sPatB, RegexOptions.IgnoreCase).Success)
    {
        plugin.SendPlayerYell(player.Name, "\n" + lResponses[iCount], 8);
        if (bShowToChat) plugin.PRoConChat("^b^1Auto-Responder^0^n: " + lResponses[iCount].Replace("\n", " ") + " - was sent to " + player.FullName);
        bComplete = true;
    }
    else
    {
        iCount++;
        if (iCount > lTriggers.Count) bComplete = true;
    }
}

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

Originally Posted by GR101*:

 

Replace the Code with the following (change the value highlighted in red to true to enable Admin's to trigger theses messages, change the value highlighted in green to true to show the messages and who triggered it in Procon chat.):

 

Code:

// Auto-Responder - Limit 1 of 1
// v2.1 - OnAnyChat - first_check
//

bool bShowToAdmin = [b]false[/b];
bool bShowToChat = [b]false[/b];

List<String> lTriggers = new List<String>();
List<String> lResponses = new List<String>();
// Add the trigger words
lTriggers.Add("HACK|CHEAT|CHEATER|HACKER|WALLHACK|AIMBOT|MULTIHACK");
lTriggers.Add("BALANCE|AUTOBALANCE|AUTO.BALANCE|AUTOBALANCE.TEAMS|BALANCE.TEAMS|EVEN.TEAMS|EVEN.THE.TEAMS|TEAM.STACKING");
lTriggers.Add("VIP|DONATION|DONATE");
lTriggers.Add("STACKED|SCRAMBLE|SCRAMBLE.TEAMS|SCRAMBLE.PLAYERS");
lTriggers.Add("REPORT|ADMINS|ADMIN");
lTriggers.Add("PROMOTION|PROMOTED|RANKED.UP");
lTriggers.Add("WEBSITE|FORUM|FORUMS");
lTriggers.Add("RECRUITING|RECRUITES|MEMBERS");
lTriggers.Add("LAG|LAGGY|LAGGING");
lTriggers.Add("ANTICHEAT|ANTI.CHEAT");
lTriggers.Add("TEAMSPEAK|VOIP|VOICE.COMMS");
// Add as many lTriggers.Add lines as you like, but there must be
// a corresponding lResponses.Add line for each lTriggers.Add line
lResponses.Add("We strongly advice you to report suspects on\nour website or on their battlelog profile.");
lResponses.Add("Teams are balanced automatically.");
lResponses.Add("Support us by donating or purchasing VIP slots.");
lResponses.Add("Teams are scrambled every round based on player Score per Minute (SPM).");
lResponses.Add("Sorry an Admin can't respond right now.");
lResponses.Add("CONGRATULATIONS ON YOUR NEW PROMOTION!");
lResponses.Add("Visit our web page.");
lResponses.Add("We are recruiting new active members check us out.");
lResponses.Add("The server is NOT lagging out, check your Internet\nconnection for network latency and packet loss.");
lResponses.Add("This server streams to PBBans, GGC and ACI\nfor anti-cheat protection.");
lResponses.Add("Join us on Teamspeak if you want a chat or need an Admin.");
//
String sPatA = @"(_<=\W|^)(";
String sPatB = @")(_=\W|$)";
bool bComplete = false;
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;
int iCount = 0;

if (!bShowToAdmin)
{
    if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
    {
        if (bKill && bKick && bBan && bMove & bLevel) return false;
    }
}
while (!bComplete)
{
    if (Regex.Match(player.LastChat, sPatA + lTriggers[iCount] + sPatB, RegexOptions.IgnoreCase).Success)
    {
        plugin.SendPlayerYell(player.Name, "\n" + lResponses[iCount], 8);
        if (bShowToChat) plugin.PRoConChat("^b^1Auto-Responder^0^n: " + lResponses[iCount].Replace("\n", " ") + " - was sent to " + player.FullName);
        bComplete = true;
    }
    else
    {
        iCount++;
        if (iCount > lTriggers.Count) bComplete = true;
    }
}

return false;
Spot on LCARSx64, thanks very much.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

I thought there was a limit (couple years old now) for "insulting" other players - I can't find it. Anybody remember it or can you point me to it?

 

Something like "!insult playername" and it would post it chat some sort of insult

Yeah, I remember that too, though I think it was !taunt player. Maybe it was Insane Punisher? It has a way to either forgive or !insult or !slap someone who TKs you.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Tales*:

 

Hi PapaCharlie9 sorry for posting in the wrong forum twice (still a noob here :smile:)

 

Can you tell me if is it possible to create this limit for BF4?

 

Limit 20 vehicle kills by a player on the same vehicle.

 

Example player gets 10 MAA kills gets a warning saying "you have 10 kills with the LAV of a limit of 20"

 

Player get 20 kills with the LAV gets a warning "You reached the limit of 20 kills on the LAV go do something else or get autokilled" and from now on every kill that he does with a LAV he gets auto killed.

 

This will happen on all vehicles , to stop someone of using the same vehicle during the all round.

 

You could get 20 kills with the lav , 20 kills with a tank etc....

 

Thanks in advance for any help

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

Originally Posted by GR101*:

 

Code:

List<String> bad_words = new List<String>();

	bad_words.Add("word1");
	bad_words.Add("word2");
	bad_words.Add("word3");
	bad_words.Add("word4");
	
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	
	foreach(String chat_word in chat_words)
	    foreach(String bad_word in bad_words)

		    if (Regex.Match(chat_word, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)


			{
                            plugin.ConsoleWarn(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

                            plugin.SendGlobalMessage(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.PRoConChat("[Insane Limits] > " + plugin.R("%p_fn%  AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, player.Name, 24*60, plugin.R("%p_fn% AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% - %p_n% - BANNED FOR SAYING [" + player.LastChat + "]"));						
						
			}	
			
	return false;
Got a problem with this code taken from this thread somewhere, I can't get the code to perform a lookup against multiple words (38 words) and act accordingly.

 

I know more advanced plugins are available and do the same job, but all I am after is a simple limit that's easy to manage and update.

 

I have tried the following and it doesn't work:

 

bad_words.Add("word1");

bad_words.Add("word2");

V

bad_words.Add("word38");

 

bad_words.Add("word1| word2| > word38");

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

Originally Posted by moacco07*:

 

Good day,

 

May i ask something. I have ban a player out from the server but somehow he still able to return in spectator mode.

Is there any existing script that can recognize list of ban players to restrict them from coming into spectator mode after being tban and pban?

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

Originally Posted by swats73*:

 

hi all

 

Just a question about the code below. I want the below code to display the top 3 clan tags and score in order not just the top scoring clan tags and score as is. any help is much appreciated.

 

Code:

List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
    players.AddRange(team1.players);
    players.AddRange(team2.players);
    Dictionary<String, double> clan_stats = new Dictionary<String, double>();
    
    /* Collect clan statistics */
    foreach(PlayerInfoInterface player_info in players)
    {
        if(player_info.Tag.Length == 0)
            continue;
        
        if (!clan_stats.ContainsKey(player_info.Tag))
            clan_stats.Add(player_info.Tag, 0);
        
        clan_stats[player_info.Tag] += player_info.ScoreRound;
    }

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
{
		String message = "Top scoring clan so far this round is "+ best_clan + " with " + best_score + " points!";
                plugin.SendGlobalMessage(message); 
		plugin.ConsoleWrite(message);
        }   
    return false;
Thanx in advance
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Gazovik83*:

 

I have a question.I am trying to find information about how to implement a ban on the use of infrared sights (FLIR or IRNV). I looked through a lot of pages, but could not see what I need. I was on the , so when there reborn kills you, if I use an infrared sight (FLIR or IRNV) on the sniper rifle or DMR.

 

Is there any possibility to implement this kind of limitation here? Thanks for the help

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

Originally Posted by moacco07*:

 

I have a question.I am trying to find information about how to implement a ban on the use of infrared sights (FLIR or IRNV). I looked through a lot of pages, but could not see what I need. I was on the , so when there reborn kills you, if I use an infrared sight (FLIR or IRNV) on the sniper rifle or DMR.

 

Is there any possibility to implement this kind of limitation here? Thanks for the help

This is the only answer to your inquiry.

 

myrcon.net/.../on-spawn-loadout-enforcer-for-infantryvehicles-adkatslrt

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

Originally Posted by swats73*:

 

hi all

 

Just a question about the code below. I want the below code to display the top 3 clan tags and score in order not just the top scoring clan tags and score as is. any help is much appreciated.

 

Code:

List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
    players.AddRange(team1.players);
    players.AddRange(team2.players);
    Dictionary<String, double> clan_stats = new Dictionary<String, double>();
    
    /* Collect clan statistics */
    foreach(PlayerInfoInterface player_info in players)
    {
        if(player_info.Tag.Length == 0)
            continue;
        
        if (!clan_stats.ContainsKey(player_info.Tag))
            clan_stats.Add(player_info.Tag, 0);
        
        clan_stats[player_info.Tag] += player_info.ScoreRound;
    }

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
{
		String message = "Top scoring clan so far this round is "+ best_clan + " with " + best_score + " points!";
                plugin.SendGlobalMessage(message); 
		plugin.ConsoleWrite(message);
        }   
    return false;
Thanx in advance
how would I add the extra info I want announced in server chat? i.e. chat would look like "Top Scoring Clan This Round so far is 1st (tag)(score for that clan) 2nd (tag)(score for that clan) 3rd (tag)(score for that clan). Score for the clans would be total no matter what side they are playing on.

 

Hope this makes more sence as in what I am after as I have no idea what I am looking at code wise (seeing as only code I ever wrote before was for a ZX81 back in the day)

 

thanx

 

swats

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

Originally Posted by Smellblood95*:

 

Hello,

 

I have been playing around with the Simple Welcome message in combination with the Admin Welcome Message. Maybe this has already been asked before, but I am not prepared to scroll through 266 pages of comments :smile:

 

So I have got 6 different welcome messages, 5 for admins, mods etc and 1 for normal players. I also have 5 lists that are connected to each admin welcome message limit. Yet I stumbled on a problem. When, for example, an admin spawns then it will show the admin welcome message and the normal player welcome message.

 

I am not experienced with C# at all and I was told that I could find help here for this. So how can I exclude the admins, mods etc from the normal players joining so that the admins, mods etc only get the admin welcome message and not the normal player welcome message as well?

 

I hope someone can help me on this,

 

Smellblood95

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

Originally Posted by LCARSx64*:

 

Code:

List<String> bad_words = new List<String>();

	bad_words.Add("word1");
	bad_words.Add("word2");
	bad_words.Add("word3");
	bad_words.Add("word4");
	
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	
	foreach(String chat_word in chat_words)
	    foreach(String bad_word in bad_words)

		    if (Regex.Match(chat_word, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)


			{
                            plugin.ConsoleWarn(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

                            plugin.SendGlobalMessage(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.PRoConChat("[Insane Limits] > " + plugin.R("%p_fn%  AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, player.Name, 24*60, plugin.R("%p_fn% AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% - %p_n% - BANNED FOR SAYING [" + player.LastChat + "]"));						
						
			}	
			
	return false;
Got a problem with this code taken from this thread somewhere, I can't get the code to perform a lookup against multiple words (38 words) and act accordingly.

 

I know more advanced plugins are available and do the same job, but all I am after is a simple limit that's easy to manage and update.

 

I have tried the following and it doesn't work:

 

bad_words.Add("word1");

bad_words.Add("word2");

V

bad_words.Add("word38");

 

bad_words.Add("word1| word2| > word38");

I'm not exactly sure what you're asking here but if you mean adding more words, then you simply add more bad_words.Add("new_word"); lines. bad_words.Add("word1| word2| > word38"); is incorrect, e.g. if you had 10 words that you wanted to check for:

Code:

List<String> bad_words = new List<String>();

	bad_words.Add("word1");
	bad_words.Add("word2");
	bad_words.Add("word3");
	bad_words.Add("word4");
	bad_words.Add("word5");
	bad_words.Add("word6");
	bad_words.Add("word7");
	bad_words.Add("word8");
	bad_words.Add("word9");
	bad_words.Add("word10");
	
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	
	foreach(String chat_word in chat_words)
	    foreach(String bad_word in bad_words)

		    if (Regex.Match(chat_word, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)


			{
                            plugin.ConsoleWarn(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

                            plugin.SendGlobalMessage(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.PRoConChat("[Insane Limits] > " + plugin.R("%p_fn%  AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, player.Name, 24*60, plugin.R("%p_fn% AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% - %p_n% - BANNED FOR SAYING [" + player.LastChat + "]"));						
						
			}	
			
	return false;

Hello,

 

I have been playing around with the Simple Welcome message in combination with the Admin Welcome Message. Maybe this has already been asked before, but I am not prepared to scroll through 266 pages of comments :smile:

 

So I have got 6 different welcome messages, 5 for admins, mods etc and 1 for normal players. I also have 5 lists that are connected to each admin welcome message limit. Yet I stumbled on a problem. When, for example, an admin spawns then it will show the admin welcome message and the normal player welcome message.

 

I am not experienced with C# at all and I was told that I could find help here for this. So how can I exclude the admins, mods etc from the normal players joining so that the admins, mods etc only get the admin welcome message and not the normal player welcome message as well?

 

I hope someone can help me on this,

 

Smellblood95

Are you referring to ...* and ...* limits?

If so then you can change the Simple Welcome limit's first_check Expression to:

Code:

(!plugin.isInList(player.Name, "admin_list"))
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by GR101*:

 

I'm not exactly sure what you're asking here but if you mean adding more words, then you simply add more bad_words.Add("new_word"); lines. bad_words.Add("word1| word2| > word38"); is incorrect, e.g. if you had 10 words that you wanted to check for:

Code:

List<String> bad_words = new List<String>();

	bad_words.Add("word1");
	bad_words.Add("word2");
	bad_words.Add("word3");
	bad_words.Add("word4");
	bad_words.Add("word5");
	bad_words.Add("word6");
	bad_words.Add("word7");
	bad_words.Add("word8");
	bad_words.Add("word9");
	bad_words.Add("word10");
	
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	
	foreach(String chat_word in chat_words)
	    foreach(String bad_word in bad_words)

		    if (Regex.Match(chat_word, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)


			{
                            plugin.ConsoleWarn(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

                            plugin.SendGlobalMessage(plugin.R("%p_n% - AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.PRoConChat("[Insane Limits] > " + plugin.R("%p_fn%  AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, player.Name, 24*60, plugin.R("%p_fn% AUTO BANNED FOR RACIST LANGUAGE!"));

			    plugin.Log("Logs/InsaneLimits_BWD.log", plugin.R("%date% %time% - %p_n% - BANNED FOR SAYING [" + player.LastChat + "]"));						
						
			}	
			
	return false;
Thanks LCARSx64 for responding.

 

In your example above, the script only performs a lookup against ‘bad_words.Add("word1");’ and it appears to ignore the remaining bad words ‘bad_words.Add("word2");’ to ‘bad_words.Add("word10");.

 

I have tested this again and again with the same end result, bad word "word1” works, whereas, bad words "word2” to "word10” doesn’t.

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

Originally Posted by LCARSx64*:

 

Thanks LCARSx64 for responding.

 

In your example above, the script only performs a lookup against 'bad_words.Add("word1");' and it appears to ignore the remaining bad words 'bad_words.Add("word2");' to 'bad_words.Add("word10");.

 

I have tested this again and again with the same end result, bad word "word1" works, whereas, bad words "word2" to "word10" doesn't.

Ok, try this ...

 

Add as many lBadWords.Add lines as you like, you can even add matches for things such as dog lover by replacing the space with a . (dot), e.g. lBadWords.Add("dog.lover");

 

The values highlighted in red can be either true or false, and they are as follows:

 

bAdminsCanTrigger - if this is set to true then Admins can trigger the matches (NOTE: they will be temp banned if they do trigger a match).

 

bShowToChat - if this is set to true then the ban will be announced in in-game chat.

 

bLogToProcon - if this is set to true then the ban will be announced in both the Procon chat tab and plugin console.

 

bLogToFile - if this is set to true then the ban will be logged to the file Logs/InsaneLimits_BWD.log


Auto-Ban Racists

 

Create a new limit to evaluate OnAnyChat. Set action to None.

 

Set first_check to this Code:

Code:

// Auto-Ban Racists - Limit 1 of 1
// v1.0 - OnAnyChat - first_check
//

bool bAdminsCanTrigger = false;
bool bShowToChat = true;
bool bLogToProcon = true;
bool bLogToFile = true;

List<String> lBadWords = new List<String>();
lBadWords.Add("word1");
lBadWords.Add("word2");
lBadWords.Add("word3");
lBadWords.Add("word4");
lBadWords.Add("word5");
lBadWords.Add("word6");
lBadWords.Add("word7");
lBadWords.Add("word8");
lBadWords.Add("word9");
lBadWords.Add("word10");
// Add as many lBadWords.Add lines as you like.
//
String[] sErrs = { "^b^1Auto-Ban Racists^0^n: ",
                   "AUTO BANNED FOR RACIST LANGUAGE!",
                   " - BANNED FOR SAYING [ ",
                   "" };
Match mMatch = null;
bool bComplete = false;
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;

if (!bAdminsCanTrigger)
{
    if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
    {
        if (bKill && bKick && bBan && bMove & bLevel) return false;
    }
}
if (lBadWords.Count > 0)
{
    foreach (String sBadWord in lBadWords)
    {
        mMatch = Regex.Match(player.LastChat, @"(_<=\W|^)(" + sBadWord + @")(_=\W|$)", RegexOptions.IgnoreCase);
        if (mMatch.Success)
        {
            sErrs[0] = sErrs[0] + plugin.R("%p_fn% - ") + sErrs[1];
            sErrs[2] = plugin.R("%date% %time% - %p_fn%") + sErrs[2] + mMatch.Value + " ]";
            sErrs[3] = plugin.R("%p_fn%  ") + sErrs[1];
            plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, player.Name, 24*60, sErrs[1]);
            if (bShowToChat) plugin.SendGlobalMessage(sErrs[3]);
            if (bLogToProcon)
            {
                plugin.ConsoleWrite(sErrs[0]);
                plugin.PRoConChat(sErrs[0]);
            }
            if (bLogToFile) plugin.Log("Logs/InsaneLimits_BWD.log", sErrs[2]);
            return false;
        }
    }
}

return false;

End of post.

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

Originally Posted by Smellblood95*:

 

Thanks for your reaction. Yes I do refer to both of these samples. I have set it to Code instead of Expression, yet on pasting

(!plugin.isInList(player.Name, "admin_list"))

in the First_check box, it gives me the following error:

[insane Limits] ERROR: 1 error compiling Code

[insane Limits] ERROR: (CS1002, line: 27, column: 63): ; expected

Can you help me further on this?

Thanks in advance

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

Originally Posted by LCARSx64*:

 

Thanks for your reaction. Yes I do refer to both of these samples. I have set it to Code instead of Expression, yet on pasting in the First_check box, it gives me the following error:

 

 

Can you help me further on this?

Thanks in advance

It's suppose to be Expression, not Code. :ohmy:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Smellblood95*:

 

It's suppose to be Expression, not Code.

Okay thanks, that helped. And now my last request on this subject: How can I add multiple of these lists as exclusion, like the following:

(!plugin.isInList(player.Name, "admin_list"))

(!plugin.isInList(player.Name, "moderator_list"))

(!plugin.isInList(player.Name, "moderator1_list"))

I hope someone has a solution for this as well :ohmy:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Okay thanks, that helped. And now my last request on this subject: How can I add multiple of these lists as exclusion, like the following:

 

 

I hope someone has a solution for this as well :ohmy:

Like this:

Code:

(!plugin.isInList(player.Name, "admin_list") && !plugin.isInList(player.Name, "moderator_list") && !plugin.isInList(player.Name, "moderator1_list"))
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by GR101*:

 

Ok, try this ...

 

Add as many lBadWords.Add lines as you like, you can even add matches for things such as dog lover by replacing the space with a . (dot), e.g. lBadWords.Add("dog.lover");

 

The values highlighted in red can be either true or false, and they are as follows:

 

bAdminsCanTrigger - if this is set to true then Admins can trigger the matches (NOTE: they will be temp banned if they do trigger a match).

 

bShowToChat - if this is set to true then the ban will be announced in in-game chat.

 

bLogToProcon - if this is set to true then the ban will be announced in both the Procon chat tab and plugin console.

 

bLogToFile - if this is set to true then the ban will be logged to the file Logs/InsaneLimits_BWD.log


Auto-Ban Racists

 

Create a new limit to evaluate OnAnyChat. Set action to None.

 

Set first_check to this Code:

Code:

// Auto-Ban Racists - Limit 1 of 1
// v1.0 - OnAnyChat - first_check
//

bool bAdminsCanTrigger = false;
bool bShowToChat = true;
bool bLogToProcon = true;
bool bLogToFile = true;

List<String> lBadWords = new List<String>();
lBadWords.Add("word1");
lBadWords.Add("word2");
lBadWords.Add("word3");
lBadWords.Add("word4");
lBadWords.Add("word5");
lBadWords.Add("word6");
lBadWords.Add("word7");
lBadWords.Add("word8");
lBadWords.Add("word9");
lBadWords.Add("word10");
// Add as many lBadWords.Add lines as you like.
//
String[] sErrs = { "^b^1Auto-Ban Racists^0^n: ",
                   "AUTO BANNED FOR RACIST LANGUAGE!",
                   " - BANNED FOR SAYING [ ",
                   "" };
Match mMatch = null;
bool bComplete = false;
bool bKill = false;
bool bKick = false;
bool bBan = false;
bool bMove = false;
bool bLevel = false;

if (!bAdminsCanTrigger)
{
    if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel))
    {
        if (bKill && bKick && bBan && bMove & bLevel) return false;
    }
}
if (lBadWords.Count > 0)
{
    foreach (String sBadWord in lBadWords)
    {
        mMatch = Regex.Match(player.LastChat, @"(_<=\W|^)(" + sBadWord + @")(_=\W|$)", RegexOptions.IgnoreCase);
        if (mMatch.Success)
        {
            sErrs[0] = sErrs[0] + plugin.R("%p_fn% - ") + sErrs[1];
            sErrs[2] = plugin.R("%date% %time% - %p_fn%") + sErrs[2] + mMatch.Value + " ]";
            sErrs[3] = plugin.R("%p_fn%  ") + sErrs[1];
            plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, player.Name, 24*60, sErrs[1]);
            if (bShowToChat) plugin.SendGlobalMessage(sErrs[3]);
            if (bLogToProcon)
            {
                plugin.ConsoleWrite(sErrs[0]);
                plugin.PRoConChat(sErrs[0]);
            }
            if (bLogToFile) plugin.Log("Logs/InsaneLimits_BWD.log", sErrs[2]);
            return false;
        }
    }
}

return false;

End of post.

Thanks LCARSx64, I really appreciate your help regarding this.

 

Testing your bad word list works fine, however my list has some problems especially where letters are substituted with characters ("!", "$", "*") or numbers (i =1 or ! etc…). It doesn't appear to pick them up.

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

Originally Posted by swats73*:

 

hi all

 

Just a question about the code below. I want the below code to display the top 3 clan tags and score in order not just the top scoring clan tags and score as is. any help is much appreciated.

 

 

Code:

Code:
List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
    players.AddRange(team1.players);
    players.AddRange(team2.players);
    Dictionary<String, double> clan_stats = new Dictionary<String, double>();
    
    /* Collect clan statistics */
    foreach(PlayerInfoInterface player_info in players)
    {
        if(player_info.Tag.Length == 0)
            continue;
        
        if (!clan_stats.ContainsKey(player_info.Tag))
            clan_stats.Add(player_info.Tag, 0);
        
        clan_stats[player_info.Tag] += player_info.ScoreRound;
    }

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
{
		String message = "Top scoring clan so far this round is "+ best_clan + " with " + best_score + " points!";
                plugin.SendGlobalMessage(message); 
		plugin.ConsoleWrite(message);
        }   
    return false;
Thanx in advancehow would I add the extra info I want announced in server chat? i.e. chat would look like "Top Scoring Clan This Round so far is 1st (tag)(score for that clan) 2nd (tag)(score for that clan) 3rd (tag)(score for that clan). Score for the clans would be total no matter what side they are playing on.

 

Hope this makes more sence as in what I am after as I have no idea what I am looking at code wise (seeing as only code I ever wrote before was for a ZX81 back in the day)

 

thanx

 

swats

is there no way I can make this happen?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Rucki*:

 

Hi,

all my limits are working fine for Hardline.

But today i tried ( player.Rank > x ), and it seems the player-rank is reading from BF4-Stats, and not from BFHL-Stats.

Did i anything wrong?

Thx!

Rucki

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

Originally Posted by Smellblood95*:

 

Hello,

I have a limit that has the purpose of displaying a message on leave for a player, like the one described in the Simple Welcome Message and Admin Welcome Messages samples. Yet I want the audience of this message to be directed at a certain list of players (admins). Now i only have the option of: All, Team, Squad, Player.

Can somebody help me on this?

 

thx in andvance!

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

Originally Posted by LCARSx64*:

 

Thanks LCARSx64, I really appreciate your help regarding this.

 

Testing your bad word list works fine, however my list has some problems especially where letters are substituted with characters ("!", "$", "*") or numbers (i =1 or ! etc…). It doesn't appear to pick them up.

If you want to match words like that, just enclose the possible characters in [] (braces), e.g:

You want to match: HELLO, H3LLO, HELL0, H3LL0, HEL!O, HE!!O, H3L!O, HEL!0, HE!L0, HE!!0, H3L!0, H3!L0, H3!!0 then you'd add the word like this:

Code:

lBadWords.Add("h[e3][l!][l!][o0]");
Also, I forgot to mention, the matches are case insensitive, so HELLO, hello and HeLlO will all match.

 

 

is there no way I can make this happen?

I just wanted to let you know that we aren't ignoring you. Both Papa and myself are busy IRL so it's just a matter of time before one of us gets to it. :ohmy:

 

 

Hello,

I have a limit that has the purpose of displaying a message on leave for a player, like the one described in the Simple Welcome Message and Admin Welcome Messages samples. Yet I want the audience of this message to be directed at a certain list of players (admins). Now i only have the option of: All, Team, Squad, Player.

Can somebody help me on this?

 

thx in andvance!

Change your OnLeave limit as follows (changing the red highlighted text to the message you want Admins to see):

 

Set the limit to evaluate OnLeave. Set action to None.

 

Set first_check to this Code:

Code:

String sMsg = "MESSAGE TO SEND TO ADMINS";

List<PlayerInfoInterface> allPlayers = new List<PlayerInfoInterface>();
allPlayers.AddRange(team1.players);
allPlayers.AddRange(team2.players);

foreach (PlayerInfoInterface p in allPlayers)
{
    if (plugin.isInList(p.Name, "admin_list"))
    {
        plugin.SendPlayerMessage(p.Name, sMsg);
    }
}

return false;
Set second_check to Disabled.

 

If you want the message to be something like PlayerName has left the server!, change the line with the red highlighting to:

Code:

String sMsg = plugin.R("%p_fn% has left the server!");
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Gazovik83*:

 

I ask for help in the realization of the desired functionality.

 

The idea: We want to realize the opportunity for our VIP players know how many days they have left the VIP. VIP player makes a request for a command in a chat, and he answered the first day of VIP status and the rest of his days.

 

what do you need? :

1. Request command, for example: !vipleft

2. Correct answer that there had been no confusion.

3. If the command call is not a VIP player, he answered an offer to purchase

 

I hope everything is clear painted))) I hope for your help!

 

sorry for my eng))

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




×
×
  • 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.