Jump to content

Insane Limits - Examples


Recommended Posts

Originally Posted by Singh400*:

 

Tried to put in battlelog SPM kicker with this first check expression: ( player.Spm > 1200 )

 

Was running in virtual mode and this player joined in, 1ManZ3rg - the limit kicked but didn't ban cause of virtual mode. Checking player stats, the SPM states 726 !!! Is the SPM even working ? I'm running the .8 patch 3 version.

The limit works fine, and that player has a SPM of 1571. His all-time SPM is 725.

 

You need to read ...*.

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

Originally Posted by Mandizzy*:

 

The limit works fine, and that player has a SPM of 1571. His all-time SPM is 725.

 

You need to read ...*.

Thanks Singh. BTW, how did you come up with 1571? Which numbers are you looking at?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by VuSniper*:

 

Yes you can. In that case, instead of checking for player count, you just check for what is the current map.

 

Set limit to evaluate OnInterval, and set action to None

 

Set first_check to use this Code snippet:

 

Code:

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

map_names.Add("MP_003");
map_names.Add("MP_011");

if (map_names.Contains(server.MapFileName))
   plugin.ServerCommand("vars.vehicleSpawnAllowed", "false");
else
  plugin.ServerCommand("vars.vehicleSpawnAllowed", "true");

return false;
For this example, vehicles will be disabled when map is "MP_003", or "MP_011", which are the files names for Tehran Highway, and Seine Crossing. For all other maps, the vehicles will be allowed.

 

This is the full list of map files names for BF3, (including Back to Karkand expansion)

 

  • MP_001 - Grand Bazaar
  • MP_003 - Teheran Highway
  • MP_007 - Caspian Border
  • MP_011 - Seine Crossing
  • MP_012 - Operation Firestorm
  • MP_013 - Damavand Peak
  • MP_017 -Noshahr Canals
  • MP_018 - Kharg Island
  • MP_Subway - Operation Metro
  • XP1_001 - Strike At Karkand
  • Xp1_002 - Gulf of Oman
  • XP1_003 - Sharqi Peninsula
  • XP1_004 - Wake Island

Note that since this only disables the vehicles after the map has loaded, the first set of vehicles might spawn. But, after that, they should not spawn anymore. I haven't tested it to verify, but I suspect that's what would happen.

 

Finally, this is just a very crude way of doing Per-Map settings. Sure it will work, but if there is already a plugin that specializes on that area, and already does the job well, you should use that.

Is there a way of setting difference between Conquest small and large on this?

 

=Vu= Sniper

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

Originally Posted by VuSniper*:

 

This limit will check for how many times a player made non-pistol kills. On the first kill, it will send a warning on chat, on the second kill, it will kick the player.

 

 

Set limit to evaluate OnKill, set action to None

 

 

Set first_check to this Expression:

 

Code:

! Regex.Match(kill.Weapon, @"(M1911|M9|M93R|Taurus|MP412REX|MP443|Glock)", RegexOptions.IgnoreCase).Success
Set second_check to this Code:

 

Code:

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

     if (count == 1)
         plugin.SendGlobalMessage(plugin.R("%p_n%, this is a pistol only server, do not use %w_n% again! Next time kick"));
     else if (count > 1)
         plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, kicked you for using %w_n% on pistol only server"));
     
     return false;
You can use this limit as a template for restricting any weapon you want. Just change the Expression in the first_check depending on what weapon you want to restrict. The way it is right now, it will activate for any Non-Pistol ... that is because of the Negation symbol "!" at the begining of the expression. If you remove, the Negation symbol "!", it becomes a positive check. So you could make it activate for certain weapons, and restrict those only, while allowing the rest.
I used this to limit Sniper-rifles. Working fine on most of them, but had an issue with M39 EMR and M98B. I discovered that Procon

displays "M39 Sniper Rifle" in chat, and game on-screen display "M39 EMR". NONE of them worked in limiter, but "M39" worked...

The M98B displays "Barrett M98B Sniper Rifle" (Procon-chat) and M98B (Game on-screen). I have tryed the following in limiter: M98, M98B, M98B Sniper Rifle and Barrett M98B Sniper Rifle without success.

Any idea what to use?

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

Originally Posted by WrathsWrath*:

 

I figured out how to put in the codes and expressions...good job btw. But now it keeps dumping my files. Everytime I come back into procon I have no insane limits...I have to accept the agreement and then start configuring all over...is this due to the location of the procon folder perhaps? I have it on my desktop.

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

