Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

Originally Posted by HexaCanon*:

 

How can I add a "white list" with players excluded from that limit ?

in procon make a list and name it "White_List", and add the names you want in them.

 

use this expression

 

Code:

(  player.Kdr > 4.0   ||  player.Accuracy > 50  ) && !plugin.isInList(player.Name, "White_List")
* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 3.2k
  • Created
  • Last Reply

Originally Posted by shadow2k1*:

 

can someone tell me how i can go about making a shame list?

its for inner clan humor really and i would like it to work like the yell next map announcer code

where a player would type in

!douchebag

and a list would pop up with some names on it

 

thanks

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

Originally Posted by HexaCanon*:

 

can someone tell me how i can go about making a shame list?

its for inner clan humor really and i would like it to work like the yell next map announcer code

where a player would type in

!douchebag

and a list would pop up with some names on it

 

thanks

can do it if you give me more details on exactly how you want it to run.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Rucki*:

 

end of round report for procon chat.

 

Posted Image

 

evaluation : OnRoundOver

 

first check expression

 

Code:

(true)
Code:
TimeSpan Duration = TimeSpan.FromSeconds(server.TimeRound);

---cut---
---Edit---

Here the working code wits "good game" and "bad game" from HexaCanon

 

Code:

TimeSpan Duration = TimeSpan.FromSeconds(server.TimeRound);
String winner = "US";
if (server.WinTeamId == 2) winner = "RU";

String kMaxPlayers = "PCT_max"; // PCT = Player Count Tracker
String kMinPlayers = "PCT_min";
String kPlayers = "PCT_players";
String kTime = "PCT_time";
String kMapRound = "PCT_map_round";

if (!server.Data.issetInt(kPlayers)) {
    server.Data.setInt(kPlayers, 0);
}
if (!server.RoundData.issetInt(kMaxPlayers)) {
    server.RoundData.setInt(kMaxPlayers, 0);
}
if (!server.RoundData.issetInt(kMinPlayers)) {
    server.RoundData.setInt(kMinPlayers, 64);
}
if (!server.RoundData.issetObject(kTime)) {
	server.RoundData.setObject(kTime, DateTime.Now);
}
if (!server.RoundData.issetString(kMapRound)) {
	server.RoundData.setString(kMapRound, server.MapFileName + server.CurrentRound.ToString());
}

int level = 2;

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

/* Check for change */

int lastPlayers = server.Data.getInt(kPlayers);
int currentPlayers = server.PlayerCount;


/* Calculate net change */

int maxPlayers = server.RoundData.getInt(kMaxPlayers);
int minPlayers = server.RoundData.getInt(kMinPlayers);

int netChange = currentPlayers - lastPlayers;

if (maxPlayers < currentPlayers) {
	server.RoundData.setInt(kMaxPlayers, currentPlayers);
	maxPlayers = currentPlayers;
}
if (minPlayers > currentPlayers) {
	server.RoundData.setInt(kMinPlayers, currentPlayers);
	minPlayers = currentPlayers;
}
server.Data.setInt(kPlayers, currentPlayers);
server.RoundData.setObject(kTime, DateTime.Now);

/* BF3 friendly map names, including B2K */
Dictionary<String, String> maps = new Dictionary<String, String>();
maps.Add("MP_001", "Grand Bazaar");
maps.Add("MP_003", "Teheran Highway");
maps.Add("MP_007", "Caspian Border");
maps.Add("MP_011", "Seine Crossing");
maps.Add("MP_012", "Operation Firestorm");
maps.Add("MP_013", "Damavand Peak");
maps.Add("MP_017", "Noshahr Canals");
maps.Add("MP_018", "Kharg Island");
maps.Add("MP_Subway", "Operation Metro");
maps.Add("XP1_001", "Strike at Karkand");
maps.Add("XP1_002", "Gulf of Oman");
maps.Add("XP1_003", "Sharqi Peninsula");
maps.Add("XP1_004", "Wake Island");
maps.Add("XP2_Factory", "Scrapmetal");
maps.Add("XP2_Office", "Operation 925");
maps.Add("XP2_Palace", "Donya Fortress");
maps.Add("XP2_Skybar", "Ziba Tower");
maps.Add("XP3_Desert", "Bandar Desert");
maps.Add("XP3_Alborz", "Alborz Mountains");
maps.Add("XP3_Shield", "Armored Shield");
maps.Add("XP3_Valley", "Death Valley");

