Jump to content

Insane Limits - Examples


ImportBot

Recommended Posts

Originally Posted by Nazra7*:

 

PISTOLS ONLY SERVER STARTER script

 

onKill

 

Code:

! Regex.Match(kill.Weapon, @"(Melee|Knife|M1911|M9|M93R|Taurus|MP412REX|MP443|Glock)", RegexOptions.IgnoreCase).Success
1st check expression

 

Code:

double count = limit.Activations(player.Name);
 List<String> warn = new List<String>();
warn.Add("%p_n%, this is a pistol only server, until populated to 5v5!");
warn.Add("We are doing Pistols till we get more people in the server! %p_n% !");
warn.Add("Last WARNING: %p_n%, You will be kicked!");
int level = 2;
try {
	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}
int next = Convert.ToInt32(limit.ActivationsTotal());

next = next % warn.Count; // Ensure rotation of messages
String msg = plugin.R(warn[next]);

    if (server.PlayerCount<10&&count >= 1)
         plugin.KillPlayer(player.Name);
    else if (server.PlayerCount<10&&count == 4)
         plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked you for using %w_n% on pistol only server"));
    plugin.ServerCommand("admin.yell", msg);
return false;
1st check Code

 

 

works good kill/warn up till 4th then kicks on the 4th violation

 

What I could use would be a toggle or true/false {ingame command} that admins could use to turn it on/off.

anybody have any suggestions.

* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 1.4k
  • Created
  • Last Reply

Originally Posted by Singh400*:

 

So how can i log # commands?

As I explained in my reply to your PM, I don't know. What exactly are you trying to log? I don't know of any admin actions that being with #
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by philipp378*:

 

As I explained in my reply to your PM, I don't know. What exactly are you trying to log? I don't know of any admin actions that being with #

If i want all to see that i banned cheater i will use "#", and all will see that NAME was banned for CHEATER. If i don't use # only i will know, that i have banned anybody...
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by KoM_Simon*:

 

PISTOLS ONLY SERVER STARTER script

 

onKill

 

Code:

! Regex.Match(kill.Weapon, @"(Melee|Knife|M1911|M9|M93R|Taurus|MP412REX|MP443|Glock)", RegexOptions.IgnoreCase).Success
1st check expression

 

Code:

double count = limit.Activations(player.Name);
 List<String> warn = new List<String>();
warn.Add("%p_n%, this is a pistol only server, until populated to 5v5!");
warn.Add("We are doing Pistols till we get more people in the server! %p_n% !");
warn.Add("Last WARNING: %p_n%, You will be kicked!");
int level = 2;
try {
	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}
int next = Convert.ToInt32(limit.ActivationsTotal());

next = next % warn.Count; // Ensure rotation of messages
String msg = plugin.R(warn[next]);

    if (server.PlayerCount<10&&count >= 1)
         plugin.KillPlayer(player.Name);
    else if (server.PlayerCount<10&&count == 4)
         plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked you for using %w_n% on pistol only server"));
    plugin.ServerCommand("admin.yell", msg);
return false;
1st check Code

 

 

works good kill/warn up till 4th then kicks on the 4th violation

 

What I could use would be a toggle or true/false {ingame command} that admins could use to turn it on/off.

anybody have any suggestions.

Loving this code so far, however it doesn't appear to kick players for me. Tested with several different players and they were able to rack up over 20 kills and never get kicked. Not a huge deal as it still kills them if they don't use the correct weapon, but a kick would be nice. Any ideas?

 

-Simon

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

Originally Posted by Singh400*:

 

If i want all to see that i banned cheater i will use "#", and all will see that NAME was banned for CHEATER. If i don't use # only i will know, that i have banned anybody...

If you are using the In-Game Admin Plugin in ProCon then you have the following values by default:-

 

! prefix. This prefix is public. So everyone can see it

 

@ prefix. This prefix is completely private. So only you can see it.

 

# prefix. This prefix will only be shown to other admins in the sever.

 

You can change # to ? and it will be logged by the script. Like I said early, the code doesn't allow for # prefix beause of the way Insane Limits is coded. Changing the # to ? in In-Game Admin Plugin will remedy the problem.

 

