Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

Originally Posted by Smellblood95*:

 

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 allPlayers = new List();

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!");

Thanks for helping me out here. I do stumble upon the following problem. I have numerous of lists in the first_check (expression) that excludes this limit for saying that these persons have left the server, it goes as follows:

(!plugin.isInList(player.Name, "Head-admin_list") && !plugin.isInList(player.Name, "Admin_list") && !plugin.isInList(player.Name, "Moderator_list") && !plugin.isInList(player.Name, "Lieutenant_list") && !plugin.isInList(player.Name, "Member_list"))

 

These people are excluded since I want a personal admin message for these players to all audience.

Is there anyway I can integrate these lists that were in expression, to the code you have offered me?

 

Thanks for the 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 Smellblood95*:

 

So I a working with the sample Warning/Kick for RPG/M320/SMAW Suicides.

I want to modify this sample to the following rule on my server: NO RPG/M320/SMAW with a Kill/Kick sequence.

The past few days I've started to look into C# myself, hoping to modify things on my own rather than asking it on this post. (yet here I am :smile: )

Getting it to Kill when using a RPG/M320/SMAW was not hard at all since I only changed the OnSuicide > OnKill

I left the first_Check as follows:

Code:

Regex.Match(kill.Weapon, @"(RPG|SMAW|M320)", RegexOptions.IgnoreCase).Success
The second_check is however were I stumbled on a problem that I couldn't grasp.

The code that works for this is as follows (gives no errors, not tested in-game):

Code:

double count = limit.Activations(player.Name);
	
if (count == 1)
    plugin.KillPlayer(player.Name);                                           