/* BF3 friendly game modes, including B2K */
Dictionary<String, String> modes = new Dictionary<String, String>();    
modes.Add("ConquestLarge0", "CQ64");
modes.Add("ConquestSmall0", "CQ");
modes.Add("ConquestSmall1", "CQA");
modes.Add("RushLarge0", "Rush");
modes.Add("SquadRush0", "SQRush");
modes.Add("SquadDeathMatch0", "SQDM");
modes.Add("TeamDeathMatch0", "TDM");
modes.Add("Domination0", "CQD");
modes.Add("GunMaster0", "GM");
modes.Add("TeamDeathMatchC0", "TDMC");
modes.Add("TankSuperiority0", "TankS");

String mapName = (maps.ContainsKey(server.MapFileName)) _ maps[server.MapFileName] : server.MapFileName;
String modeName = (modes.ContainsKey(server.Gamemode)) _ modes[server.Gamemode] : server.Gamemode;
String color = (netChange >= 0) _ "^2+" : "^8";
String time = DateTime.Now.ToString("HH:mm:ss");
String currMapRound = server.MapFileName + server.CurrentRound.ToString();

String ticket = "US : " + team1.Tickets + "/" + server.TargetTickets + " | RU : " + team2.Tickets + "/" + server.TargetTickets;
if (server.Gamemode == "ConquestLarge0" ||
server.Gamemode == "ConquestSmall0" ||
server.Gamemode == "ConquestSmall1" ||
server.Gamemode == "Domination0" ||
server.Gamemode == "TankSuperiority0") ticket = "US : " + team1.Tickets  + " | RU : " + team2.Tickets ;
String tCheck = null;

if (server.WinTeamId == 1 &&
(server.Gamemode == "ConquestLarge0" ||
server.Gamemode == "ConquestSmall0" ||
server.Gamemode == "ConquestSmall1" ||
server.Gamemode == "Domination0" ||
server.Gamemode == "TankSuperiority0") &&
team1.Tickets <= 100) tCheck = "^8This was a ^2 ^bGood^8 ^n Game^0";
if (server.WinTeamId == 2 &&
(server.Gamemode == "ConquestLarge0" ||
server.Gamemode == "ConquestSmall0" ||
server.Gamemode == "ConquestSmall1" ||
server.Gamemode == "Domination0" ||
server.Gamemode == "TankSuperiority0") &&
team2.Tickets <= 100) tCheck = "^8This was a ^2 ^bGood^8 ^n Game^0";
if (server.WinTeamId == 1 &&
(server.Gamemode == "SquadDeathMatch0" ||
server.Gamemode == "TeamDeathMatch0" ||
server.Gamemode == "TeamDeathMatchC0") &&
(team1.Tickets - team2.Tickets) <= 50) tCheck = "^8This was a ^2 ^bGood^8 ^n Game^0";
if (server.WinTeamId == 2 &&
(server.Gamemode == "SquadDeathMatch0" ||
server.Gamemode == "TeamDeathMatch0" ||
server.Gamemode == "TeamDeathMatchC0") &&
(team2.Tickets - team1.Tickets) <= 50) tCheck = "^8This was a ^2 ^bGood^8 ^n Game^0";
if (server.WinTeamId == 1 &&
(server.Gamemode == "ConquestLarge0" ||
server.Gamemode == "ConquestSmall0" ||
server.Gamemode == "ConquestSmall1" ||
server.Gamemode == "Domination0" ||
server.Gamemode == "TankSuperiority0") &&
team1.Tickets > 100) tCheck = "^8This was a ^1 ^bBad^8 ^n Game^0";
if (server.WinTeamId == 2 &&
(server.Gamemode == "ConquestLarge0" ||
server.Gamemode == "ConquestSmall0" ||
server.Gamemode == "ConquestSmall1" ||
server.Gamemode == "Domination0" ||
server.Gamemode == "TankSuperiority0") &&
team2.Tickets > 100) tCheck = "^8This was a ^1 ^bBad^8 ^n Game^0";
if (server.WinTeamId == 1 &&
(server.Gamemode == "SquadDeathMatch0" ||
server.Gamemode == "TeamDeathMatch0" ||
server.Gamemode == "TeamDeathMatchC0") &&
(team1.Tickets - team2.Tickets) > 50) tCheck = "^8This was a ^1 ^bBad^8 ^n Game^0";
if (server.WinTeamId == 2 &&
(server.Gamemode == "SquadDeathMatch0" ||
server.Gamemode == "TeamDeathMatch0" ||
server.Gamemode == "TeamDeathMatchC0") &&
(team2.Tickets - team1.Tickets) > 50) tCheck = "^8This was a ^1 ^bBad^8 ^n Game^0";