Loving this code so far, however it doesn't appear to kick players for me. Tested with several different players and they were able to rack up over 20 kills and never get kicked. Not a huge deal as it still kills them if they don't use the correct weapon, but a kick would be nice. Any ideas?

 

-Simon

That code is modified version of ...* (which I assume is the original code)
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Nazra7*:

 

Loving this code so far, however it doesn't appear to kick players for me. Tested with several different players and they were able to rack up over 20 kills and never get kicked. Not a huge deal as it still kills them if they don't use the correct weapon, but a kick would be nice. Any ideas?

 

-Simon

Code:
double count = limit.Activations(player.Name);
 
String msg = plugin.R("%p_n%, this is a pistol only server, until populated to 5v5!");

    if (server.PlayerCount<10&&count > 1&&count < 4)
{
         plugin.KillPlayer(player.Name);
         plugin.ServerCommand("admin.yell", msg);
}
    else if (server.PlayerCount<10&&count > 4)
         plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked you for using %w_n% on pistol only server"));

return false;
made some fixes I noticed it yell whether the servercount went above 10 unless you include it into the if {}

took out round-robin for it had a global count whoops!

 

this is what im running currently with the changes >=1 4) after the kick check else if...

 

lemme know if it works

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

Originally Posted by KoM_Simon*:

 

Code:

double count = limit.Activations(player.Name);
 
String msg = plugin.R("%p_n%, this is a pistol only server, until populated to 5v5!");

    if (server.PlayerCount<10&&count > 1&&count < 4)
{
         plugin.KillPlayer(player.Name);
         plugin.ServerCommand("admin.yell", msg);
}
    else if (server.PlayerCount<10&&count > 4)
         plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked you for using %w_n% on pistol only server"));

return false;
made some fixes I noticed it yell whether the servercount went above 10 unless you include it into the if {}

took out round-robin for it had a global count whoops!

 

this is what im running currently with the changes >=1 4) after the kick check else if...

 

lemme know if it works

Looks much cleaner, however not only is it not kicking, now it's not killing either!!! :huh:

 

I get some of the code, but little changes and nuances escape me, no idea why it's not working. :sad:

 

 

-Simon

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

Originally Posted by PapaCharlie9*:

 

You can change # to ? and it will be logged by the script. Like I said early, the code doesn't allow for # prefix beause of the way Insane Limits is coded. Changing the # to ? in In-Game Admin Plugin will remedy the problem.

Unfortunately, changing to ? creates a new problem: it confuses Insane Limits into thinking the command is a stats request.

 

Here's a different version of the code you can use, philipp:

 

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 "#" */ 
Regex cmdMatch = Regex.Match(txt, @"^\s*[!@#](.*)$");
if (!cmdMatch.Success)
    return false;

txt = cmdMatch.Groups[1].Value;

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

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));
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Looks much cleaner, however not only is it not kicking, now it's not killing either!!! :huh:

 

I get some of the code, but little changes and nuances escape me, no idea why it's not working. :sad:

 

 

-Simon

Check at the top of the Plugin Settings for Insane Limits. You probably have it set to Virtual mode, which means kills and kicks are disabled. Also check to make sure the limit itself is Enabled (not Disabled or Virtual).

 

BTW, the code is missing some cases. Either the "count > 1" has to change to "count >= 1" or "count > 0" and the "count = 5".

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

Originally Posted by PapaCharlie9*:

 

Hi,

 

can i remove Jets from the maps, or kill everyone who uses a jet?

No and no. PRoCon only knows that a vehicle (any vehicle: tank, APC, jeep, jet, chopper, boat, MAV, Mortar, etc.) killed someone with "Death". They are all the same.

 

You can kill everyone that kills with any vehicle, but if you are going to do that, why not just turn vehicle spawns off in your server config?

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

Originally Posted by KoM_Simon*:

 

Check at the top of the Plugin Settings for Insane Limits. You probably have it set to Virtual mode, which means kills and kicks are disabled. Also check to make sure the limit itself is Enabled (not Disabled or Virtual).

 

BTW, the code is missing some cases. Either the "count > 1" has to change to "count >= 1" or "count > 0" and the "count = 5".

Changing the counts/cases made the difference, code is working exactly as expected!!! Below is what I am using and it's working great!!

 

 