Originally Posted by Singh400*:

 

NOTE: You must use a modified version of Insane Limits to use this limit. Get it ...*.

 

Set limit to evaluate OnJoin, set action to None.

 

Set first_check to this Code:

Code:

double avg_per = 10 ;
double p_ka = ( ( player.killAssists / player.Kills ) * 100 ) ; 

if ( p_ka < avg_per )
	{	
		plugin.Log("Logs/InsaneLimits_KAP.csv", plugin.R("%date%,%time%,%p_n%,%l_n%,%p_pg%," + p_ka + ""));
		
	}

return false;
What this limit does is look at a incoming players kill assists vs total kills. The average is around 10% for all players. There might be some variance anywhere between 8%-12%. The reason for this limit is that most cheaters will have an extremely low number of kill assists usually somewhere in the 0%-5% range when compared to their total kills.

 

Hence it's a good limit for Server Admins to use. At the moment it's only a logging limit (what I call a passive limit), I'd be hesitant to use it as active limit (ie kick/ban based on the outcome of the limit). Perhaps it can be refined further.

I'm using a slightly revised code. It has a better success rate at detecting potential cheaters:-

Code:

double avg_per = 5 ;

double p_ka = ( ( player.KillAssists / player.Kills ) * 100 ) ; 

if ( ( p_ka <= avg_per ) && ( player.Kills >= 1000 ) )
	{	
		plugin.Log("Logs/InsaneLimits_PKA2.csv", plugin.R("%date%,%time%,%p_n%,%l_n%,%p_pg%," + p_ka + "")) ;
	}

return false ;
With this I'm getting a 90-95% success rate for cheater detection. So you have to manually review each player profile before you issue a ban or anything like that.
* Restored post. It could be that the author is no longer active.
Link to comment
  • 4 weeks later...

Originally Posted by MDV666*:

 

I'm using a slightly revised code. It has a better success rate at detecting potential cheaters:-

Code:

double avg_per = 5 ;

double p_ka = ( ( player.KillAssists / player.Kills ) * 100 ) ; 

if ( ( p_ka <= avg_per ) && ( player.Kills >= 1000 ) )
	{	
		plugin.Log("Logs/InsaneLimits_PKA2.csv", plugin.R("%date%,%time%,%p_n%,%l_n%,%p_pg%," + p_ka + "")) ;
	}

return false ;
With this I'm getting a 90-95% success rate for cheater detection. So you have to manually review each player profile before you issue a ban or anything like that.
what do it to kick this players? and how to be with players who only started to play for the sniper? they have a percent of wounds always the small
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Xeffox*:

 

This limit will send a a Good Morning message to all players, between 7AM, and 8 AM ... after the first kill each round. The reason I did it, for OnKill is so that it guarantees that everyone has already loaded the map, and will see the message.

 

Set limit to evaluate OnKill, set action to Say

 

Set first_check to this Expression:

 

Code:

DateTime.Now.TimeOfDay.CompareTo(TimeSpan.FromHours(7)) > 0 && DateTime.Now.TimeOfDay.CompareTo(TimeSpan.FromHours(8)) < 0
Set second_check to this Expression:

 

Code:

limit.Activations() == 1
Set these action specific parameters:

 

Code:

say_audience = All
        say_message = Good morning everyone, the time is %time%!
This example depends, on the Time-Zone of the computer (layer) where the plugin is running. If that turns to be a problem, you should adjust the 7 AM, and 8 AM values to account for Time-Zones.

 

Also, the hours should be put in military time. 1 PM = 13, 2 PM = 14, etc ...

It is possible to add minutes? 5:36, 15:45, etc.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Itz_cujo666*:

 

Hi, I've just started using Insane Limits, and it's really great, very flexible. I'm finding it easy enough to understand and implement for things such as KDr, KPM and SPM monitors and some of the other examples here, but I have a problem with 2 of them I can't get working....

 

For some reason the timing of the Server First Blood and Announce Top Scoring Clan examples are incorrect when I try and implement them. Server First Blood is being announced at the very end of each round, and Announce Top Scoring Clan is being announced at the beginning of the round (meant to be at end)!

 

What am I doing incorrectly...any advice/help?

 

Thanks!

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

Originally Posted by HexaCanon*:

 

Hi, I've just started using Insane Limits, and it's really great, very flexible. I'm finding it easy enough to understand and implement for things such as KDr, KPM and SPM monitors and some of the other examples here, but I have a problem with 2 of them I can't get working....

 