List<String> LogLines = new List<String>();
LogLines.Add("^8Time : " + time +"^0");
LogLines.Add("^8Duration : " + Duration +"^0");
LogLines.Add("^8Map Name : " + mapName +"^0");
LogLines.Add("^8Mode Name : " + modeName +"^0");
LogLines.Add("^8Round : " + (server.CurrentRound+1) + "/" + server.TotalRounds +"^0");
LogLines.Add("^8winner : " + winner +"^0");
if (server.Gamemode == "ConquestLarge0" ||
server.Gamemode == "ConquestSmall0" ||
server.Gamemode == "ConquestSmall1" ||
server.Gamemode == "Domination0" ||
server.Gamemode == "TankSuperiority0" ||
server.Gamemode == "SquadDeathMatch0" ||
server.Gamemode == "TeamDeathMatch0" ||
server.Gamemode == "TeamDeathMatchC0") {
LogLines.Add("^8Tickets : " + ticket +"^0");
LogLines.Add(tCheck);}
LogLines.Add("^8Players : "  + currentPlayers + "/" + server.MaxPlayers +"^0");
LogLines.Add("^8Minimum players on round : " + minPlayers +"^0");
LogLines.Add("^8Maximum players on round : " + maxPlayers +"^0");

if (true) {
    plugin.PRoConChat("^8>>>>RoundOver Report<<<<^0");
    foreach(string Line in LogLines) {
        plugin.PRoConChat(Line);
    }
return false;
}
This is working perfect!

Thanks again!

 

And now, pls dont hit me HexaCanon! :mad:

 

What i am looking for:

If it was a "good game" ->

Twitter "This was a good game! Tickets: x/y"

 

If it was a "bad game" ->

Twitter nothing.

 

Thx,

Rucki

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

Originally Posted by shadow2k1*:

 

can do it if you give me more details on exactly how you want it to run.

hi,

I would like it to work the same way this yell next map code works

https://github.com/Singh400/insane-l...xt-Map-Command

 

the only difference is, when the command is entered it gives me a static list of player names

 

thanks for your help

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

Originally Posted by HexaCanon*:

 

hi,

I would like it to work the same way this yell next map code works

https://github.com/Singh400/insane-l...xt-Map-Command

 

the only difference is, when the command is entered it gives me a static list of player names

 

thanks for your help

on any chat

 

first check code

 

Code:

List<String> douchebags = new List<String>();
douchebags.Add("Player1Name");
douchebags.Add("Player2Name");
douchebags.Add("Player3Name");
douchebags.Add("Player4Name");
douchebags.Add("ETC..");



if (!Regex.Match(player.LastChat, @"^\s*!douchebags_", RegexOptions.IgnoreCase).Success) return false;

foreach(string douchebag in douchebags) {
plugin.SendGlobalMessage(douchebag);
plugin.ServerCommand("admin.yell", douchebag, "8", "player", player.Name);
}


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

Originally Posted by PapaCharlie9*:

 

Dear developer. Whether there is a possibility of determination of accuracy on the weapon of the player in a round? Using ShotsFired and ShotsHit?

No, that is not possible. That information is not available from the game server during a round.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by shadow2k1*:

 

on any chat

 

first check code

 

Code:

List<String> douchebags = new List<String>();
douchebags.Add("Player1Name");
douchebags.Add("Player2Name");
douchebags.Add("Player3Name");
douchebags.Add("Player4Name");
douchebags.Add("ETC..");



if (!Regex.Match(player.LastChat, @"^\s*!douchebags_", RegexOptions.IgnoreCase).Success) return false;

foreach(string douchebag in douchebags) {
plugin.SendGlobalMessage(douchebag);
plugin.ServerCommand("admin.yell", douchebag, "8", "player", player.Name);
}


return false;
shouldnt fist check be

 

Code:

player.LastChat.StartsWith("!douchbag")
and then your code?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

on any chat

 

first check code

 

Code:

foreach(string douchebag in douchebags) {
plugin.SendGlobalMessage(douchebag);
plugin.ServerCommand("admin.yell", douchebag, "8", "player", player.Name);
}
The yells will overwrite each other. It would work better to build up one message and just send it once.

 

Code:

String msg = "*** ";
bool first = true;
foreach(string douchebag in douchebags) {
    if (first) {
        msg = msg + douchebag;
        first = false;
    } else {
        msg = msg + "," + douchebag;
    }
}
plugin.SendGlobalMessage(msg);
plugin.ServerCommand("admin.yell", msg, "15", "player", player.Name);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Singh400*:

 

shouldnt fist check be

 

Code:

player.LastChat.StartsWith("!douchbag")
and then your code?
Doesn't have to be like that. Hexa's code using ! which means not equal to or something like that.

 

I would have just gone for:-

Code:

List<string> douchebags = new List<string>();
douchebags.Add("Player1Name");
douchebags.Add("Player2Name");
douchebags.Add("Player3Name");
douchebags.Add("Player4Name");

if (Regex.Match(player.LastChat, @"^\s*!douchebags_", RegexOptions.IgnoreCase).Success)
	{	
		foreach (string douchebag in douchebags) 
			{
				plugin.SendGlobalMessage(douchebag);
				plugin.ServerCommand("admin.yell", douchebag, "8", "player", player.Name);
			}
	}

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

Originally Posted by HexaCanon*:

 

The yells will overwrite each other. It would work better to build up one message and just send it once.

 

Code:

String msg = "*** ";
bool first = true;
foreach(string douchebag in douchebags) {
    if (first) {
        msg = msg + douchebag;
        first = false;
    } else {
        msg = msg + "," + douchebag;
    }
}
plugin.SendGlobalMessage(msg);
plugin.ServerCommand("admin.yell", msg, "15", "player", player.Name);
yeah, thats why i was asking him how exactly he wanted it. it was not clear and just give him an example.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Itz_cujo666*:

 

Hi,

 

I used this example limit* as a base.

 

I made minor modifications:

-changed timing

-modified so it works with 4 teams (we run SQDM)

-changed it so say only once.

 

How can I modify it so it works as is (say top scoring platoon only once), but also yells the top scoring platoon and it's members. example "Top Scoring platoon [XXX] - [XXX]playera, [XXX]playerb, [XXX]playerc", and so on...good if it's clear how to make it yell once, twice, or three times, depending on if I think it looks spammy...

 

Thanks if you can help, that's beyond my very small ability.. :smile:

-cujo

 

first check code

Code:

if (server.TimeRound < (3*60)) return false;
double t1 = 100;
double t2 = 100;
double t3 = 100;
double t4 = 100;
if (team1.players.Count > 0) t1 = team1.RemainTicketsPercent;
if (team2.players.Count > 0) t2 = team2.RemainTicketsPercent;
if (team3.players.Count > 0) t3 = team3.RemainTicketsPercent;
if (team4.players.Count > 0) t4 = team4.RemainTicketsPercent;

return(t1 < 8 || t2 < 8 || t3 < 8 || t4 < 8);
Second check code

Code:

double count = limit.Activations();
    
    if (count > 1)
        return false;

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

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

Originally Posted by aduh*:

 

in procon make a list and name it "White_List", and add the names you want in them.

 

use this expression

 

Code:

(  player.Kdr > 4.0   ||  player.Accuracy > 50  ) && !plugin.isInList(player.Name, "White_List")
Thank you
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by aduh*:

 