Evaluation: OnKill

 

First Check - Expression:

 

Code:

! Regex.Match(kill.Weapon, @"(Melee|Knife|Repair&Tool|M1911|M9|Taurus|MP412REX|MP443|Glock|M40A5|Model98B|SV98|L96)", RegexOptions.IgnoreCase).Success
Second Check - Code:

 

Code:

double count = limit.Activations(player.Name);
 
String msg = plugin.R("%p_n%, this is a Knife, RT, Pistol, Bolt Action Sniper only server, until populated to 5v5!");

    if (server.PlayerCount<=9&&count >= 1&&count <= 2)
{
         plugin.KillPlayer(player.Name);
         plugin.ServerCommand("admin.yell", msg, "10", "player", player.Name);
}
    else if (server.PlayerCount<10&&count >= 3)
         plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked using %w_n% during Knife/RT/Pistol/BA Sniper Mode!"));

return false;
Also added a reminder message:

 

Evaluation: OnSpawn

 

First Check - Code:

 

Code:

if (server.PlayerCount<=9)
    plugin.ServerCommand("admin.yell", "Server is Knife, RT, Pistols & Bolt Action Snipers, Until 5v5!!", "10", "player", player.Name );
return false;
One last question, is it possible to code in that if a player, that has been kicked, rejoins and makes a kill with an unapproved weapon that it would ban that player for the remainder of the round, or at least a set period of time? This would help with those pesky trolls.

 

Thanks again for all the help!!!

 

 

-Simon

 

 

P.S. - Of course I wasn't in virtual mode and the limit was enabled, it purely a code issue, one I didn't understand.

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

Originally Posted by Singh400*:

 

Unfortunately, changing to ? creates a new problem: it confuses Insane Limits into thinking the command is a stats request.

 

Here's a different version of the code you can use, philipp:

 

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 "#" */ 
Regex cmdMatch = Regex.Match(txt, @"^\s*[!@#](.*)$");
if (!cmdMatch.Success)
    return false;

txt = cmdMatch.Groups[1].Value;

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

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));
Ahhh I see. Where can I read up on the Regex function?

 

I did try experimenting with commands.Add("#kill"); (which I guess is more of a hack/workaround) but it worked fine.

 

I also did:

Code:

if (txt[0] == '#' )
Which worked great, but then it broke the logging feature :sad:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Nazra7*:

 

Changing the counts/cases made the difference, code is working exactly as expected!!! Below is what I am using and it's working great!!

 

 

Evaluation: OnKill

 

First Check - Expression:

 

Code:

! Regex.Match(kill.Weapon, @"(Melee|Knife|Repair&Tool|M1911|M9|Taurus|MP412REX|MP443|Glock|M40A5|Model98B|SV98|L96)", RegexOptions.IgnoreCase).Success
Second Check - Code:

 

Code:

double count = limit.Activations(player.Name);
 
String msg = plugin.R("%p_n%, this is a Knife, RT, Pistol, Bolt Action Sniper only server, until populated to 5v5!");

    if (server.PlayerCount<=9&&count >= 1&&count <= 2)
{
         plugin.KillPlayer(player.Name);
         plugin.ServerCommand("admin.yell", msg, "10", "player", player.Name);
}
    else if (server.PlayerCount<10&&count >= 3)
         plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked using %w_n% during Knife/RT/Pistol/BA Sniper Mode!"));

return false;
Also added a reminder message:

 

Evaluation: OnSpawn

 

First Check - Code:

 

Code:

if (server.PlayerCount<=9)
    plugin.ServerCommand("admin.yell", "Server is Knife, RT, Pistols & Bolt Action Snipers, Until 5v5!!", "10", "player", player.Name );
return false;
One last question, is it possible to code in that if a player, that has been kicked, rejoins and makes a kill with an unapproved weapon that it would ban that player for the remainder of the round, or at least a set period of time? This would help with those pesky trolls.

 

Thanks again for all the help!!!

 

 

-Simon

 

 

P.S. - Of course I wasn't in virtual mode and the limit was enabled, it purely a code issue, one I didn't understand.

Must've of been the less than equal to that goofed it up!!!

 

~nice bit of coding Simon, Im gunna borrow this one to use on our server.

 