For some reason the timing of the Server First Blood and Announce Top Scoring Clan examples are incorrect when I try and implement them. Server First Blood is being announced at the very end of each round, and Announce Top Scoring Clan is being announced at the beginning of the round (meant to be at end)!

 

What am I doing incorrectly...any advice/help?

 

Thanks!

you need to add few checks such as amount of tickets or round time.

 

if you give me the actual limit i can fix it for you.

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

Originally Posted by Itz_cujo666*:

 

Thanks very much, really appreciate it, I've cut past them below (sorry they aren't as neat, with bold and hyperlinks and all, but I'm new.. :smile::

 

While trying to get them to work, I found my game server provided has me running 0.0.0.6 of Insane Limits, seems most recent is 0.8, maybe that has impact?

 

from here, it seems to work, but fires at the end of each round.... *

 

So, did what the instructions for the example said and set evaluation on kill, with the action to say.

 

First check expression is set to: (true)

 

Second check expression is set to: limit.Activations() == 1

 

Say message (seems to work ok):

say_audience = All

say_message = %p_n% got first blood this round with a %w_n%!

 

I've managed to get a lot else working by playing around with the great examples provideded in this thread, a swear word filter, all sorts of filters above normal player stats, so really easy to use plug in, but these 2 just beat my very small ability...

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

Originally Posted by Itz_cujo666*:

 

example from here...*

 

We just run SQDM, so changed the first expression, I guess it's not working so well...? Maybe it just doesn't work with 4 squads? I also tweaked the second code, to change so it says top platoon, instead of clan. Since it's runnin in virtual, I see it firing in the parent layer control, and honestly speaking, I'm not convince the value for the winning platoon is correct, either...?

 

I followed instructions, so it evaluates on spawn, with no action selectedd.

 

First check expression:

(team1.RemainTicketsPercent

 

Second check code:

double count = limit.Activations();

 

if (count > 1)

return false;

 

List players = new List();

players.AddRange(team1.players);

players.AddRange(team2.players);

players.AddRange(team3.players);

players.AddRange(team4.players);

Dictionary clan_stats = new Dictionary();

 

/* Collect clan statistics */

foreach(PlayerInfoInterface player_info in players)

{

if(player_info.Tag.Length == 0)

continue;

 

if (!clan_stats.ContainsKey(player_info.Tag))

clan_stats.Add(player_info.Tag, 0);

 

clan_stats[player_info.Tag] += player_info.ScoreRound;

}

 

/* Find the best scoring clan */

String best_clan = String.Empty;

double best_score = 0;

 

foreach(KeyValuePair pair in clan_stats)

if (pair.Value > best_score)

{

best_clan = pair.Key;

best_score = pair.Value;

}

 

if (best_clan.Length > 0)

{

String message = "TOP PLATOON this round is ["+ best_clan + "] with " + best_score + " points!";

plugin.SendGlobalMessage(message);

plugin.ConsoleWrite(message);

}

return false;

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

Originally Posted by PapaCharlie9*:

 

Is there a way to use vars.vehicleSpawnDelay 99999 instead of vars.vehicleSpawnAllowed for this limit? I don't want the server to switch to custom when using vars.vehicleSpawnAllowed.

The Examples thread is for old examples only. Please posts your requests here:

 

www.phogue.net/forumvb/showth...imits-Requests*

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

Originally Posted by CPx4*:

 

Armored Kill

 

An update for the "@ShowNext" command (by Fruity & Singh400). I made my own modifications. (See my earlier post in this thread here*)

 

 

Add to the 'maps' section:

Code:

Maps.Add("XP3_Desert","Bandar Desert");
Maps.Add("XP3_Alborz","Alborz Mountains");
Maps.Add("XP3_Shield","Armored Shield");
Maps.Add("XP3_Valley","Death Valley");
Add to the 'modes' section:

Code:

Modes.Add("TankSuperiority0","Tank Superiority");
- CPx4
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Singh400*:

 

Armored Kill

 

An update for the "@ShowNext" command (by Fruity & Singh400). I made my own modifications. (See my earlier post in this thread here*)

 

 

Add to the 'maps' section:

Code:

Maps.Add("XP3_Desert","Bandar Desert");
Maps.Add("XP3_Alborz","Alborz Mountains");
Maps.Add("XP3_Shield","Armored Shield");
Maps.Add("XP3_Valley","Death Valley");
Add to the 'modes' section:

Code:

Modes.Add("TankSuperiority0","Tank Superiority");
- CPx4
https://github.com/Singh400/insane-l...xt-Map-Command :ohmy:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by HexaCanon*:

 

Crap! When did Armored Kill come out? Is this a Premium early access thing? I have to get my server updated.

 

Why do these things always come out when I have a ton of real-life work?

it is out on PS3 only, PC is 11th of sep.
* Restored post. It could be that the author is no longer active.
Link to comment
  • 2 weeks later...

Originally Posted by Greek*:

 

This limit allows players to use In-Game command "!votekick ". Players can vote as many times they want, and against as many players they want. The are no time or concurrency restrictions. However, votes are only counted once (you can only vote once against a certain player). If any player accumulates votes from more than 50% of all players in the server, that player is kicked. All votes are reset at the end of a round. The player name does not have to be a full-name. It can be a sub-string or misspelled name.

 

Set limit to evaluate OnAnyChat, set action to None

 

Set first_check to this Code

Code:

double percent = 50;

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-kick */
if (!kickMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;
    
if (target.Name.Equals(player.Name))
{
    plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, you cannot vote-kick yourself!"));
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("votekick"))
    player.DataRound.setObject("votekick", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("votekick"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1)
   plugin.SendGlobalMessage(target.Name + " is about to get vote-kicked, 1 more vote needed");
else if (remain > 0)
   plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"));

if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");

if (votes >= needed)
{
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    String message = target.Name + " was vote-kicked " + count ;
    plugin.SendGlobalMessage(message);
    plugin.ConsoleWrite(message);
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
    return true;
}

return false;
is there a way to create a white list so players are not able to kick certain players (like admins or clan members)? thanks
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by HexaCanon*:

 

is there a way to create a white list so players are not able to kick certain players (like admins or clan members)? thanks

Code:
double percent = 50;

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-kick */
if (!kickMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;

if (plugin.isInList(target.Name, "[b]List_Name[/b]")) {
    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick " + target.Name), "player" , player.Name ) ;
    return false; }
    
if (target.Name.Equals(player.Name))
{
    plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, you cannot vote-kick yourself!"));
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("votekick"))
    player.DataRound.setObject("votekick", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("votekick"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1)
   plugin.SendGlobalMessage(target.Name + " is about to get vote-kicked, 1 more vote needed");
else if (remain > 0)
   plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"));

if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");

if (votes >= needed)
{
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    String message = target.Name + " was vote-kicked " + count ;
    plugin.SendGlobalMessage(message);
    plugin.ConsoleWrite(message);
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
    return true;
}

return false;
replace the List_name (red part) with the name of player list you want to not be able to being kicked (note you can add more than one list if you want tell me if you dont know how to).

 

it will send to the play who request a vote kick a message (player.Name, you cannot vote-kick " + target.Name)

 

you can modify the message or even add a punishment such as kill.

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

Originally Posted by Greek*:

 

Code:

double percent = 50;

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-kick */
if (!kickMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;

if (plugin.isInList(target.Name, "[b]List_Name[/b]")) {
    plugin.ServerCommand ( "admin.say" , plugin.R("player.Name, you cannot vote-kick " + target.Name), "player" , player.Name ) ;
    return false; }
    
if (target.Name.Equals(player.Name))
{
    plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, you cannot vote-kick yourself!"));
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("votekick"))
    player.DataRound.setObject("votekick", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("votekick"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1)
   plugin.SendGlobalMessage(target.Name + " is about to get vote-kicked, 1 more vote needed");
else if (remain > 0)
   plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"));

if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");

if (votes >= needed)
{
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    String message = target.Name + " was vote-kicked " + count ;
    plugin.SendGlobalMessage(message);
    plugin.ConsoleWrite(message);
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
    return true;
}

return false;
replace the List_name (red part) with the name of player list you want to not be able to being kicked (note you can add more than one list if you want tell me if you dont know how to).

 

it will send to the play who request a vote kick a message (player.Name, you cannot vote-kick " + target.Name)

 

you can modify the message or even add a punishment such as kill.

how can I add a KICK as a punishment for starting a voteckick against server admins/members and also send a global message? thanks for your help
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by HexaCanon*:

 

how can I add a KICK as a punishment for starting a voteckick against server admins/members and also send a global message? thanks for your help

Code:
double percent = 50;

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-kick */
if (!kickMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;

if (plugin.isInList(target.Name, "List_Name")) {
    [b]ADD ACTION HERE[/b]
    return false; }
    
if (target.Name.Equals(player.Name))
{
    plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, you cannot vote-kick yourself!"));
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("votekick"))
    player.DataRound.setObject("votekick", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("votekick"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1)
   plugin.SendGlobalMessage(target.Name + " is about to get vote-kicked, 1 more vote needed");
else if (remain > 0)
   plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"));

if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");

if (votes >= needed)
{
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    String message = target.Name + " was vote-kicked " + count ;
    plugin.SendGlobalMessage(message);
    plugin.ConsoleWrite(message);
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
    return true;
}

return false;
in the red "ADD ACTION HERE"

 

for killing votekick user add

Code:

plugin.KillPlayer(player.Name);
for global message add

Code:

message = plugin.R("%p_n%, you can not votekick an admin"); // edit text between "" // %p_n% is the name of the votekick user.
plugin.SendGlobalMessage(message);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

This limit allows players to use In-Game command "!votekick ". Players can vote as many times they want, and against as many players they want. The are no time or concurrency restrictions. However, votes are only counted once (you can only vote once against a certain player). If any player accumulates votes from more than 50% of all players in the server, that player is kicked. All votes are reset at the end of a round. The player name does not have to be a full-name. It can be a sub-string or misspelled name.

 

Set limit to evaluate OnAnyChat, set action to None

 

Set first_check to this Code

Code:

double percent = 50;

/* Verify that it is a command */
if (!plugin.IsInGameCommand(player.LastChat))
    return false;

/* Extract the command */
String command = plugin.ExtractInGameCommand(player.LastChat);

/* Sanity check the command */
if (command.Length == 0)
    return false;
    
/* Parse the command */
Match kickMatch = Regex.Match(command, @"^votekick\s+([^ ]+)", RegexOptions.IgnoreCase);

/* Bail out if not a vote-kick */
if (!kickMatch.Success)
    return false;
    
/* Extract the player name */
PlayerInfoInterface target = plugin.GetPlayer(kickMatch.Groups[1].Value.Trim(), true);

if (target == null)
    return false;
    
if (target.Name.Equals(player.Name))
{
    plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, you cannot vote-kick yourself!"));
    return false;
}
    
/* Account the vote in the voter's dictionary */
/* Votes are kept with the voter, not the votee */
/* If the voter leaves, his votes are not counted */

if (!player.DataRound.issetObject("votekick"))
    player.DataRound.setObject("votekick", new Dictionary<String, bool>());

Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("votekick");

if (!vdict.ContainsKey(target.Name))
    vdict.Add(target.Name, true);


/* Tally the votes against the target player */
double votes = 0;
List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
all.AddRange(team1.players);
all.AddRange(team2.players);
all.AddRange(team3.players);
all.AddRange(team4.players);

foreach(PlayerInfoInterface p in all)
    if (p.DataRound.issetObject("votekick"))
    {
       Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("votekick");
       if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
           votes++;
    }

if (all.Count == 0)
    return false;
    
int needed = (int) Math.Ceiling((double) all.Count * (percent/100.0));
int remain = (int) ( needed - votes);

if (remain == 1)
   plugin.SendGlobalMessage(target.Name + " is about to get vote-kicked, 1 more vote needed");
else if (remain > 0)
   plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("player.Name, your vote against " + target.Name + " was counted, " + remain + " more needed to kick"));

if (remain > 0)
    plugin.ConsoleWrite(player.Name + ", is trying to vote-kick " + target.Name + ", " + remain + " more votes needed");

if (votes >= needed)
{
    String count = "with " + votes + " vote" + ((votes > 1)_"s":"");
    String message = target.Name + " was vote-kicked " + count ;
    plugin.SendGlobalMessage(message);
    plugin.ConsoleWrite(message);
    plugin.KickPlayerWithMessage(target.Name, target.Name + ", you were vote-kicked from the server " + count);
    return true;
}

return false;
i have 2 questions,

 

does the voting count for the team or whole server?

 

if i change the percentage to like 25% in the first line, how will that effect the voting ie 25% of votes yes vs votes no OR 25% votes yes overall by side/server (i guess the side/server will be answered in my first question)

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

Originally Posted by HexaCanon*:

 

Wie ist der Code für Simple Rank Limit, ab 90>?

Stehe etwas auf dem Schlauch, oder bin zu doof!

 

What is the code for Simple Rank limit, from 90>?

'm Somewhat at a loss, or am too stupid!

Dies ist für Rang über 90

 

Code:

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




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