I have install Killers & Victims Tracker but it doesnt do anything beyond tracking.

I would like to compile new limit for announcing when a victim has been killed more than 10 times by a single player.

Any help please ?

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

Originally Posted by HexaCanon*:

 

Hi,

 

I used this example limit* as a base.

 

I made minor modifications:

-changed timing

-modified so it works with 4 teams (we run SQDM)

-changed it so say only once.

 

How can I modify it so it works as is (say top scoring platoon only once), but also yells the top scoring platoon and it's members. example "Top Scoring platoon [XXX] - [XXX]playera, [XXX]playerb, [XXX]playerc", and so on...good if it's clear how to make it yell once, twice, or three times, depending on if I think it looks spammy...

 

Thanks if you can help, that's beyond my very small ability.. :smile:

-cujo

 

first check code

Code:

if (server.TimeRound < (3*60)) return false;
double t1 = 100;
double t2 = 100;
double t3 = 100;
double t4 = 100;
if (team1.players.Count > 0) t1 = team1.RemainTicketsPercent;
if (team2.players.Count > 0) t2 = team2.RemainTicketsPercent;
if (team3.players.Count > 0) t3 = team3.RemainTicketsPercent;
if (team4.players.Count > 0) t4 = team4.RemainTicketsPercent;

return(t1 < 8 || t2 < 8 || t3 < 8 || t4 < 8);
Second check code

Code:

double count = limit.Activations();
    
    if (count > 1)
        return false;

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

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
	{
		String message = "TOP PLATOON this round is ["+ best_clan + "] with " + best_score + " points!";
                plugin.SendGlobalMessage(message); 
		plugin.ServerCommand("admin.yell", (message));
		plugin.ConsoleWrite(message);
        }   
    return false;
second check code

Code:

double count = limit.Activations();
    
    if (count > 1)
        return false;

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

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
	{
		String playerTag = best_clan;

	List<PlayerInfoInterface> clan = new List<PlayerInfoInterface>();

	foreach (PlayerInfoInterface p in players) {
		String clanTag = p.Tag;
		if (String.IsNullOrEmpty(clanTag)) continue;
		if (clanTag != playerTag) continue;
		// Found a clan member!
		clan.Add(p);
	}
	
	String msg = "*** ";
	bool first = true;
	foreach(string clan_member in clan) {
		if (first) {
			msg = msg + clan_member;
			first = false;
		} else {
			msg = msg + "," + clan_member;
		}
	}
		String message = "TOP PLATOON this round is ["+ best_clan + "] with " + best_score + " points!";
                plugin.SendGlobalMessage(message);
				foreach(string clan_member in clan) {
				plugin.SendGlobalMessage("["+best_clan+"]"+clan_member);
				}
		String message = "TOP PLATOON this round is ["+ best_clan + "] -" + msg + " with " + best_score + " points!";
		plugin.ServerCommand("admin.yell", (message));
		plugin.ConsoleWrite(message);
        }
return false;
did not compile or test it yet.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Singh400*:

 

Yeah, that's good. Technically, you could simplify ? to s_, the square brackets are for a list of characters. Also, if you want to match any number of ! or ? at the end, so you could catch for example paki!!!!!!!_!!_!_!!!, use * instead of _. * means zero or more matches, while ? means zero or one match.

 

So:

 

Code:

if (Regex.Match(chatword, "^"+racism+@"s_[!_]*$", RegexOptions.IgnoreCase).Success)
Finally, if you want to invert the list, meaning, match everything except for what's in the list, you add ^ to the front of the list. So [^a-z0-9]* will match everything that isn't a letter or digit. That would catch nigga$ or paki_________, etc., as well as nigger!!! and paki___!_.
I went for

Code:

if (Regex.Match(chatword, "^"+racism+"[s]*[!_.]*$", RegexOptions.IgnoreCase).Success)
In the end.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by shadow2k1*:

 

Doesn't have to be like that. Hexa's code using ! which means not equal to or something like that.

 

I would have just gone for:-

Code:

List<string> douchebags = new List<string>();
douchebags.Add("Player1Name");
douchebags.Add("Player2Name");
douchebags.Add("Player3Name");
douchebags.Add("Player4Name");