Code:

plugin.ServerCommand("admin.yell", msg, "10", "player", player.Name);
What's the "10", "player" do?

 

ps and you could set the tempban rather than kick since a troll would test it 5 times in a row anyways!

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

Originally Posted by KoM_Simon*:

 

Must've of been the less than equal to that goofed it up!!!

 

~nice bit of coding Simon, Im gunna borrow this one to use on our server.

 

Code:

plugin.ServerCommand("admin.yell", msg, "10", "player", player.Name);
What's the "10", "player" do?

 

ps and you could set the tempban rather than kick since a troll would test it 5 times in a row anyways!

Thanks for the complement on the code, but it wasn't me... In fact i think it was you!!!!!!!! I just customized it a bit to fit my server better.

 

As Singh400 Stated the 10 is is number of seconds delayed and, if i understand it correctly, having "player" followed by player.Name (, "player", player.Name )) makes it yell to only that player.

 

Tempban right off the bat may be a bit much, but on the other hand you are right, trolls will be trolls.

 

Thanks again for all the help!!!

 

-Simon

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

Originally Posted by slapnuaround*:

 

i need some help to get insane limits working errors logging is on 09:59:46 45] [insane Limits] Thread(fetch): getting battlelog stats for I_Use_Dart_Sorry, no more players in queue

[09:59:46 45] [insane Limits] Thread(fetch): EXCEPTION: : System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[09:59:46 45] [insane Limits] Thread(fetch): Extra information dumped in file InsaneLimits.dump

[09:59:46 46] [insane Limits] Thread(fetch): WARNING: unable to dump extra exception information.

[09:59:46 46] [insane Limits] Thread(fetch): EXCEPTION: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[09:59:46 46] [insane Limits] Thread(fetch): done fetching stats, 32 players in new batch, waiting for players list now

[09:59:49 45] [insane Limits] Thread(fetch): Queue exhausted, will insert now a batch of 32 players

[09:59:49 45] [insane Limits] Thread(fetch): no new players, will wait

[10:01:45 52] [insane Limits] Thread(settings): ERROR: file InsaneLimits.conf does not exist

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

Originally Posted by philipp378*:

 

If you are using the In-Game Admin Plugin in ProCon then you have the following values by default:-

 

! prefix. This prefix is public. So everyone can see it

 

@ prefix. This prefix is completely private. So only you can see it.

 

# prefix. This prefix will only be shown to other admins in the sever.

 

You can change # to ? and it will be logged by the script. Like I said early, the code doesn't allow for # prefix beause of the way Insane Limits is coded. Changing the # to ? in In-Game Admin Plugin will remedy the problem.

 

That code is modified version of ...* (which I assume is the original code)

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

Originally Posted by slapnuaround*:

 

I am still seeing that message maybe i didnt download the right zip the correct zip would be great there are like 4 or 5 in that list

I understood! Thanks!

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

Originally Posted by Singh400*:

 

i need some help to get insane limits working errors logging is on 09:59:46 45] [insane Limits] Thread(fetch): getting battlelog stats for I_Use_Dart_Sorry, no more players in queue

[09:59:46 45] [insane Limits] Thread(fetch): EXCEPTION: : System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[09:59:46 45] [insane Limits] Thread(fetch): Extra information dumped in file InsaneLimits.dump

[09:59:46 46] [insane Limits] Thread(fetch): WARNING: unable to dump extra exception information.

[09:59:46 46] [insane Limits] Thread(fetch): EXCEPTION: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[09:59:46 46] [insane Limits] Thread(fetch): done fetching stats, 32 players in new batch, waiting for players list now

[09:59:49 45] [insane Limits] Thread(fetch): Queue exhausted, will insert now a batch of 32 players

[09:59:49 45] [insane Limits] Thread(fetch): no new players, will wait

[10:01:45 52] [insane Limits] Thread(settings): ERROR: file InsaneLimits.conf does not exist

Does your ProCon Layer Host have full read/write access? It looks like a permission issue.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by slapnuaround*:

 

this is the new one . d in file InsaneLimits.dump

[10:30:39 97] [insane Limits] WARNING: unable to dump extra exception information.