else if (count == 2)
{
    plugin.SendGlobalMessage(plugin.R("%p_n%, was kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.KickPlayerWithMessage(player.Name, plugin.R("You were kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.PRoConChat("Admin > All:%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
    plugin.ConsoleWrite("%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
}

return false;
Yet Changing it to the following code gives me an error:

Code:

double count = limit.Activations(player.Name);
	
if (count == 1)
    plugin.SendGlobalMessage(plugin.R("%p_n%, was killed for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, next time is kick!"));
    plugin.KillPlayer(player.Name);                                           
else if (count == 2)
{
    plugin.SendGlobalMessage(plugin.R("%p_n%, was kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.KickPlayerWithMessage(player.Name, plugin.R("You were kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.PRoConChat("Admin > All:%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
    plugin.ConsoleWrite("%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
}

return false;
The error that is given goes as follows:

[insane Limits] Thread(settings): ERROR: (CS1525, line: 47, column: 22): Invalid expression term 'else'

[insane Limits] Thread(settings): ERROR: (CS1002, line: 47, column: 27): ; expected

It appears that there only can be one plugin. entry under the count == 1. Yet that is strange to me.

Also, I found it weird that there is no bool for killing that is similar to: plugin.KickPlayerWithMessage

 

I hope anyone can help me understand this :smile:

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

Originally Posted by LCARSx64*:

 

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))

How do you enable VIP for a player? Is this via a database?

 

 

Thanks for helping me out here. I do stumble upon the following problem. I have numerous of lists in the first_check (expression) that excludes this limit for saying that these persons have left the server, it goes as follows:

(!plugin.isInList(player.Name, "Head-admin_list") && !plugin.isInList(player.Name, "Admin_list") && !plugin.isInList(player.Name, "Moderator_list") && !plugin.isInList(player.Name, "Lieutenant_list") && !plugin.isInList(player.Name, "Member_list"))

 

These people are excluded since I want a personal admin message for these players to all audience.

Is there anyway I can integrate these lists that were in expression, to the code you have offered me?

 

Thanks for the help.

I'm not entirely sure what you are asking here, could you please give an example of what you mean.

 

 

So I a working with the sample Warning/Kick for RPG/M320/SMAW Suicides.

I want to modify this sample to the following rule on my server: NO RPG/M320/SMAW with a Kill/Kick sequence.

The past few days I've started to look into C# myself, hoping to modify things on my own rather than asking it on this post. (yet here I am :smile: )

Getting it to Kill when using a RPG/M320/SMAW was not hard at all since I only changed the OnSuicide > OnKill

I left the first_Check as follows:

Code:

Regex.Match(kill.Weapon, @"(RPG|SMAW|M320)", RegexOptions.IgnoreCase).Success
The second_check is however were I stumbled on a problem that I couldn't grasp.

The code that works for this is as follows (gives no errors, not tested in-game):

Code:

double count = limit.Activations(player.Name);
	
if (count == 1)
    plugin.KillPlayer(player.Name);                                           
else if (count == 2)
{
    plugin.SendGlobalMessage(plugin.R("%p_n%, was kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.KickPlayerWithMessage(player.Name, plugin.R("You were kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.PRoConChat("Admin > All:%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
    plugin.ConsoleWrite("%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
}

return false;
Yet Changing it to the following code gives me an error:

Code:

double count = limit.Activations(player.Name);
	
if (count == 1)
    plugin.SendGlobalMessage(plugin.R("%p_n%, was killed for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, next time is kick!"));
    plugin.KillPlayer(player.Name);                                           
else if (count == 2)
{
    plugin.SendGlobalMessage(plugin.R("%p_n%, was kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.KickPlayerWithMessage(player.Name, plugin.R("You were kicked for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, 1 warning was given!"));
    plugin.PRoConChat("Admin > All:%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
    plugin.ConsoleWrite("%p_n% Has been kicked for using a SMAW/RPG-7/M320/GP-30!");
}

return false;
The error that is given goes as follows:

 

 

It appears that there only can be one plugin. entry under the count == 1. Yet that is strange to me.

Also, I found it weird that there is no bool for killing that is similar to: plugin.KickPlayerWithMessage

 

I hope anyone can help me understand this :smile:

Change:

Code:

if (count == 1)
    plugin.SendGlobalMessage(plugin.R("%p_n%, was killed for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, next time is kick!"));
    plugin.KillPlayer(player.Name);                                           
else if (count == 2)
To:

Code:

if (count == 1)
[b]{[/b]
    plugin.SendGlobalMessage(plugin.R("%p_n%, was killed for breaking the NO SMAW/RPG-7/M320/GP-30 Rule, next time is kick!"));
    plugin.KillPlayer(player.Name);
[b]}[/b]
else if (count == 2)
Note the curly brackets.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Hi I'm requesting a Limit for High Ping 200 and over. Thank you very much

The following limit will kick a player whose ping is 200 (default) or higher based on their average ping, ignoring whitelisted players (change the value highlighted in red as desired):

 


High Ping Kicker

 

Create a new limit to evaluate OnIntervalPlayers. Set the evaluation_interval to the delay time between each check in seconds, I suggest 30 to 60 (Half a minute to 1 minute). Set action to None.

 

Set first_check to this Code:

Code:

// High Ping Kicker - Limit 1 of 1
// v1.0 - OnIntervalPlayers - first_check
//

int iHiPing = 200;
int iPing = 0;

String[] sMsgs = { "^b^1Ping Kicker^0^n: ",
                   "Ping Kicker: ",
                   " was kicked for high ping (",
                   "High Ping (" };
if (plugin.isInWhitelist(player.Name)) return false;
iPing = player.AveragePing;
if (iPing >= iHiPing)
{
    sMsgs[0] = sMsgs[0] + player.FullName + sMsgs[2] + iPing.ToString() + ")";
    sMsgs[1] = sMsgs[1] + player.FullName + sMsgs[2] + iPing.ToString() + ")";
    sMsgs[3] = sMsgs[3] + iPing.ToString() + ")";
    plugin.KickPlayerWithMessage(player.Name, sMsgs[3]);
    plugin.ConsoleWrite(sMsgs[0]);
    plugin.PRoConChat(sMsgs[0]);
    plugin.PRoConEvent(sMsgs[1], "Insane Limits");
}

return false;

End of post.

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

Originally Posted by Gazovik83*:

 

How do you enable VIP for a player? Is this via a database?

I thought about creating a limit for each VIP player separately! I would enter the nickname of the player and the date when the VIP status. The plugin would be jotting down these data, such as a local file. To request a player plugin used to take and have calculated the balance of days!

 

I just saw that plugins can work with a time server. And here's a thought, and here you can implement similar.

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

Originally Posted by Smellblood95*:

 

I'm not entirely sure what you are asking here, could you please give an example of what you mean.

Let me explain what my thoughts behind this limit are so you know more about it: People leave in my server as well and therefore I just want the message displayed: "Player %p_n% has left the server". Now this isnt hard to do.

We have different ranks within my community and each rank needs to be announced in the chat differently. So in order to do that, I had to exclude these ranks from the normal "Player %p_n% has left the server" message limit and make seperate limits for each rank.

Each rank has a limit and a list (with the players that belong to this rank). So previously, my codes looked like the following:

first_check was set to Expression:

 

Code:

(!plugin.isInList(player.Name, "Head-admin_list") && !plugin.isInList(player.Name, "Admin_list") && !plugin.isInList(player.Name, "Moderator_list") && !plugin.isInList(player.Name, "Lieutenant_list") && !plugin.isInList(player.Name, "Member_list"))
This was done so these lists were excluded from the "Player %p_n% has left the server" message. The Head-Admin for example has his own limit that says "Head-Admin %p_n% has left the server". If the code in the first_check isnt included, then it would showthe Head-Admin message and the normal player messages both.

And for the second_check that was also set to Expression:

Code:

limit.ActivationsTotal(player.Name) == 1
Next to that there was an action set to Say and there I had the problem of the only admin audience.

 

So what u suggested was the following, first_check set to 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;
And second_check to disabled with no Action.

Now I am coming to my point, by doing the change you proposed, I cannot add these lists I had in my first_check to exclude them from this. So that is why I asked for the integration or something else of these lists so that they can be excluded. This is needed so that the admins (the audience) wont see that for example: "Head-Admin %p_n% has left the server" and "Player %p_n% has left the server".

 

So I hope I have made this clear (with a long explanation) and I really look forward to your answer. And as always, thanks for the help!

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

Originally Posted by LCARSx64*:

 

Let me explain what my thoughts behind this limit are so you know more about it: People leave in my server as well and therefore I just want the message displayed: "Player %p_n% has left the server". Now this isnt hard to do.

We have different ranks within my community and each rank needs to be announced in the chat differently. So in order to do that, I had to exclude these ranks from the normal "Player %p_n% has left the server" message limit and make seperate limits for each rank.

Each rank has a limit and a list (with the players that belong to this rank). So previously, my codes looked like the following:

first_check was set to Expression:

 

Code:

(!plugin.isInList(player.Name, "Head-admin_list") && !plugin.isInList(player.Name, "Admin_list") && !plugin.isInList(player.Name, "Moderator_list") && !plugin.isInList(player.Name, "Lieutenant_list") && !plugin.isInList(player.Name, "Member_list"))
This was done so these lists were excluded from the "Player %p_n% has left the server" message. The Head-Admin for example has his own limit that says "Head-Admin %p_n% has left the server". If the code in the first_check isnt included, then it would showthe Head-Admin message and the normal player messages both.

And for the second_check that was also set to Expression:

Code:

limit.ActivationsTotal(player.Name) == 1
Next to that there was an action set to Say and there I had the problem of the only admin audience.

 

So what u suggested was the following, first_check set to 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;
And second_check to disabled with no Action.

Now I am coming to my point, by doing the change you proposed, I cannot add these lists I had in my first_check to exclude them from this. So that is why I asked for the integration or something else of these lists so that they can be excluded. This is needed so that the admins (the audience) wont see that for example: "Head-Admin %p_n% has left the server" and "Player %p_n% has left the server".

 

So I hope I have made this clear (with a long explanation) and I really look forward to your answer. And as always, thanks for the help!

Ok, I see what you mean. This can all be done in a single limit, just use my previous limit only change the first_check Code to:

Code:

String[] sMsg = { " has left the server!",
                  "Player ",
                  "Head Admin ",
                  "Admin ",
                  "Moderator ",
                  "Lieutenant ",
                  "Member " };

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

sMsg[0] = player.FullName + sMsg[0];
if (plugin.isInList(player.Name, "Head-admin_list"))
{
    sMsg[0] = sMsg[2] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Admin_list"))
{
    sMsg[0] = sMsg[3] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Moderator_list"))
{
    sMsg[0] = sMsg[4] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Lieutenant_list"))
{
    sMsg[0] = sMsg[5] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Member_list_list"))
{
    sMsg[0] = sMsg[6] + sMsg[0];
}
else
{
    sMsg[0] = sMsg[1] + sMsg[0];
}
foreach (PlayerInfoInterface p in allPlayers)
{
    if (plugin.isInList(p.Name, "Head-admin_list") || plugin.isInList(p.Name, "Admin_list"))
    {
        plugin.SendPlayerMessage(p.Name, sMsg[0]);
    }
}

return false;
Note that only players listed in Head-admin_list and Admin_list will receive the messages.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Smellblood95*:

 

So I have the following code that should work, but still gives errors on me.

The Evaluation is set to OnSpawn.

first_check is set to Expression:

 

Code:

(true)
second_check is set to Code:

 

Code:

double count = limit.Activations(player.Name);
	
            if (count == 1)            
            {
            msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
            plugin.SendGlobalYell(plugin.R(msg, 10));
            plugin.PRoConChat(plugin.R("Admin > All: ^1Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));
            plugin.ConsoleWrite(plugin.R("Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));

            }
            
	        return false;
Action is disabled.

 

This code is intended for an OnSpawn yellmessage that only triggers once. I know this can be done by just adding a normal action, but that is not what I want, seeing that I cannot put the color in in the proconchat.

I am no C# expert here and this is the only way I know, so it probably can be done way easier then what I build here :smile:

the error that occurs in the second_check is as followed:

 

[insane Limits] Thread(settings): ERROR: (CS1056, line: 46, column: 31): Unexpected character '"'

[insane Limits] Thread(settings): ERROR: (CS1056, line: 46, column: 161): Unexpected character '"'

I have litterally no idea why this error occurs, I hope somebody can help me. (a simplied version is welcome, yet with no action involved)

 

thanks.

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

Originally Posted by LCARSx64*:

 

So I have the following code that should work, but still gives errors on me.

The Evaluation is set to OnSpawn.

first_check is set to Expression:

 

Code:

(true)
second_check is set to Code:

 

Code:

double count = limit.Activations(player.Name);
	
            if (count == 1)            
            {
            msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
            plugin.SendGlobalYell(plugin.R(msg, 10));
            plugin.PRoConChat(plugin.R("Admin > All: ^1Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));
            plugin.ConsoleWrite(plugin.R("Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));

            }
            
	        return false;
Action is disabled.

 

This code is intended for an OnSpawn yellmessage that only triggers once. I know this can be done by just adding a normal action, but that is not what I want, seeing that I cannot put the color in in the proconchat.

I am no C# expert here and this is the only way I know, so it probably can be done way easier then what I build here :smile:

the error that occurs in the second_check is as followed:

 

 

 

I have litterally no idea why this error occurs, I hope somebody can help me. (a simplied version is welcome, yet with no action involved)

 

thanks.

The problem is the quote marks in the msg = , you have:

Code:

msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
it should be:

Code:

msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
Also, having:

Code:

double count = limit.Activations(player.Name);
will display the welcome message on first spawn each round, if you only want the message on the very first spawn when entering the server, change it to:

Code:

double count = limit.ActivationsTotal(player.Name);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Smellblood95*:

 

Ok, I see what you mean. This can all be done in a single limit, just use my previous limit only change the first_check Code to:

 

Code:

String[] sMsg = { " has left the server!",
                  "Player ",
                  "Head Admin ",
                  "Admin ",
                  "Moderator ",
                  "Lieutenant ",
                  "Member " };

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

sMsg[0] = player.FullName + sMsg[0];
if (plugin.isInList(player.Name, "Head-admin_list"))
{
    sMsg[0] = sMsg[2] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Admin_list"))
{
    sMsg[0] = sMsg[3] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Moderator_list"))
{
    sMsg[0] = sMsg[4] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Lieutenant_list"))
{
    sMsg[0] = sMsg[5] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Member_list_list"))
{
    sMsg[0] = sMsg[6] + sMsg[0];
}
else
{
    sMsg[0] = sMsg[1] + sMsg[0];
}
foreach (PlayerInfoInterface p in allPlayers)
{
    if (plugin.isInList(p.Name, "Head-admin_list") || plugin.isInList(p.Name, "Admin_list"))
    {
        plugin.SendPlayerMessage(p.Name, sMsg[0]);
    }
}

return false;
Note that only players listed in Head-admin_list and Admin_list will receive the messages.
Thank you very much for this answer. I do have one tiny question on adding something else:

I want the leave to be visible in the proconchat, so I added the following in the code:

Code:

sMsg[0] = player.FullName + sMsg[0];
if (plugin.isInList(player.Name, "Head-admin_list"))
{
    sMsg[0] = sMsg[2] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Admin_list"))
{
    sMsg[0] = sMsg[3] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Moderator_list"))
{
    sMsg[0] = sMsg[4] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Lieutenant_list"))
{
    sMsg[0] = sMsg[5] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Member_list_list"))
{
    sMsg[0] = sMsg[6] + sMsg[0];
}
else
{
    sMsg[0] = sMsg[1] + sMsg[0];
}
foreach (PlayerInfoInterface p in allPlayers)
{
    if (plugin.isInList(p.Name, "admins"))
    {
        plugin.SendPlayerMessage(p.Name, sMsg[0]);
        plugin.PRoConChat(plugin.R("Admin > Admins: ^8<< %p_n% has left the server>>"));
        plugin.ConsoleWrite(plugin.R("<< %p_n% has left the server>>"));    }
}

return false;
On doing this, it suddenly gives the leave message twice in Procon. Do you know what is wrong here?

 

EDIT: It now displays it three times :smile:

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

Originally Posted by Smellblood95*:

 

The problem is the quote marks in the msg = , you have:

Code:

msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
it should be:

Code:

msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
Also, having:

Code:

double count = limit.Activations(player.Name);
will display the welcome message on first spawn each round, if you only want the message on the very first spawn when entering the server, change it to:

Code:

double count = limit.ActivationsTotal(player.Name);
Well that was a bit of a fail on my side :ohmy:

Yet on adjusting your changes, I get the following code with an error.

 

Code:

            double count = limit.ActivationsTotal(player.Name); 

            if (count == 1)
            {            
            
            msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
            plugin.SendGlobalYell(plugin.R(msg, 10));
            plugin.PRoConChat(plugin.R("Admin > All: ^1Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));
            plugin.ConsoleWrite(plugin.R("Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));
             
            }          
            return false;

[insane Limits] ERROR: (CS0103, line: 47, column: 25): The name 'msg' does not exist in the current context

[insane Limits] ERROR: (CS0103, line: 48, column: 56): The name 'msg' does not exist in the current context

So something is still not going as planned here.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Thank you very much for this answer. I do have one tiny question on adding something else:

I want the leave to be visible in the proconchat, so I added the following in the code:

Code:

sMsg[0] = player.FullName + sMsg[0];
if (plugin.isInList(player.Name, "Head-admin_list"))
{
    sMsg[0] = sMsg[2] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Admin_list"))
{
    sMsg[0] = sMsg[3] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Moderator_list"))
{
    sMsg[0] = sMsg[4] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Lieutenant_list"))
{
    sMsg[0] = sMsg[5] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Member_list_list"))
{
    sMsg[0] = sMsg[6] + sMsg[0];
}
else
{
    sMsg[0] = sMsg[1] + sMsg[0];
}
foreach (PlayerInfoInterface p in allPlayers)
{
    if (plugin.isInList(p.Name, "admins"))
    {
        plugin.SendPlayerMessage(p.Name, sMsg[0]);
        plugin.PRoConChat(plugin.R("Admin > Admins: ^8<< %p_n% has left the server>>"));
        plugin.ConsoleWrite(plugin.R("<< %p_n% has left the server>>"));    }
}

return false;
On doing this, it suddenly gives the leave message twice in Procon. Do you know what is wrong here?
You've put the Procon output in the message to admin loop, if you have 2 admins in game then the Procon output is going to be displayed twice. I suggest you do it as follows:-

 

The following will only display in Procon if the player leaving is a Head-Admin or Admin, to make it show all leaving players in Procon, change the value highlighted in red to true.

Code:

String[] sMsg = { " has left the server!",
                  "Player ",
                  "Head Admin ",
                  "Admin ",
                  "Moderator ",
                  "Lieutenant ",
                  "Member ",
                  "^1^bAdmin > Admins^n^0: " };
bool bLog = false;
List<PlayerInfoInterface> allPlayers = new List<PlayerInfoInterface>();
allPlayers.AddRange(team1.players);
allPlayers.AddRange(team2.players);

sMsg[0] = player.FullName + sMsg[0];
sMsg[7] = sMsg[7] + sMsg[0];
if (plugin.isInList(player.Name, "Head-admin_list"))
{
    sMsg[0] = sMsg[2] + sMsg[0];
    bLog = true;
}
else if (plugin.isInList(player.Name, "Admin_list"))
{
    sMsg[0] = sMsg[3] + sMsg[0];
    bLog = true;
}
else if (plugin.isInList(player.Name, "Moderator_list"))
{
    sMsg[0] = sMsg[4] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Lieutenant_list"))
{
    sMsg[0] = sMsg[5] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Member_list_list"))
{
    sMsg[0] = sMsg[6] + sMsg[0];
}
else
{
    sMsg[0] = sMsg[1] + sMsg[0];
}
foreach (PlayerInfoInterface p in allPlayers)
{
    if (plugin.isInList(p.Name, "Head-admin_list") || plugin.isInList(p.Name, "Admin_list"))
    {
        plugin.SendPlayerMessage(p.Name, sMsg[0]);
    }
}
if (bLog)
{
    plugin.PRoConChat(sMsg[7]);
    plugin.ConsoleWrite(sMsg[7]);
}

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

Originally Posted by Smellblood95*:

 

You've put the Procon output in the message to admin loop, if you have 2 admins in game then the Procon output is going to be displayed twice. I suggest you do it as follows:-

 

The following will only display in Procon if the player leaving is a Head-Admin or Admin, to make it show all leaving players in Procon, change the value highlighted in red to true.

Code:

String[] sMsg = { " has left the server!",
                  "Player ",
                  "Head Admin ",
                  "Admin ",
                  "Moderator ",
                  "Lieutenant ",
                  "Member ",
                  "^1^bAdmin > Admins^n^0: " };
bool bLog = false;
List<PlayerInfoInterface> allPlayers = new List<PlayerInfoInterface>();
allPlayers.AddRange(team1.players);
allPlayers.AddRange(team2.players);

sMsg[0] = player.FullName + sMsg[0];
sMsg[7] = sMsg[7] + sMsg[0];
if (plugin.isInList(player.Name, "Head-admin_list"))
{
    sMsg[0] = sMsg[2] + sMsg[0];
    bLog = true;
}
else if (plugin.isInList(player.Name, "Admin_list"))
{
    sMsg[0] = sMsg[3] + sMsg[0];
    bLog = true;
}
else if (plugin.isInList(player.Name, "Moderator_list"))
{
    sMsg[0] = sMsg[4] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Lieutenant_list"))
{
    sMsg[0] = sMsg[5] + sMsg[0];
}
else if (plugin.isInList(player.Name, "Member_list_list"))
{
    sMsg[0] = sMsg[6] + sMsg[0];
}
else
{
    sMsg[0] = sMsg[1] + sMsg[0];
}
foreach (PlayerInfoInterface p in allPlayers)
{
    if (plugin.isInList(p.Name, "Head-admin_list") || plugin.isInList(p.Name, "Admin_list"))
    {
        plugin.SendPlayerMessage(p.Name, sMsg[0]);
    }
}
if (bLog)
{
    plugin.PRoConChat(sMsg[7]);
    plugin.ConsoleWrite(sMsg[7]);
}

return false;
After some testing and small adjustments to my liking, it seems to be working fine now! Thanks for that!

I hope that u can also have another look into my request about the yell welcome message!

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

Originally Posted by GR101*:

 

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.
Thanks for that!

 

Will this work? Code:

lBadWords.Add("n[1i!e3lo* ]+[g896* ]+[aeros340* ]+[^a-z]+[ .]*");
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Thanks for that!

 

Will this work? Code:

lBadWords.Add("n[1i!e3lo* ]+[g896* ]+[aeros340* ]+[^a-z]+[ .]*");
No that won't work as expected, remove the + signs unless you're trying to match on those. What word (and combinations) are are you trying to match? ... You can PM it to me if you think it's too offensive to post here.

 

UPDATE:

 

An easier way for you to see if your pattern works is to use the following limit to test. It will display if there is a match or not in Procon chat (change the text highlighted in red to the actual word you want to find a match for, change the text highlighted in green to the match pattern you want to test):

 


Test Word Match

 

Create a new limit to evaluate OnIntervalServer. Set the evaluation_interval to 10 seconds. Set action to None.

 

Set first_check to this Code:

Code:

String sTest = "hello";
String sMatch = "[b]n[1i!e3lo* ][g896* ][aeros340* ][^a-z][ .]*[/b]";
Match mMatch = null;

mMatch = Regex.Match(sTest, @"(_<=\W|^)(" + sMatch + @")(_=\W|$)", RegexOptions.IgnoreCase);
if (mMatch.Success)
{
    plugin.PRoConChat("^9Match found on: " + mMatch.Value + "^0");
}
else
{
    plugin.PRoConChat("^9No match!^0");
}

return false;
Once edited, simply enable the limit and watch Procon chat. You will need to change the test word to the different combinations to check each works.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by moacco07*:

 

Hi,

 

Can someone create me a script for BF4 for Air superiority where evaluates all players KPM and KDR on current round. When rounds end if the player has KPM>=2.0 or K/D>=4.0 in the latest round will be tban for 20 mins on next round starts.

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

Originally Posted by Smellblood95*:

 

Well that was a bit of a fail on my side

Yet on adjusting your changes, I get the following code with an error.

 

Code:

double count = limit.ActivationsTotal(player.Name); 

            if (count == 1)
            {            
            
            msg = "Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!";
            plugin.SendGlobalYell(plugin.R(msg, 10));
            plugin.PRoConChat(plugin.R("Admin > All: ^1Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));
            plugin.ConsoleWrite(plugin.R("Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));
             
            }          
            return false;

[insane Limits] ERROR: (CS0103, line: 47, column: 25): The name 'msg' does not exist in the current context

[insane Limits] ERROR: (CS0103, line: 48, column: 56): The name 'msg' does not exist in the current context

So something is still not going as planned here.
Well I cracked this one myself. :ohmy:

Here is the code to any of my fellow administrators out there:

 

Code:

double count = limit.ActivationsTotal(player.Name); 
            
            if (count > 1)
                return false;

            String sMsg = plugin.R("Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!");

            if (count == 1)
                {                     
                plugin.SendPlayerYell(player.Name, sMsg, 10);
                plugin.PRoConChat(plugin.R("Admin > All: ^1Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));
                plugin.ConsoleWrite(plugin.R("Welcome %p_n% to Virtual Killers. Check the rules with the command: !rules. Check your rank by writing: !rank. Enjoy the killing!"));             
                }
                
            return false;
I am very proud of myself on figuring this one out :smile:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Smellblood95*:

 

So I have another request. In my server I want to have different commands for different purposes, say for example !votekick or !voteban.

It was easy to create them all with a single new limit, but I have the feeling that this can all be done in one (somewhat more complex) limit so that I don't have nine different limits that have almost the same content.

I shall give 2 examples of these limits, but in fact, I have nine of these.

 

Example 1 ( 7 times)

evaluation is set to OnAnyChat.

first_check is set to Expression.

 

Code:

player.LastChat.StartsWith("!commands")
second_check is set to Code.

 

Code:

List<String> commands = new List<String>();
commands.Add("Commands: !rank, !top10 !serverstats, !ts3, !rules, !sniperx, !snipers.");

if(limit.Activations(player.Name) <= 2)
    foreach(string Rule in commands)
        plugin.ConsoleWrite("Commands: !rank, !top10 !serverstats, !ts3, !rules, !sniperx, !snipers.");
        plugin.PRoConChat("Admin > All:^6Commands: !rank, !top10 !serverstats, !ts3, !rules, !sniperx, !snipers.");
        plugin.SendGlobalMessage("Commands: !rank, !top10 !serverstats, !ts3, !rules, !sniperx, !snipers.");

return false;
Action is disabled.

 

Example 2 ( 2 times)

evaluation is set to OnAnyChat.

first_check is set to Expression.

 

Code:

player.LastChat.StartsWith("!rules")
second_check is set to Code.

 

Code:

List<String> Rules = new List<String>();
Rules.Add("=======>> Rules of Virtual Killers <<=======");

if(limit.Activations(player.Name) <= 2)
    foreach(string Rule in Rules)
        plugin.SendGlobalMessage("=======>> Rules of Virtual Killers <<=======");
        plugin.SendGlobalMessage("---> NO CRANE!");
        plugin.SendGlobalMessage("---> NO M320/RPG/SMAW/GP-30!");
        plugin.SendGlobalMessage("---> Teamkill limit = 10 / SniperLimit = 6");
        plugin.SendGlobalMessage("---> Watch your language!");
        plugin.ConsoleWrite("=======>> Rules of Virtual Killers <<=======");
        plugin.ConsoleWrite("---> NO CRANE!");
        plugin.ConsoleWrite("---> NO M320/RPG/SMAW/GP-30!");
        plugin.ConsoleWrite("---> Teamkill limit = 10 / SniperLimit = 6");
        plugin.ConsoleWrite("---> Watch your language!");
        plugin.PRoConChat("Admin > All:^6=======>> Rules of Virtual Killers <<=======");
        plugin.PRoConChat("Admin > All:^6---> NO CRANE!");
        plugin.PRoConChat("Admin > All:^6---> NO M320/RPG/SMAW/GP-30!");
        plugin.PRoConChat("Admin > All:^6---> Teamkill limit = 10 / SniperLimit = 6");
        plugin.PRoConChat("Admin > All:^6---> Watch your language!");
return false;
Action is disabled.

 

I know that the commands that only require 1 line can be done way more easily, yet this is the only way I know how to do this.

I hope that somebody knows a better way for this. It works fine now, but getting it done in a nicer way is always better.

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

Originally Posted by LCARSx64*:

 

Hi,

 

Can someone create me a script for BF4 for Air superiority where evaluates all players KPM and KDR on current round. When rounds end if the player has KPM>=2.0 or K/D>=4.0 in the latest round will be tban for 20 mins on next round starts.

Is this what you were after? ...

 

Change the values highlighted in red to whatever KPM & KDR you require.

Change the value highlighted in green to false to stop logging kicks to Procon.

 


Air Superiority KPM && KDR Limiter

 

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

 

Set first_check to this Code:

Code:

// Air Superiority KPM & KDR Limiter - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

double dKPM = [b]2.0[/b];
double dKDR = [b]4.0[/b];
bool bLogToProcon = [b]true[/b];
//
String sMsg = "Your KPM was " + String.Format("{0:0.0}", dKPM) + " or higher and your KDR was " + String.Format("{0:0.0}", dKDR) + " or higher last round!";
List<PlayerInfoInterface> lPlayers = new List<PlayerInfoInterface>();
String[] sLogs = { "KPM-KDR Limiter",
                   " was temp banned for 20 minutes with KPM = ",
                   " and KDR = " };
String sLMsg = "";

if (server.Gamemode != "AirSuperiority0") return false;
lPlayers.AddRange(team1.players);
lPlayers.AddRange(team2.players);
foreach (PlayerInfoInterface p in lPlayers)
{
    if (p.KpmRound >= dKPM && p.KdrRound >= dKDR)
    {
        sLMsg = p.FullName + sLogs[1] + String.Format("{0:0.0}", p.KpmRound) + sLogs[2] + String.Format("{0:0.0}", p.KdrRound);
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, p.Name, 20, sMsg);
        if (bLogToProcon)
        {
            plugin.ConsoleWrite("^b^1" + sLogs[0] + "^0:^n " + sLMsg);
            plugin.PRoConChat("^b^1" + sLogs[0] + "^0:^n " + sLMsg);
            plugin.PRoConEvent(sLogs[0] + ": " + sLMsg, "Insane Limits");
        }
    }
}

return false;

End of post.

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

Originally Posted by moacco07*:

 

Is this what you were after? ...

 

Change the values highlighted in red to whatever KPM & KDR you require.

Change the value highlighted in green to false to stop logging kicks to Procon.

 


Air Superiority KPM && KDR Limiter

 

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

 

Set first_check to this Code:

Code:

// Air Superiority KPM & KDR Limiter - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

double dKPM = [b]2.0[/b];
double dKDR = [b]4.0[/b];
bool bLogToProcon = [b]true[/b];
//
String sMsg = "Your KPM was " + String.Format("{0:0.0}", dKPM) + " or higher and your KDR was " + String.Format("{0:0.0}", dKDR) + " or higher last round!";
List<PlayerInfoInterface> lPlayers = new List<PlayerInfoInterface>();
String[] sLogs = { "KPM-KDR Limiter",
                   " was temp banned for 20 minutes with KPM = ",
                   " and KDR = " };
String sLMsg = "";

if (server.Gamemode != "AirSuperiority0") return false;
lPlayers.AddRange(team1.players);
lPlayers.AddRange(team2.players);
foreach (PlayerInfoInterface p in lPlayers)
{
    if (p.KpmRound >= dKPM && p.KdrRound >= dKDR)
    {
        sLMsg = p.FullName + sLogs[1] + String.Format("{0:0.0}", p.KpmRound) + sLogs[2] + String.Format("{0:0.0}", p.KdrRound);
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, p.Name, 20, sMsg);
        if (bLogToProcon)
        {
            plugin.ConsoleWrite("^b^1" + sLogs[0] + "^0:^n " + sLMsg);
            plugin.PRoConChat("^b^1" + sLogs[0] + "^0:^n " + sLMsg);
            plugin.PRoConEvent(sLogs[0] + ": " + sLMsg, "Insane Limits");
        }
    }
}

return false;

End of post.

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

Originally Posted by GR101*:

 

Admin Audit Trail Script.

 

I've been using this 'Admin Audit Trial' code and it works well.

 

Code:

String txt = player.LastChat;

    /* Remove the first character if it is "/" */

    if (txt.Length > 0 && txt[0] == '/' )
        txt = txt.Substring(1);

    /* Exit if text is not prefixed with "/", "!", "@", or "_" */ 
    if (!plugin.IsCommand(txt))
        return false;

    txt = plugin.ExtractCommand(txt);

    List<String> commands = new List<String>();
    commands.Add("kick");
    commands.Add("tban");
    commands.Add("kill");
    commands.Add("move");
    commands.Add("fmove");

    List<String> words = new List<String>(Regex.Split(txt.Trim(), @"\s+"));

    /* Exit if not enough words */
    if ( words.Count < 2)
        return false;

    /* Get the command being executed */
    String command = words[0];

    /* Exit if command is not in list */
    if (!commands.Contains(command)) 
        return false;

    /* Determine the player being kicked/banned/killed */

    String typed_name = words[1];
    String actual_name = plugin.BestPlayerMatch(words[1]);

    if (actual_name == null)
        actual_name = "Unknown";

    String admin_name = player.Name;
    String message = "[%date% - %time%] " + admin_name + " > " +  command + " " + player.LastChat + " " + typed_name + " (Actual Name: " + actual_name + ")";

    plugin.Log("Logs/InsaneLimits_AAT.log", plugin.R(message));
Could somebody please modify the code to perform the following:-

 

1.) Log admins only.

 

2.) Log all Procon commands for "kick", "tban" , "kill", "move", "ban" and keep the same in-game admin commands as well.

 

Thank you for considering this.

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

Originally Posted by LCARSx64*:

 

Good time comrades!

 

We would like to ask for your help.

 

Need new Limits: Switching maplist depending refers to the amount of players online.

 

We have five sets of MapList's that we want to use. It is necessary that they are automatically switched as a function of amount of players online.

 

Example:

MapList1.txt

MapList2.txt => 8 players

MapList3.txt => 16 players

MapList4.txt => 32 players

MapList5.txt => 40 players

 

The number of players - it is editable settings for.

 

But that is not all. It would be too easy:ohmy:

 

- When changing current MapList procon remembered what map it was next and when return to it MapList starts rotation not from the beginning, and since with the "last saved map".

- Clearing all "last saved map" for all MapList's when ProCon restart.

- Switch MapList's only after the specified refers to the amount rounds.

 

We know about the wonderful plugin "Ultimate Map Manager*", but it has some significant drawbacks for us and has in its arsenal a few little things we need.

 

 

We hope to help, thank you very much!

The following does what you ask but is untested.

 


The MapList files must be placed inside a folder named GAMESERVERIP_RCONPORT within your Procon\Plugins\BF4 folder and their filenames must be MapListX.txt (where X is the maplist number).

Example: If your GAMESERVERIP = 127.0.0.1 and RCONPORT = 12345 and you have 5 maplists, the folder structure and filenames would be:

Code:

Plugins\BF4\127.0.0.1_12345\MapList1.txt
Plugins\BF4\127.0.0.1_12345\MapList2.txt
Plugins\BF4\127.0.0.1_12345\MapList3.txt
Plugins\BF4\127.0.0.1_12345\MapList4.txt
Plugins\BF4\127.0.0.1_12345\MapList5.txt
The contents of each maplist file should contain:

Code:

MAPFILENAME GAMEMODE ROUNDS

e.g.:

XP1_001 ConquestLarge0 1
XP0_Caspian ConquestLarge0 1
The log file will be saved in the same folder with the filename MapList.log. Using the above example, it's filename would be:

Code:

Plugins\BF4\127.0.0.1_12345\MapList.log
The generate log file will contain the following information:

Code:

DATE TIME - PLAYERS - MAPFILE

e.g.:

1/1/2015 12:30:20 AM - 32 - MapList4.txt
At the top of the code you will see the player count values that you can customize, these are highlighted in red. The defaults are:

Code:

lPlayers.Add(8);
lPlayers.Add(16);
lPlayers.Add(32);
lPlayers.Add(40);
The way they work are (note that there are only 4 values here but their should be 5 MapList files, any value less than the value in the first line will be used for MapList1):

 

If there are 0 to 7 players then the maplist will be MapList1.

If there are 8 to 15 players then the maplist will be MapList2.

If there are 16 to 31 players then the maplist will be MapList3.

If there are 32 to 39 players then the maplist will be MapList4.

If there are 40 or more players (up to max players) then the maplist will be MapList5.

You may add as many of the lPlayer.Add lines as you like but you must have a corresponding MapList file.

 


Auto-Switch Maplists

 

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

 

Set first_check to this Code:

Code:

// Auto-Switch Maplists - Limit 1 of 1
// v1.1 - OnRoundOver - first_check
//

List<int> lPlayers = new List<int>();
[b]lPlayers.Add(8);
lPlayers.Add(16);
lPlayers.Add(32);
lPlayers.Add(40);[/b]
// You can add as many lPlayers.Add lines as you wish
// provided you also have a corresponding MapListX.txt
//
String[] sErrs = { "All rounds have not been completed!",
                   "MapList change is not required!",
                   " Aborting limit!",
                   "ERROR: ",
                   " Does not exist!",
                   " is empty!",
                   "Number of players = ",
                   " - Maplist changed to: ",
                   " - Next map = ",
                   "Folder does not exist!" };
String sFPrefix = "Plugins\\BF4\\" + server.Host + "_" + server.Port + "\\";
List<String> lMaplists = new List<String>();
List<int> lMapIndex = null;
String[] sContents;
String[] sMLVals;
String sCKey = "_ASMLC_";
String sIKey = "_ASMLI_";
bool bSetIdx = false;
int iCurList = 0;
int iNext = 0;
int iIdx = 0;
int iLo = 0;
int iHi = 0;
int iPC = server.PlayerCount;
//
Action<String> aLog = delegate(String _sMsg)
                      {
                          if (_sMsg != "")
                          {
                              String _sTitle = "Maplist Switcher";

                              plugin.ConsoleWrite("^b^1" + _sTitle + "^0:^n " + _sMsg);
                              plugin.PRoConChat("^b^1" + _sTitle + "^0:^n " + _sMsg);
                              plugin.PRoConEvent(_sTitle + ": " + _sMsg, "Insane Limits");
                          }
                      };

if ((server.CurrentRound + 1) < server.TotalRounds)
{
    aLog(sErrs[0] + sErrs[2]);
    return false;
}
if (server.Data.issetInt(sCKey)) iCurList = server.Data.getInt(sCKey);
lMaplists.Add("MapList1.txt");
if (server.Data.issetObject(sIKey))
{
    lMapIndex = (List<int>)server.Data.getObject(sIKey);
}
else
{
    lMapIndex = new List<int>();
    lMapIndex.Add(0);
    bSetIdx = true;
}
for (int i = 0; i < lPlayers.Count; i++)
{
    lMaplists.Add("MapList" + (i + 2).ToString() + ".txt");
    if (bSetIdx) lMapIndex.Add(0);
}
if (iPC >= lPlayers[0] && lPlayers.Count > 1)
{
    iIdx = 1;
    for (int i = 0; i < lPlayers.Count; i++)
    {
        if (i == (lPlayers.Count - 1))
        {
            iHi = server.MaxPlayers;
        }
        else
        {
            iHi = lPlayers[i + 1] - 1;
        }
        iLo = lPlayers[i];
        if (iPC >= iLo && iPC <= iHi)
        {
            iIdx = iIdx + i;
            break;
        }
    }
}
lMapIndex[iIdx] = server.MapIndex;
if (iCurList != iIdx)
{
    if (Directory.Exists(Path.GetDirectoryName(sFPrefix + lMaplists[0])))
    {
        if (File.Exists(sFPrefix + lMaplists[iIdx]))
        {
            sContents = File.ReadAllLines(sFPrefix + lMaplists[iIdx]);
            if (sContents.Length > 0)
            {
                plugin.ServerCommand("mapList.clear");
                foreach (String s in sContents)
                {
                    sMLVals = null;
                    sMLVals = s.Split(' ');
                    plugin.ServerCommand("mapList.add", sMLVals[0], sMLVals[1], sMLVals[2]);
                }
                iNext = lMapIndex[iIdx] + 1;
                if (iNext >= sContents.Length) iNext = 0;
                plugin.ServerCommand("mapList.setNextMapIndex", iNext.ToString());
                iCurList = iIdx;
                lMapIndex[iIdx] = iNext;
                aLog(sErrs[6] + iPC.ToString() + sErrs[7] + lMaplists[iIdx] + sErrs[8] + plugin.FriendlyMapName(server.NextMapFileName));
                plugin.Log(sFPrefix + "MapList.log", DateTime.Now.ToString() + " - " + iPC.ToString() + " - " + lMaplists[iIdx]);
            }
            else
            {
                aLog(sErrs[3] + lMaplists[iIdx] + sErrs[5]);
                return false;
            }
        }
        else
        {
            aLog(sErrs[3] + lMaplists[iIdx] + sErrs[4]);
        }
    }
    else
    {
        aLog(sErrs[3] + sErrs[9]);
        return false;
    }
}
else
{
    aLog(sErrs[1] + sErrs[2]);
}
server.Data.setInt(sCKey, iCurList);
server.Data.setObject(sIKey, lMapIndex);

return false;

End of post.

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

Originally Posted by MadDark_DK*:

 

Hey

 

I have played on a server where the server write welcome messeges when the player is joining. From country

 

example

 

Welcome MadDark_DK from Denmark ..

 

How do I get it on my server?

 

The server runs whit Insane Limits to run random present for gun master.

 

But i can´t finde the script for country welcome

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

Originally Posted by MadDark_DK*:

 

The following does what you ask but is untested.

 


The MapList files must be placed inside a folder named SERVERIP_SERVERPORT within your Procon\Plugins\BF4 folder and their filenames must be MapListX.txt (where X is the maplist number).

Example: If your SERVERIP = 127.0.0.1 and RCONPORT = 12345 and you have 5 maplists, the folder structure and filenames would be:

Code:

Plugins\BF4\127.0.0.1_12345\MapList1.txt
Plugins\BF4\127.0.0.1_12345\MapList2.txt
Plugins\BF4\127.0.0.1_12345\MapList3.txt
Plugins\BF4\127.0.0.1_12345\MapList4.txt
Plugins\BF4\127.0.0.1_12345\MapList5.txt
The contents of each maplist file should contain:

Code:

MAPFILENAME GAMEMODE ROUNDS

e.g.:

XP1_001 ConquestLarge0 1
XP0_Caspian ConquestLarge0 1
The log file will be saved in the same folder with the filename MapList.log. Using the above example, it's filename would be:

Code:

Plugins\BF4\127.0.0.1_12345\MapList.log
The generate log file will contain the following information:

Code:

DATE TIME - PLAYERS - MAPFILE

e.g.:

1/1/2015 12:30:20 AM - 32 - MapList4.txt
At the top of the code you will see the player count values that you can customize, these are highlighted in red. The defaults are:

Code:

lPlayers.Add(8);
lPlayers.Add(16);
lPlayers.Add(32);
lPlayers.Add(40);
The way they work are (note that there are only 4 values here but their should be 5 MapList files, any value less than the value in the first line will be used for MapList1):

 

If there are 0 to 7 players then the maplist will be MapList1.

If there are 8 to 15 players then the maplist will be MapList2.

If there are 16 to 31 players then the maplist will be MapList3.

If there are 32 to 39 players then the maplist will be MapList4.

If there are 40 or more players (up to max players) then the maplist will be MapList5.

You may add as many of the lPlayer.Add lines as you like but you must have a corresponding MapList file.

 


Auto-Switch Maplists

 

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

 

Set first_check to this Code:

Code:

// Auto-Switch Maplists - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

List lPlayers = new List();
lPlayers.Add(8);
lPlayers.Add(16);
lPlayers.Add(32);
lPlayers.Add(40);
// You can add as many lPlayers.Add lines as you wish
// provided you also have a corresponding MapListX.txt
//
String[] sErrs = { "All rounds have not been completed!",
                   "MapList change is not required!",
                   " Aborting limit!",
                   "ERROR: ",
                   " Does not exist!",
                   " is empty!",
                   "Number of players = ",
                   " - Maplist changed to: ",
                   " - Next map = ",
                   "Folder does not exist!" };
String sFPrefix = "Plugins\\BF4\\" + server.Host + "_" + server.Port + "\\";
List lMaplists = new List();
List lMapIndex = null;
String[] sContents;
String[] sMLVals;
String sCKey = "_ASMLC_";
String sIKey = "_ASMLI_";
bool bSetIdx = false;
int iCurList = 0;
int iNext = 0;
int iIdx = 0;
int iLo = 0;
int iHi = 0;
int iPC = server.PlayerCount;
//
Action aLog = delegate(String _sMsg)
                      {
                          if (_sMsg != "")
                          {
                              String _sTitle = "Maplist Switcher";

                              plugin.ConsoleWrite("^b^1" + _sTitle + "^0:^n " + _sMsg);
                              plugin.PRoConChat("^b^1" + _sTitle + "^0:^n " + _sMsg);
                              plugin.PRoConEvent(_sTitle + ": " + _sMsg, "Insane Limits");
                          }
                      };

if ((server.CurrentRound + 1) < server.TotalRounds)
{
    aLog(sErrs[0] + sErrs[2]);
    return false;
}
if (server.Data.issetInt(sCKey)) iCurList = server.Data.getInt(sCKey);
lMaplists.Add("MapList1.txt");
if (server.Data.issetObject(sIKey))
{
    lMapIndex = (List)server.Data.getObject(sIKey);
}
else
{
    lMapIndex = new List();
    lMapIndex.Add(0);
    bSetIdx = true;
}
for (int i = 0; i < lPlayers.Count; i++)
{
    lMaplists.Add("MapList" + (i + 2).ToString() + ".txt");
    if (bSetIdx) lMapIndex.Add(0);
}
if (iPC >= lPlayers[0] && lPlayers.Count > 1)
{
    iIdx = 1;
    for (int i = 0; i < lPlayers.Count; i++)
    {
        if (i == (lPlayers.Count - 1))
        {
            iHi = server.MaxPlayers;
        }
        else
        {
            iHi = lPlayers[i + 1] - 1;
        }
        iLo = lPlayers[i];
        if (iPC >= iLo && iPC  0)
            {
                plugin.ServerCommand("mapList.clear");
                foreach (String s in sContents)
                {
                    sMLVals = null;
                    sMLVals = s.Split(' ');
                    plugin.ServerCommand("mapList.add", sMLVals[0], sMLVals[1], sMLVals[2]);
                }
                iNext = lMapIndex[iIdx] + 1;
                if (iNext >= sContents.Length) iNext = 0;
                plugin.ServerCommand("mapList.setNextMapIndex", iNext.ToString());
                iCurList = iIdx;
                lMapIndex[iIdx] = iNext;
                aLog(sErrs[6] + iPC.ToString() + sErrs[7] + lMaplists[iIdx] + sErrs[8] + plugin.FriendlyMapName(server.NextMapFileName));
                plugin.Log(sFPrefix + "MapList.log", DateTime.Now.ToString() + " - " + iPC.ToString() + " - " + lMaplists[iIdx]);
            }
            else
            {
                aLog(sErrs[3] + lMaplists[iIdx] + sErrs[5]);
                return false;
            }
        }
        else
        {
            aLog(sErrs[3] + lMaplists[iIdx] + sErrs[4]);
        }
    }
    else
    {
        aLog(sErrs[3] + sErrs[9]);
        return false;
    }
}
else
{
    aLog(sErrs[1] + sErrs[2]);
}
server.Data.setInt(sCKey, iCurList);
server.Data.setObject(sIKey, lMapIndex);

return false;

End of post.

I get this ERROR

 

Maplist Switcher: ERROR: Folder does not exist!

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

Originally Posted by LCARSx64*:

 

Hey

 

I have played on a server where the server write welcome messeges when the player is joining. From country

 

example

 

Welcome MadDark_DK from Denmark ..

 

How do I get it on my server?

 

The server runs whit Insane Limits to run random present for gun master.

 

But i can´t finde the script for country welcome

Player Welcome with Country

 

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

 

Set first_check to this Code:

Code:

plugin.SendGlobalMessage("Welcome " + player.FullName + " from " + player.CountryName + " ..");

return false;

I get this ERROR

 

Maplist Switcher: ERROR: Folder does not exist!

I mistakenly stated SERVERPORT in the post's information, it should be RCONPORT. You have to create the folder and add the MapListX.txt files to it first.

The error has been corrected in post #2696.

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

Originally Posted by MadDark_DK*:

 

Player Welcome with Country

 

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

 

Set first_check to this Code:

Code:

plugin.SendGlobalMessage("Welcome " + player.FullName + " from " + player.CountryName + " ..");

return false;
I mistakenly stated SERVERPORT in the post's information, it should be RCONPORT. You have to create the folder and add the MapListX.txt files to it first.

The error has been corrected in post #2696.

Thanks

 

The Country plugin works perfekt ?

 

The MapList

But after i set the rcon port i now get 10 error

 

[17:04:58 75] [insane Limits] Thread(settings): Compiling Limit #2 - Name2 - OnRoundOver

[17:04:58 76] [insane Limits] Thread(settings): ERROR: 10 errors compiling Code

[17:04:58 76] [insane Limits] Thread(settings): ERROR: (CS1519, line: 157, column: 13): Invalid token 'catch' in class, struct, or interface member declaration

[17:04:58 76] [insane Limits] Thread(settings): ERROR: (CS1002, line: 157, column: 30): ; expected

[17:04:58 76] [insane Limits] Thread(settings): ERROR: (CS1519, line: 159, column: 37): Invalid token '(' in class, struct, or interface member declaration

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1519, line: 159, column: 39): Invalid token ',' in class, struct, or interface member declaration

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1520, line: 159, column: 46): Class, struct, or interface method must have a return type

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1002, line: 159, column: 55): ; expected

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1519, line: 159, column: 60): Invalid token ')' in class, struct, or interface member declaration

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS0116, line: 161, column: 13): A namespace does not directly contain members such as fields or methods

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1518, line: 164, column: 16): Expected class, delegate, enum, interface, or struct

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1022, line: 179, column: 5): Type or namespace definition, or end-of-file expected

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

Originally Posted by LCARSx64*:

 

Thanks

 

The Country plugin works perfekt ?

 

The MapList

But after i set the rcon port i now get 10 error

 

[17:04:58 75] [insane Limits] Thread(settings): Compiling Limit #2 - Name2 - OnRoundOver

[17:04:58 76] [insane Limits] Thread(settings): ERROR: 10 errors compiling Code

[17:04:58 76] [insane Limits] Thread(settings): ERROR: (CS1519, line: 157, column: 13): Invalid token 'catch' in class, struct, or interface member declaration

[17:04:58 76] [insane Limits] Thread(settings): ERROR: (CS1002, line: 157, column: 30): ; expected

[17:04:58 76] [insane Limits] Thread(settings): ERROR: (CS1519, line: 159, column: 37): Invalid token '(' in class, struct, or interface member declaration

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1519, line: 159, column: 39): Invalid token ',' in class, struct, or interface member declaration

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1520, line: 159, column: 46): Class, struct, or interface method must have a return type

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1002, line: 159, column: 55): ; expected

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1519, line: 159, column: 60): Invalid token ')' in class, struct, or interface member declaration

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS0116, line: 161, column: 13): A namespace does not directly contain members such as fields or methods

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1518, line: 164, column: 16): Expected class, delegate, enum, interface, or struct

[17:04:58 77] [insane Limits] Thread(settings): ERROR: (CS1022, line: 179, column: 5): Type or namespace definition, or end-of-file expected

Are you adding the Game Server Ip and RCON Port to the code?

If so, don't do that. Leave the code exactly as is, create an actual folder in your Procon layer's Plugins/BF4 folder, name that folder GAMESERVERIP_RCONPORT, e.g. if your game server IP is 127.0.0.1 and it's RCON port is 12345 then the folder name would be 127.0.0.1_12345

 

UPDATE:

 

You can use the following small limit to create the required folder and 5 MapListX.txt files.

 

After you activate, wait until you see the message Folder and files created! in Procon. Once the message is displayed, you may deactivate and delete this limit.

You will now find the GAMESERVERIP_RCONPORT folder in your Procon layer's Plugins\BF4 folder. Within this folder you will find 5 MapListX.txt template files, you will need to edit each of these files with your desired maps, modes and rounds.

 


Create Folder and Templates

 

Create a new limit to evaluate OnIntervalServer. Set the evaluation_interval to 10 seconds. Set action to None.

 

Set first_check to this Code:

Code:

String sFolder = "Plugins\\BF4\\" + server.Host + "_" + server.Port + "\\";
String[] sNames = { "MapList1.txt",
                    "MapList2.txt",
                    "MapList3.txt",
                    "MapList4.txt",
                    "MapList5.txt" };
String[] sConts = { "XP1_001 ConquestLarge0 1" };

if (!Directory.Exists(Path.GetDirectoryName(sFolder + sNames[0])))
{
    Directory.CreateDirectory(Path.GetDirectoryName(sFolder + sNames[0]));
    foreach (String s in sNames)
    {
        if (!File.Exists(sFolder + s)) File.WriteAllLines(sFolder + s, sConts);
    }
    plugin.ConsoleWrite("^b^1Folder and files created!^0^n");
    plugin.PRoConChat("^b^1Folder and files created!^0^n");
}

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

Originally Posted by MadDark_DK*:

 

Are you adding the Game Server Ip and RCON Port to the code?

If so, don't do that. Leave the code exactly as is, create an actual folder in your Procon layer's Plugins/BF4 folder, name that folder GAMESERVERIP_RCONPORT, e.g. if your game server IP is 127.0.0.1 and it's RCON port is 12345 then the folder name would be 127.0.0.1_12345

 

UPDATE:

 

You can use the following small limit to create the required folder and 5 MapListX.txt files.

 

After you activate, wait until you see the message Folder and files created! in Procon. Once the message is displayed, you may deactivate and delete this limit.

You will now find the GAMESERVERIP_RCONPORT folder in your Procon layer's Plugins\BF4 folder. Within this folder you will find 5 MapListX.txt template files, you will need to edit each of these files with your desired maps, modes and rounds.

 


Create Folder and Templates

 

Create a new limit to evaluate OnIntervalServer. Set the evaluation_interval to 10 seconds. Set action to None.

 

Set first_check to this Code:

Code:

String sFolder = "Plugins\\BF4\\" + server.Host + "_" + server.Port + "\\";
String[] sNames = { "MapList1.txt",
                    "MapList2.txt",
                    "MapList3.txt",
                    "MapList4.txt",
                    "MapList5.txt" };
String[] sConts = { "XP1_001 ConquestLarge0 1" };

if (!Directory.Exists(Path.GetDirectoryName(sFolder + sNames[0])))
{
    Directory.CreateDirectory(Path.GetDirectoryName(sFolder + sNames[0]));
    foreach (String s in sNames)
    {
        if (!File.Exists(sFolder + s)) File.WriteAllLines(sFolder + s, sConts);
    }
    plugin.ConsoleWrite("^b^1Folder and files created!^0^n");
    plugin.PRoConChat("^b^1Folder and files created!^0^n");
}

return false;
It´s give the same Error :sad: GAMESERVERIP_RCONPORT folder whit server ip and server Rcon is under plugin/bf4 and the 5 maplist.txt

 

I notes the insane limits says its NotCompiled. where the others plugins is Compiled ?

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