if (Regex.Match(player.LastChat, @"^\s*!douchebags_", RegexOptions.IgnoreCase).Success)
	{	
		foreach (string douchebag in douchebags) 
			{
				plugin.SendGlobalMessage(douchebag);
				plugin.ServerCommand("admin.yell", douchebag, "8", "player", player.Name);
			}
	}

return false;
I got Hexa's installed and it works nice. thanks Hexacanon.

i changed the yell to a say though.

 

Singh, whats the difference between your code and his? does yours popup each name 1 at a time?

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

Originally Posted by MDV666*:

 

Dear colleagues. Whether prompt please everything correctly in my code? Or give other code for permanent Ban.

 

Code:

{	
		plugin.Log("Logs/InsaneLimits_PKA2.csv", plugin.R("%date%,%time%,%p_n%,%l_n%,%p_pg%," + p_ka + "")) ;
                plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Permanent, player.Name, 0, " Cheat v.6 ");
	}

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

Originally Posted by HexaCanon*:

 

Dear colleagues. Whether prompt please everything correctly in my code? Or give other code for permanent Ban.

 

Code:

{	
		plugin.Log("Logs/InsaneLimits_PKA2.csv", plugin.R("%date%,%time%,%p_n%,%l_n%,%p_pg%," + p_ka + "")) ;
                plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Permanent, player.Name, 0, " Cheat v.6 ");
	}

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

Originally Posted by Itz_cujo666*:

 

Hi HexaCanon,

 

Thanks for your help, from below, I got these errors...

[17:53:29 26] [insane Limits] ERROR: 4 errors compiling Code

[17:53:29 26] [insane Limits] ERROR: (CS0162, line: 33, column: 13): Unreachable code detected

[17:53:29 26] [insane Limits] ERROR: (CS0030, line: 97, column: 14): Cannot convert type 'PRoConEvents.PlayerInfoInterface' to 'string'

[17:53:29 26] [insane Limits] ERROR: (CS0030, line: 107, column: 17): Cannot convert type 'PRoConEvents.PlayerInfoInterface' to 'string'

[17:53:29 26] [insane Limits] ERROR: (CS0128, line: 110, column: 22): A local variable named 'message' is already defined in this scope

 

Any help appreciated! :smile:

 

second check code

Code:

double count = limit.Activations();
    
    if (count > 1)
        return false;

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

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
	{
		String playerTag = best_clan;

	List<PlayerInfoInterface> clan = new List<PlayerInfoInterface>();

	foreach (PlayerInfoInterface p in players) {
		String clanTag = p.Tag;
		if (String.IsNullOrEmpty(clanTag)) continue;
		if (clanTag != playerTag) continue;
		// Found a clan member!
		clan.Add(p);
	}
	
	String msg = "*** ";
	bool first = true;
	foreach(string clan_member in clan) {
		if (first) {
			msg = msg + clan_member;
			first = false;
		} else {
			msg = msg + "," + clan_member;
		}
	}
		String message = "TOP PLATOON this round is ["+ best_clan + "] with " + best_score + " points!";
                plugin.SendGlobalMessage(message);
				foreach(string clan_member in clan) {
				plugin.SendGlobalMessage("["+best_clan+"]"+clan_member);
				}
		String message = "TOP PLATOON this round is ["+ best_clan + "] -" + msg + " with " + best_score + " points!";
		plugin.ServerCommand("admin.yell", (message));
		plugin.ConsoleWrite(message);
        }
return false;
did not compile or test it yet.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by HexaCanon*:

 

Hi HexaCanon,

 

Thanks for your help, from below, I got these errors...

[17:53:29 26] [insane Limits] ERROR: 4 errors compiling Code

[17:53:29 26] [insane Limits] ERROR: (CS0162, line: 33, column: 13): Unreachable code detected

[17:53:29 26] [insane Limits] ERROR: (CS0030, line: 97, column: 14): Cannot convert type 'PRoConEvents.PlayerInfoInterface' to 'string'

[17:53:29 26] [insane Limits] ERROR: (CS0030, line: 107, column: 17): Cannot convert type 'PRoConEvents.PlayerInfoInterface' to 'string'