[10:30:39 97] [insane Limits] EXCEPTION: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[10:30:40 34] Basic In-Game Info Enabled!

[10:30:40 38] In-Game Admin Enabled!

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

Originally Posted by Singh400*:

 

this is the new one . d in file InsaneLimits.dump

[10:30:39 97] [insane Limits] WARNING: unable to dump extra exception information.

[10:30:39 97] [insane Limits] EXCEPTION: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[10:30:40 34] Basic In-Game Info Enabled!

[10:30:40 38] In-Game Admin Enabled!

...

Does your ProCon Layer Host have full read/write access? It looks like a permission issue.

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

Originally Posted by Nazra7*:

 

Im looking for a way our Junior Admins can turn this on/off with a !pistols command ingame or similiar true/false statement.

 

example...

 

admin with procon access kick,tban,maps but not parent layer access types:

 

/!pistols on

 

this sends a on parameter picked up in the limit that enables the limit.

 

/!pistols off

 

likewise disables the limit by way of a check...

 

 

Suppose you would have to use OnAnyChat expression... but supposing you could use a listener ---> to carry the variable to the other plugin.

 

PS been diggin through ingameadmin.inc for ideas...

 

Code:

new ExecutionRequirements(
                                ExecutionScope.Privileges,
                                Privileges.CanMovePlayers,
                                2,
                                confirmationCommand,
                                "You do not have enough privileges to move players"),
                            "Moves a player to a specific squad on the same team next death"
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Singh400*:

 

Im looking for a way our Junior Admins can turn this on/off with a !pistols command ingame or similiar true/false statement.

 

example...

 

admin with procon access kick,tban,maps but not parent layer access types:

 

/!pistols on

 

this sends a on parameter picked up in the limit that enables the limit.

 

/!pistols off

 

likewise disables the limit by way of a check...

 

 

Suppose you would have to use OnAnyChat expression... but supposing you could use a listener ---> to carry the variable to the other plugin.

 

PS been diggin through ingameadmin.inc for ideas...

 

Code:

new ExecutionRequirements(
                                ExecutionScope.Privileges,
                                Privileges.CanMovePlayers,
                                2,
                                confirmationCommand,
                                "You do not have enough privileges to move players"),
                            "Moves a player to a specific squad on the same team next death"
It's defintely do-able. Use ...* as an example to turn the limit off and on.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

One last question, is it possible to code in that if a player, that has been kicked, rejoins and makes a kill with an unapproved weapon that it would ban that player for the remainder of the round, or at least a set period of time? This would help with those pesky trolls.

In general, check out the first post of the Examples thread for an index of available examples. Then, check out all the separate example thread titles in this Plugin Enhancements forum (they all start with Insane Limits). There are a couple of examples that do something similar. Like this one:

 

www.phogue.net/forumvb/showth...0-RPG-USAS-etc*

 

or this one (the original, which has been much modified in other posts and threads, like the one above):

 

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

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

Originally Posted by PapaCharlie9*:

 

Ahhh I see. Where can I read up on the Regex function?

In general, I google: C# Class.FunctionName

 

or: C# Class.Property

 

Make sure you set the MSDN .Net version at the top of the destination page to 3.5.

 

The function doc in this case is only part of the story. The regular expression (regex) syntax is the other code you have to learn. There's a good list of links here (in the quote as well as in the post):

 

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

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

Originally Posted by PapaCharlie9*:

 

It's defintely do-able. Use ...* as an example to turn the limit off and on.

Right. Don't look in InGameAdmin.inc. Look in examples like the one Singh link. The mechanism for one limit talking to another is Data or RoundData, as in plugin.Data or server.RoundData.

 

The general pattern is:

 

In OnAnyChat:

 

Code:

String kUniqueName = "unique key name for this value"; // copy this to other limits verbatim!

if (... chat matches turn-on command ...) {
    plugin.Data.setBool(kUniqueName, true);
}

if (... chat matches turn-off command ...) {
    plugin.Data.setBool(kUniqueName, false);
}
Then in the limit that does something, like OnKill or OnIntervalServer:

 

Code:

String kUniqueName = "unique key name for this value"; // copy this to other limits verbatim!

bool isEnabled = false;

if (plugin.Data.issetBool(kUniqueName)) isEnabled = plugin.Data.getBool(kUniqueName);

if (!isEnabled) return false; // do nothing

//... otherwise, do whatever
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Nazra7*:

 

Right. Don't look in InGameAdmin.inc. Look in examples like the one Singh link. The mechanism for one limit talking to another is Data or RoundData, as in plugin.Data or server.RoundData.

 

The general pattern is:

 

In OnAnyChat:

 

Code:

String kUniqueName = "unique key name for this value"; // copy this to other limits verbatim!

if (... chat matches turn-on command ...) {
    plugin.Data.setBool(kUniqueName, true);
}

if (... chat matches turn-off command ...) {
    plugin.Data.setBool(kUniqueName, false);
}
Then in the limit that does something, like OnKill or OnIntervalServer:

 

Code:

String kUniqueName = "unique key name for this value"; // copy this to other limits verbatim!

bool isEnabled = false;

if (plugin.Data.issetBool(kUniqueName)) isEnabled = plugin.Data.getBool(kUniqueName);

if (!isEnabled) return false; // do nothing

//... otherwise, do whatever
K got this far now to talk to the other limit... :/

Code:

/* Version: V0.8/R4
!pistols (on|off)
- With arguments, enable/disable the automatic server starter.
- Without arguments, sends the current state to chat.
*/
String admins = "admins"; // Define the name of your admins list here
String kPistols = "pistols"; // plugin.Data
String msg = "none";
int level = 2;