[17:53:29 26] [insane Limits] ERROR: (CS0128, line: 110, column: 22): A local variable named 'message' is already defined in this scope

 

Any help appreciated! :smile:

first check code

 

Code:

if (server.TimeRound < (3*60)) return false;
double t1 = 100;
double t2 = 100;
double t3 = 100;
double t4 = 100;
if (team1.players.Count > 0) t1 = team1.RemainTicketsPercent;
if (team2.players.Count > 0) t2 = team2.RemainTicketsPercent;
if (team3.players.Count > 0) t3 = team3.RemainTicketsPercent;
if (team4.players.Count > 0) t4 = team4.RemainTicketsPercent;

if (t1 < 8 || t2 < 8 || t3 < 8 || t4 < 8) return true;
else return false;
second check code

Code:

double count = limit.Activations();
    
    if (count > 1)
        return false;

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

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
	{
		String playerTag = best_clan;

	List<PlayerInfoInterface> clan = new List<PlayerInfoInterface>();

	foreach (PlayerInfoInterface p in players) {
		String clanTag = p.Tag;
		if (String.IsNullOrEmpty(clanTag)) continue;
		if (clanTag != playerTag) continue;
		// Found a clan member!
		clan.Add(p);
	}
	
	String msg = "["+best_clan+"]";
	bool first = true;
	foreach(PlayerInfoInterface clan_member in clan) {
		if (first) {
			msg = msg + clan_member.Name;
			first = false;
		} else {
			msg = msg + " ,[" + best_clan +"]" + clan_member.Name;
		}
	}
		String message = "TOP PLATOON this round is ["+ best_clan + "] with " + best_score + " points!";
                plugin.SendGlobalMessage(message);
				foreach(PlayerInfoInterface clan_member in clan) {
				plugin.SendGlobalMessage("["+best_clan+"]"+clan_member.Name);
				}
		message = "TOP PLATOON this round is ["+ best_clan + "] -" + msg + " with " + best_score + " points!";
		plugin.ServerCommand("admin.yell", (message));
		plugin.ConsoleWrite(message);
        }
return false;
this is compiled , please test it to see if it is working as intended.

 

Edit : i am testing it now, found some mistakes i will replace the code in few minutes, when i do i will add a new edit message telling you about it.

 

Edit 2 : should work now hopefully.

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

Originally Posted by Singh400*:

 

Is it possible to setup a plug in for Jets and Helicopters only. I want to set this up on a scrim server for air to air combat only

No, I don't think so. As all vehicle kills are reported as [DEATH].
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

i have asked this before but cant find it. dont think it was ever made. i want to use the grant vip's limited kick/ban limit but to earn that status, i would like players to stay idle in the server. for example, for every 12 hours of being idle in the logs, ill add you as a vip to get admin. something like that.

 

i dont know how to approach this logging system of players. even if it takes a snapshot of people that havnt spawned. maybe like every 10min do a check and write the people down who have 0-0-0 (score-kills-deaths) would be easier?

 

like

1:00am check

player1

player2

player3

 

1:10am check

player2

player4

 

etc...

 

from that i can see player2 was the most idle and not just a bathroom break. it would also allow me to see that player was idle for over 10min in my example and not just a player that just joined and has a score of 0-0-0 when the log started. like i said im not sure but just trying to show what i need.

 

 

 

 

if that is not possible at all (logging idlers) then what about logging time connected for every 12 or 24 hours?

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

Originally Posted by HexaCanon*:

 

i have asked this before but cant find it. dont think it was ever made. i want to use the grant vip's limited kick/ban limit but to earn that status, i would like players to stay idle in the server. for example, for every 12 hours of being idle in the logs, ill add you as a vip to get admin. something like that.

 

i dont know how to approach this logging system of players. even if it takes a snapshot of people that havnt spawned. maybe like every 10min do a check and write the people down who have 0-0-0 (score-kills-deaths) would be easier?

 

like

1:00am check

player1

player2

player3

 

1:10am check

player2

player4

 

etc...

 

from that i can see player2 was the most idle and not just a bathroom break. it would also allow me to see that player was idle for over 10min in my example and not just a player that just joined and has a score of 0-0-0 when the log started. like i said im not sure but just trying to show what i need.

 

 

 

 