try {
    level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

Match d0Match = Regex.Match(player.LastChat, @"pistols\s*$", RegexOptions.IgnoreCase);
Match d1Match = Regex.Match(player.LastChat, @"pistols\s+(on|off|1|0|true|false)", RegexOptions.IgnoreCase);

/* !pistols command with no arguments */

if (d0Match.Success) {
	// Report enabled/disabled
	if (!plugin.Data.issetBool(kPistols)) {
		plugin.Data.setBool(kPistols, false);
	}
	bool isPistolsEnabled = plugin.Data.getBool(kPistols);
	if (isPistolsEnabled) {
		msg = "*** Insane Limits pistols mode is:\n*** ON!";
	} else {
		msg = "*** Insane Limits pistols mode is:\n*** OFF!";
	}
	plugin.SendGlobalMessage(msg);
	plugin.PRoConChat( "ADMIN > " + msg);
	return false;
}

/* !pistols command with arguments */

if (d1Match.Success) {
	
	if (!plugin.isInList(player.Name, admins))
	{
		if (level >= 2) plugin.ConsoleWrite(player.Name + " not authorized to use !pistols command.");
		msg = "*** You are not authorized to change the pistols!";
		plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
		plugin.PRoConChat( "ADMIN > " + msg);
		return false;
	}
	// Enable/Disable
	String state = "OFF!";
	if (!plugin.Data.issetBool(kPistols)) {
		plugin.Data.setBool(kPistols, false);
	} else if (Regex.Match(d1Match.Groups[1].Value, "(on|1|true)", RegexOptions.IgnoreCase).Success) {
		plugin.Data.setBool(kPistols, true);
		state = "ON!";
	} else {
		plugin.Data.setBool(kPistols, false);
	}
	msg = "*** Insane Limits squad pistols mode is:\n***" + state;
	plugin.SendGlobalMessage(msg);
	plugin.PRoConChat( "ADMIN > " + msg);
	return false;
}

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

Originally Posted by Nazra7*:

 

PISTOLS, SNIPERS, REPAIR TOOL ~ SERVER STARTER

with ingame admin controls!

{create a custom admin list for this to work} - name admins

 

1st Limit - Listener

OnAnyChat

expression

Code:

(Regex.Match(player.LastChat, @"^\s*[!](_:pistols)", RegexOptions.IgnoreCase).Success)
code

Code:

/* Version: V0.8/R4
!pistols (on|off)
- With arguments, enable/disable the automatic server starter.
- Without arguments, sends the current state to chat.
*/
String admins = "admins"; // Define the name of your admins list here
String kPistols = "pistols"; // plugin.Data
String msg = "none";
int level = 2;

try {
    level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

Match d0Match = Regex.Match(player.LastChat, @"pistols\s*$", RegexOptions.IgnoreCase);
Match d1Match = Regex.Match(player.LastChat, @"pistols\s+(on|off|1|0|true|false)", RegexOptions.IgnoreCase);

/* !pistols command with no arguments */

if (d0Match.Success) {
	// Report enabled/disabled
	if (!plugin.Data.issetBool(kPistols)) {
		plugin.Data.setBool(kPistols, false);
	}
	bool isPistolsEnabled = plugin.Data.getBool(kPistols);
	if (isPistolsEnabled) {
		msg = "*** Insane Limits pistols mode is:\n*** ON!";
	} else {
		msg = "*** Insane Limits pistols mode is:\n*** OFF!";
	}
	plugin.SendGlobalMessage(msg);
	plugin.PRoConChat( "ADMIN > " + msg);
	return false;
}

/* !pistols command with arguments */

if (d1Match.Success) {
	
	if (!plugin.isInList(player.Name, admins))
	{
		if (level >= 2) plugin.ConsoleWrite(player.Name + " not authorized to use !pistols command.");
		msg = "*** You are not authorized to change the pistols!";
		plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
		plugin.PRoConChat( "ADMIN > " + msg);
		return false;
	}
	// Enable/Disable
	String state = "OFF!";
	if (!plugin.Data.issetBool(kPistols)) {
		plugin.Data.setBool(kPistols, false);
	} else if (Regex.Match(d1Match.Groups[1].Value, "(on|1|true)", RegexOptions.IgnoreCase).Success) {
		plugin.Data.setBool(kPistols, true);
		state = "ON!";
	} else {
		plugin.Data.setBool(kPistols, false);
	}
	msg = "*** Insane Limits pistols mode is:\n***" + state;
	plugin.SendGlobalMessage(msg);
	plugin.PRoConChat( "ADMIN > " + msg);
	return false;
}

return false;
2nd Limit - OnKill

expression

Code:

! Regex.Match(kill.Weapon, @"(Melee|Knife|Repair&Tool|M1911|M9|Taurus|MP412REX|MP443|Glock|M40A5|Model98B|SV98|L96)", RegexOptions.IgnoreCase).Success
code

Code:

String kPistols = "pistols";
if (!plugin.Data.issetBool(kPistols)) {
		plugin.Data.setBool(kPistols, false);
	}
	bool isPistolsEnabled = plugin.Data.getBool(kPistols);
if (server.PlayerCount<=9&&limit.Data.issetBool(player.Name)&&isPistolsEnabled)
  {
     plugin.SendGlobalMessage(plugin.R("%p_n% has been banned for using %w_n%, after a kick!"));
     plugin.PBBanPlayerWithMessage(PBBanDuration.Temporary, player.Name, 15, plugin.R("%p_n% you have been banned for 15 minutes for using %w_n%"));
     limit.Data.unsetBool(player.Name);
  }
  
  int count = (int) limit.Activations(player.Name);
   
  String msg = plugin.R("%p_n%, this is a Knife, RT, Pistol, Bolt Action Sniper only server, until populated to 5v5!");
	if (server.PlayerCount<=9&&isPistolsEnabled) 
{
		if (server.PlayerCount<=9&&count >= 1&&count <= 2&&isPistolsEnabled)
		{
			plugin.KillPlayer(player.Name);
			plugin.ServerCommand("admin.yell", msg, "10", "player", player.Name);
		}
}	
else if (server.PlayerCount<=9&&count >= 3&&isPistolsEnabled)
{     
	plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked using %w_n% during Knife/RT/Pistol/BA Sniper Mode!"));
	if (!limit.Data.issetBool(player.Name))
    limit.Data.setBool(player.Name, true);
}

return false;
3rd Limit - OnSpawn

first check code -

Code:

String kPistols = "pistols";
if (!plugin.Data.issetBool(kPistols)) {
		plugin.Data.setBool(kPistols, false);
	}
	bool isPistolsEnabled = plugin.Data.getBool(kPistols);
	if (server.PlayerCount<=9&&isPistolsEnabled) {
		plugin.ServerCommand("admin.yell", "Server is Knife, RT, Pistols & Bolt Action Snipers, Until 5v5!!", "10", "player", player.Name );
	} else {
	;
	}
	
	return false;
* 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.