if that is not possible at all (logging idlers) then what about logging time connected for every 12 or 24 hours?

doubt it is doable, you will need some kind of database set up for player information.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Itz_cujo666*:

 

Hi HexaCanon,

 

Thanks for your help, much appreciated.

 

This is expanding the players names in the say, each name (and the top platoon/score message) on a separate line.

 

Is it possible to have the players names only in the yell, and the say remains just top platoon and their score (no names). Right now, it's making a new line in say for each player...

 

Thanks,

Cujo

 

second check code

Code:

double count = limit.Activations();
    
    if (count > 1)
        return false;

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

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
	{
		String playerTag = best_clan;

	List<PlayerInfoInterface> clan = new List<PlayerInfoInterface>();

	foreach (PlayerInfoInterface p in players) {
		String clanTag = p.Tag;
		if (String.IsNullOrEmpty(clanTag)) continue;
		if (clanTag != playerTag) continue;
		// Found a clan member!
		clan.Add(p);
	}
	
	String msg = "["+best_clan+"]";
	bool first = true;
	foreach(PlayerInfoInterface clan_member in clan) {
		if (first) {
			msg = msg + clan_member.Name;
			first = false;
		} else {
			msg = msg + " ,[" + best_clan +"]" + clan_member.Name;
		}
	}
		String message = "TOP PLATOON this round is ["+ best_clan + "] with " + best_score + " points!";
                plugin.SendGlobalMessage(message);
				foreach(PlayerInfoInterface clan_member in clan) {
				plugin.SendGlobalMessage("["+best_clan+"]"+clan_member.Name);
				}
		message = "TOP PLATOON this round is ["+ best_clan + "] -" + msg + " with " + best_score + " points!";
		plugin.ServerCommand("admin.yell", (message));
		plugin.ConsoleWrite(message);
        }
return false;
this is compiled , please test it to see if it is working as intended.

 

Edit : i am testing it now, found some mistakes i will replace the code in few minutes, when i do i will add a new edit message telling you about it.

 

Edit 2 : should work now hopefully.

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

Originally Posted by HexaCanon*:

 

Hi HexaCanon,

 

Thanks for your help, much appreciated.

 

This is expanding the players names in the say, each name (and the top platoon/score message) on a separate line.

 

Is it possible to have the players names only in the yell, and the say remains just top platoon and their score (no names). Right now, it's making a new line in say for each player...

 

Thanks,

Cujo

Code:
double count = limit.Activations();
    
    if (count > 1)
        return false;

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

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
	{
		String playerTag = best_clan;

	List<PlayerInfoInterface> clan = new List<PlayerInfoInterface>();

	foreach (PlayerInfoInterface p in players) {
		String clanTag = p.Tag;
		if (String.IsNullOrEmpty(clanTag)) continue;
		if (clanTag != playerTag) continue;
		// Found a clan member!
		clan.Add(p);
	}
	
	String msg = "["+best_clan+"]";
	bool first = true;
	foreach(PlayerInfoInterface clan_member in clan) {
		if (first) {
			msg = msg + clan_member.Name;
			first = false;
		} else {
			msg = msg + " ,[" + best_clan +"]" + clan_member.Name;
		}
	}
		String message = "TOP PLATOON this round is ["+ best_clan + "] with " + best_score + " points!";
        plugin.SendGlobalMessage(message);
		message = "TOP PLATOON this round is ["+ best_clan + "] -" + msg + " with " + best_score + " points!";
		plugin.ServerCommand("admin.yell", (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*:

 

if that is not possible at all (logging idlers) then what about logging time connected for every 12 or 24 hours?

I agree with HexaCanon. You probably need a database to do this right. The main problem is that every time the PRoCon layer is restarted or the plugin is reloaded/re-enabled, you lose all your data.

 

If you are willing to put up with some lost data from time to time, give this a try:

 

Log idle players*

 

I didn't have time to compile it so it probably has errors. Let me know if you need help fixing them (post in that thread). I'll compile it later and post fixes.

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

Archived

This topic is now archived and is closed to further replies.




×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.