Jump to content

Insane Limits: Player/Weapon (Sniper) Permission Lottery (not SQDM)


ImportBot

Recommended Posts

Originally Posted by avengedthedead*:

 

Hello PC9,

 

We have stubborn players in our server where they did not win the lottery but keep using it. As the admin kill does not add into the K/D system. How do i add kill, kick and then tban 1 hour after the lottery has annouced the winners?

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

Originally Posted by avengedthedead*:

 

Is below correct?

 

// State 2: Lottery is over, only winners may use sniper rifles

if (state == 2) {

if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {

msg = killer.Name + ": You are not allowed to use sniper rifles or DMR for this round!";

ChatPlayer(killer.Name);

plugin.KillPlayer(killer.Name, 5);

return false;

}

String kCounter = killer.Name + "_LottoKillCount";

int warnings = 0;

if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

 

if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {

if (warnings == 0) {

msg = killer.Name + ": FIRST WARNING: You are not allowed to use sniper rifles or DMR this round!";

ChatPlayer(killer.Name);

} else if (warnings == 1) {

msg = plugin.R("FINAL WARNING %k_n%! You are not allowed to use sniper rifles or DMR this round!"); // Second warning message

ChatPlayer(killer.Name);

plugin.SendPlayerYell(killer.Name, msg, 20);

plugin.KillPlayer(killer.Name, 3);

} else if (warnings == 2) {

msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

plugin.PRoConEvent(msg, "Insane Limits");

plugin.KickPlayerWithMessage(killer.Name, msg);

} else if (warnings > 2) {

msg = plugin.R("TBANNING %k_n% for 1 hour. For using SNIPER RIFLES, DMR after being kicked!");

plugin.SendGlobalMessage(msg);

plugin.PRoConChat("ADMIN > " + msg);

plugin.PRoConEvent(msg, "Insane Limits");

plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60 /* minutes */, msg);

}

server.RoundData.setInt(kCounter, warnings+1);

return false;

}

}

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

Originally Posted by avengedthedead*:

 

The code is hard to read so I can't tell if it is correct or not. You are using , but you should be using

...
.

 

Go ahead and try it.

Ok resend and thanks to recheck for me.

 

Code:

// State 2: Lottery is over, only winners may use sniper rifles
	if (state == 2) {
		if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
			msg = killer.Name + ": You are not allowed to use sniper rifles or DMR for this round!";
			ChatPlayer(killer.Name);
			plugin.KillPlayer(killer.Name, 5);
			return false;    
		}
		String kCounter = killer.Name + "_LottoKillCount";
		int warnings = 0;
		if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

		if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
			if (warnings == 0) {
				msg = killer.Name + ": FIRST WARNING: You are not allowed to use sniper rifles or DMR this round!";
				ChatPlayer(killer.Name);
			} else if (warnings == 1) {
					msg = plugin.R("FINAL WARNING %k_n%! You are not allowed to use sniper rifles or DMR this round!"); // Second warning message
					ChatPlayer(killer.Name);
					plugin.SendPlayerYell(killer.Name, msg, 20);
					plugin.KillPlayer(killer.Name, 3);
			} else if (warnings == 2) {
					msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
					plugin.SendGlobalMessage(msg);
					plugin.PRoConChat("ADMIN > " + msg);
					plugin.PRoConEvent(msg, "Insane Limits");
					plugin.KickPlayerWithMessage(killer.Name, msg);
			} else if (warnings > 2) {
					msg = plugin.R("TBANNING %k_n% for 1 hour. For using SNIPER RIFLES, DMR after being kicked!");
					plugin.SendGlobalMessage(msg);
					plugin.PRoConChat("ADMIN > " + msg);
					plugin.PRoConEvent(msg, "Insane Limits");
					plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60 /* minutes */, msg);
			}
			server.RoundData.setInt(kCounter, warnings+1);
			return false;
		}
	}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Ok resend and thanks to recheck for me.

That's better. I can see that the code is incorrect now. :smile::sad:

 

Here is corrected code:

 

 

Code:

// State 2: Lottery is over, only winners may use sniper rifles
    if (state == 2) {
	    if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
		    String kCounter = killer.Name + "_LottoKillCount";
		    int warnings = 0;
		    if (server.RoundData.issetInt(kCounter))
                            warnings = server.RoundData.getInt(kCounter);

		    if (warnings == 0) {
			    msg = killer.Name + ": FIRST WARNING: You are not allowed to use sniper rifles or DMR this round!";
			    ChatPlayer(killer.Name);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 1) {
			    msg = plugin.R("FINAL WARNING %k_n%! You are not allowed to use sniper rifles or DMR this round!"); // Second warning message
			    ChatPlayer(killer.Name);
			    plugin.SendPlayerYell(killer.Name, msg, 20);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 2) {
			    msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.KickPlayerWithMessage(killer.Name, msg);
		    } else if (warnings > 2) {
			    msg = plugin.R("TBANNING %k_n% for 1 hour. For using SNIPER RIFLES, DMR after being kicked!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60 /* minutes */, msg);
		    }
		    server.RoundData.setInt(kCounter, warnings+1);
		    return false;
	    }
    }
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

That's better. I can see that the code is incorrect now. :smile::sad:

 

Here is corrected code:

 

 

Code:

// State 2: Lottery is over, only winners may use sniper rifles
    if (state == 2) {
	    if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
		    String kCounter = killer.Name + "_LottoKillCount";
		    int warnings = 0;
		    if (server.RoundData.issetInt(kCounter))
                            warnings = server.RoundData.getInt(kCounter);

		    if (warnings == 0) {
			    msg = killer.Name + ": FIRST WARNING: You are not allowed to use sniper rifles or DMR this round!";
			    ChatPlayer(killer.Name);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 1) {
			    msg = plugin.R("FINAL WARNING %k_n%! You are not allowed to use sniper rifles or DMR this round!"); // Second warning message
			    ChatPlayer(killer.Name);
			    plugin.SendPlayerYell(killer.Name, msg, 20);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 2) {
			    msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.KickPlayerWithMessage(killer.Name, msg);
		    } else if (warnings > 2) {
			    msg = plugin.R("TBANNING %k_n% for 1 hour. For using SNIPER RIFLES, DMR after being kicked!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60 /* minutes */, msg);
		    }
		    server.RoundData.setInt(kCounter, warnings+1);
		    return false;
	    }
    }
Thanks PC9!!!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

Hello PC9,

 

Yesterday while playing in the server, i happen to realized that there's no specific command just to check who are the winners for the lottery. For example due to BF4 chat lag or new player enters the server, it will be good to check for the status of the lottery winners.

 

Is there anyway you could implement this? I'm sorry that i asked too much.

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

Originally Posted by avengedthedead*:

 

Hello PC9,

 

Yesterday while playing in the server, i happen to realized that there's no specific command just to check who are the winners for the lottery. For example due to BF4 chat lag or new player enters the server, it will be good to check for the status of the lottery winners.

 

Is there anyway you could implement this? I'm sorry that i asked too much.

Hello PC9,

 

Sorry, i read the entire post for this subject and found in post #58. Thank you.

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

Originally Posted by PapaCharlie9*:

 

Hello PC9,

 

How do i remove the sniper pick up weapons from this lottery. (U_AMR2, U_AMR2_CQB, U_AMR2_MED, U_M82A3, U_M82A3_CQB, U_M82A3_MED).

 

 

,

Find list line of code in Step 1:

 

Code:

bool sniperRifleUsed = (kill.Category == "SniperRifle");
Change it to this:

 

Code:

bool sniperRifleUsed = (kill.Category == "SniperRifle") && !Regex.Match(kill.Weapon, @"(U_AMR2|U_AMR2_CQB|U_AMR2_MED|U_M82A3|U_M82A3_CQB|U_M82A3_MED)").Success;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

Find list line of code in Step 1:

 

Code:

bool sniperRifleUsed = (kill.Category == "SniperRifle");
Change it to this:

 

Code:

bool sniperRifleUsed = (kill.Category == "SniperRifle") && !Regex.Match(kill.Weapon, @"(U_AMR2|U_AMR2_CQB|U_AMR2_MED|U_M82A3|U_M82A3_CQB|U_M82A3_MED)").Success;
Hello PC9,

 

Good day to you. Thank you and you are simply the best.

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

Originally Posted by avengedthedead*:

 

Hello PC9,

 

How are you Sir? I observed that in some modes the winners announcement is not working properly. It will display in the yell but not say.

 

In say it will display as:

 

Example - the winners are: blank no messages

But it will display in yell.

 

Any idea? I will post my limits in a separate post shortly.

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

Originally Posted by avengedthedead*:

 

Here my codes below

 

Step 1

 

Create a limit to evaluate OnKill, call it "Lotto". Set the Action to None.

 

Set first_check to this Code:

 

Code:

/* VERSION 0.9/R8 (BF4) */

// CUSTOMIZE
double maxMinutes = 3; // Number of minutes to collect players for the lottery
int maxSnipers = 4; // Number of snipers per team to choose from the lottery

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

// Use kills to update the lotto time limit
// Means it won't be exact

String kState = "Lotto_State"; // plugin.RoundData int
String kTime = "Lotto_Time"; // plugin.RoundData Object (DateTime)
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)
String kPrefix = "Lotto_";
String kWinners = "Lotto_Winners"; // plugin.RoundData String
String key = kPrefix + killer.Name;

int state = 0;
if (plugin.RoundData.issetInt(kState)) state = plugin.RoundData.getInt(kState);

bool sniperRifleUsed = (kill.Category == "SniperRifle" || kill.Category == "DMR") && !Regex.Match(kill.Weapon, @"(U_AMR2|U_AMR2_CQB|U_AMR2_MED|U_M82A3|U_M82A3_CQB|U_M82A3_MED)").Success;

// State 0: Waiting for first player to type the !sniper command
if (state == 0) {
    if (!sniperRifleUsed) return false;
    // Punish and remind
    msg = "No sniping until after lottery: type !sniper to enter the lottery";
    ChatPlayer(killer.Name); // Remind player
    plugin.KillPlayer(killer.Name, 5);
    plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
    return false;
}

// State 1: Running the lotto for maxMinutes
if (state == 1) {
    DateTime start = DateTime.Now;
    if (!plugin.RoundData.issetObject(kTime)) {
        plugin.RoundData.setObject(kTime, (Object)start);
    } else {
        start = (DateTime)plugin.RoundData.getObject(kTime);
    }
    TimeSpan since = DateTime.Now.Subtract(start);
        if (((int)since.TotalSeconds) % 10 == 0) plugin.ConsoleWrite("^b[Lotto]^n Lottery has been running for " + since.TotalSeconds.ToString("F0") + " seconds ...");
    if (since.TotalMinutes < maxMinutes) {
        if (!sniperRifleUsed) return false;
        // Punish and remind
        msg = "No sniping until after lottery: type !sniper to enter the lottery";
        ChatPlayer(killer.Name); // Remind player
        plugin.KillPlayer(killer.Name, 5);
        plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
        return false;
    }
    if (!plugin.RoundData.issetObject(kEntries1) && !plugin.RoundData.issetObject(kEntries2)) {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    List<String> entrants1 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries1)) entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    List<String> entrants2 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries2)) entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    if (entrants1.Count == 0 && entrants2.Count == 0)  {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    msg = "The lottery is over! The winners are:";
    plugin.SendGlobalMessage(msg);
    Random rnd = new Random();
    int pick = maxSnipers;
    // Team 1
    msg = ": may use sniper rifles or DMR this round!";
    while (pick > 0 && entrants1.Count > 0) {
        int winner = (entrants1.Count > 2) _ rnd.Next(entrants1.Count) : 0;
        String name = entrants1[winner];
        entrants1.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    // Team 2
    pick = maxSnipers;
    if (entrants2.Count > 0) msg = ", " + msg;
    while (pick > 0 && entrants2.Count > 0) {
        int winner = (entrants2.Count > 2) _ rnd.Next(entrants2.Count) : 0;
        String name = entrants2[winner];
        entrants2.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    plugin.SendGlobalMessage(msg);
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
        plugin.RoundData.setString(kWinners, msg);

    plugin.RoundData.setInt(kState, 2);
    return false;
}

// State 2: Lottery is over, only winners may use sniper rifles or DMR
    if (state == 2) {
	    if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
		    String kCounter = killer.Name + "_LottoKillCount";
		    int warnings = 0;
		    if (server.RoundData.issetInt(kCounter))
                            warnings = server.RoundData.getInt(kCounter);

		    if (warnings == 0) {
			    msg = killer.Name + ": FIRST WARNING: You are not allowed to use sniper rifles or DMR this round!";
			    ChatPlayer(killer.Name);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 1) {
			    msg = plugin.R("FINAL WARNING %k_n%! You are not allowed to use sniper rifles or DMR this round!"); // Second warning message
			    ChatPlayer(killer.Name);
			    plugin.SendPlayerYell(killer.Name, msg, 20);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 2) {
			    msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n% without winning the lottery!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.KickPlayerWithMessage(killer.Name, msg);
		    } else if (warnings > 2) {
			    msg = plugin.R("TBANNING %k_n% for 1 hour. For using SNIPER RIFLES, DMR after being kicked and without winning the lottery!!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60 /* minutes */, msg);
		    }
		    server.RoundData.setInt(kCounter, warnings+1);
		    return false;
	    }
    }
Step 2

 

Create a limit to evaluate OnAnyChat, call it "Lotto Command". Set Action to None.

 

Set first_check to this Code:

 

Code:

/* VERSION 0.9/R7 BF4 */
// CUSTOMIZE
double maxMinutes = 3; // Number of minutes to collect players for the lottery

String kWinners = "Lotto_Winners"; // plugin.RoundData String

if (Regex.Match(player.LastChat, @"(snipers|winners|list)", RegexOptions.IgnoreCase).Success) {
    if (plugin.RoundData.issetString(kWinners)) {
        plugin.SendGlobalMessage("This round's snipers: " + plugin.RoundData.getString(kWinners));
        return false;
    }
}

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

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

String kState = "Lotto_State"; // plugin.RoundData int
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)

int state = 0;
if (!plugin.RoundData.issetInt(kState)) {
    plugin.RoundData.setInt(kState, 0); // Waiting for the first entrant
} else {
    state = plugin.RoundData.getInt(kState);
}

// Got another entrant!

if (state == 0) {
    msg = "The sniper rifle and DMR lottery will run for " + maxMinutes + " minutes. Type !sniper to enter!";
    plugin.SendGlobalMessage(msg);
    plugin.ServerCommand("admin.yell", msg, "8");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
    plugin.RoundData.setInt(kState, 1);
    state = 1;
}

if (state == 2) {
    msg = "The lottery is over for this round. No more entries allowed.";
    ChatPlayer(player.Name);
    return false;
}

// Otherwise, we are State 1: running the lotto and taking names

msg = "You already entered the sniper rifle and DMR lottery!";

if (player.TeamId == 1) {
    List<String> entrants1 = null;
    if (!plugin.RoundData.issetObject(kEntries1)) {
        entrants1 = new List<String>();
        plugin.RoundData.setObject(kEntries1, (Object)entrants1);
    } else {
        entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    }
        if (!entrants1.Contains(player.Name)) {
        entrants1.Add(player.Name);
        msg = "You are the #" + entrants1.Count + " entrant in the sniper rifle and DMR lottery!";
        }
} else if (player.TeamId == 2) {
    List<String> entrants2 = null;
    if (!plugin.RoundData.issetObject(kEntries2)) {
        entrants2 = new List<String>();
        plugin.RoundData.setObject(kEntries2, (Object)entrants2);
    } else {
        entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    }
        if (!entrants2.Contains(player.Name)) {
        entrants2.Add(player.Name);
        msg = "You are the #" + entrants2.Count + " entrant in the sniper rifle and DMR lottery!";
        }
}

ChatPlayer(player.Name);
plugin.ConsoleWrite("^b[Lotto]^n (" + player.Name + "): " + msg);
return false;
Create a new limit OnRoundStart, called "Plug Lotto Hole", leave Action set to None.

 

Set first_check to this Code:

 

Code:

String kState = "Lotto_State"; // plugin.RoundData int
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)

if (plugin.RoundData.issetInt(kState)) plugin.RoundData.unsetInt(kState);
if (plugin.RoundData.issetObject(kEntries1)) plugin.RoundData.unsetObject(kEntries1);
if (plugin.RoundData.issetObject(kEntries2)) plugin.RoundData.unsetObject(kEntries2);
String msg = "All Lotto entries have been cleared!";
plugin.ConsoleWrite(msg);
plugin.SendGlobalMessage(msg);
return false;
Could you advice if there's anything wrong? Thank you for your time Sir.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Hello PC9,

 

How are you Sir? I observed that in some modes the winners announcement is not working properly. It will display in the yell but not say.

 

In say it will display as:

 

Example - the winners are: blank no messages

But it will display in yell.

 

Any idea? I will post my limits in a separate post shortly.

It means the length of the chat message is too long. How many winners are you allowing?

 

EDIT:

 

It's this code that is making the message too long:

 

Code:

msg = ": may use sniper rifles or DMR this round!";
You have 4 snipers per team, so that's 8 player names, plus that suffix. That will occasionally go over the max character limit.

 

You should change that code to :

 

Code:

msg = String.Empty;
Then add a line here:

 

Code:

plugin.SendGlobalMessage(msg);
    [b]msg = msg + " : may use sniper rifles or DMR this round!";[/b]
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

Hello PC9,

 

Before i apply need you help to check first.

 

Code:

/* VERSION 0.9/R8 (BF4) */

// CUSTOMIZE
double maxMinutes = 3; // Number of minutes to collect players for the lottery
int maxSnipers = 4; // Number of snipers per team to choose from the lottery

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

// Use kills to update the lotto time limit
// Means it won't be exact

String kState = "Lotto_State"; // plugin.RoundData int
String kTime = "Lotto_Time"; // plugin.RoundData Object (DateTime)
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)
String kPrefix = "Lotto_";
String kWinners = "Lotto_Winners"; // plugin.RoundData String
String key = kPrefix + killer.Name;

int state = 0;
if (plugin.RoundData.issetInt(kState)) state = plugin.RoundData.getInt(kState);

bool sniperRifleUsed = (kill.Category == "SniperRifle" || kill.Category == "DMR") && !Regex.Match(kill.Weapon, @"(U_AMR2|U_AMR2_CQB|U_AMR2_MED|U_M82A3|U_M82A3_CQB|U_M82A3_MED)").Success;

// State 0: Waiting for first player to type the !sniper command
if (state == 0) {
    if (!sniperRifleUsed) return false;
    // Punish and remind
    msg = "No sniping until after lottery: type !sniper to enter the lottery";
    ChatPlayer(killer.Name); // Remind player
    plugin.KillPlayer(killer.Name, 5);
    plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
    return false;
}

// State 1: Running the lotto for maxMinutes
if (state == 1) {
    DateTime start = DateTime.Now;
    if (!plugin.RoundData.issetObject(kTime)) {
        plugin.RoundData.setObject(kTime, (Object)start);
    } else {
        start = (DateTime)plugin.RoundData.getObject(kTime);
    }
    TimeSpan since = DateTime.Now.Subtract(start);
        if (((int)since.TotalSeconds) % 10 == 0) plugin.ConsoleWrite("^b[Lotto]^n Lottery has been running for " + since.TotalSeconds.ToString("F0") + " seconds ...");
    if (since.TotalMinutes < maxMinutes) {
        if (!sniperRifleUsed) return false;
        // Punish and remind
        msg = "No sniping until after lottery: type !sniper to enter the lottery";
        ChatPlayer(killer.Name); // Remind player
        plugin.KillPlayer(killer.Name, 5);
        plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
        return false;
    }
    if (!plugin.RoundData.issetObject(kEntries1) && !plugin.RoundData.issetObject(kEntries2)) {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    List<String> entrants1 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries1)) entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    List<String> entrants2 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries2)) entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    if (entrants1.Count == 0 && entrants2.Count == 0)  {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    msg = "The lottery is over! The winners are:";
    plugin.SendGlobalMessage(msg);
    Random rnd = new Random();
    int pick = maxSnipers;
    // Team 1
    [b]msg = String.Empty;[/b]
    while (pick > 0 && entrants1.Count > 0) {
        int winner = (entrants1.Count > 2) _ rnd.Next(entrants1.Count) : 0;
        String name = entrants1[winner];
        entrants1.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    // Team 2
    pick = maxSnipers;
    if (entrants2.Count > 0) msg = ", " + msg;
    while (pick > 0 && entrants2.Count > 0) {
        int winner = (entrants2.Count > 2) _ rnd.Next(entrants2.Count) : 0;
        String name = entrants2[winner];
        entrants2.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    plugin.SendGlobalMessage(msg);
    [b]msg = msg + " : may use sniper rifles or DMR this round!";[/b]
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
        plugin.RoundData.setString(kWinners, msg);

    plugin.RoundData.setInt(kState, 2);
    return false;
}

// State 2: Lottery is over, only winners may use sniper rifles or DMR
    if (state == 2) {
	    if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
		    String kCounter = killer.Name + "_LottoKillCount";
		    int warnings = 0;
		    if (server.RoundData.issetInt(kCounter))
                            warnings = server.RoundData.getInt(kCounter);

		    if (warnings == 0) {
			    msg = killer.Name + ": FIRST WARNING: You are not allowed to use sniper rifles or DMR this round!";
			    ChatPlayer(killer.Name);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 1) {
			    msg = plugin.R("FINAL WARNING %k_n%! You are not allowed to use sniper rifles or DMR this round!"); // Second warning message
			    ChatPlayer(killer.Name);
			    plugin.SendPlayerYell(killer.Name, msg, 20);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 2) {
			    msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n% without winning the lottery!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.KickPlayerWithMessage(killer.Name, msg);
		    } else if (warnings > 2) {
			    msg = plugin.R("TBANNING %k_n% for 1 hour. For using SNIPER RIFLES, DMR after being kicked and without winning the lottery!!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60 /* minutes */, msg);
		    }
		    server.RoundData.setInt(kCounter, warnings+1);
		    return false;
	    }
    }
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

Hello PC9,

 

It has been tested and the winners's announcement is working but after the announcement as we want to check by either typing snipers|winners|lists, it does not show up.

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

Originally Posted by PapaCharlie9*:

 

Hello PC9,

 

It has been tested and the winners's announcement is working but after the announcement as we want to check by either typing snipers|winners|lists, it does not show up.

Right, because you are storing the long string. You'll have to change this code:

 

Code:

plugin.SendGlobalMessage(msg);
    msg = msg + " : may use sniper rifles or DMR this round!";
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
        plugin.RoundData.setString(kWinners, msg);
to this:

 

Code:

plugin.SendGlobalMessage(msg);
    plugin.RoundData.setString(kWinners, msg);
    msg = msg + " : may use sniper rifles or DMR this round!";
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

Alright i have change as accordingly and the platoon will test it and let you know if there's any issues.

 

Code:

/* VERSION 0.9/R8 (BF4) */

// CUSTOMIZE
double maxMinutes = 3; // Number of minutes to collect players for the lottery
int maxSnipers = 4; // Number of snipers per team to choose from the lottery

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

// Use kills to update the lotto time limit
// Means it won't be exact

String kState = "Lotto_State"; // plugin.RoundData int
String kTime = "Lotto_Time"; // plugin.RoundData Object (DateTime)
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)
String kPrefix = "Lotto_";
String kWinners = "Lotto_Winners"; // plugin.RoundData String
String key = kPrefix + killer.Name;

int state = 0;
if (plugin.RoundData.issetInt(kState)) state = plugin.RoundData.getInt(kState);

bool sniperRifleUsed = (kill.Category == "SniperRifle" || kill.Category == "DMR") && !Regex.Match(kill.Weapon, @"(U_AMR2|U_AMR2_CQB|U_AMR2_MED|U_M82A3|U_M82A3_CQB|U_M82A3_MED)").Success;

// State 0: Waiting for first player to type the !sniper command
if (state == 0) {
    if (!sniperRifleUsed) return false;
    // Punish and remind
    msg = "No sniping until after lottery: type !sniper to enter the lottery";
    ChatPlayer(killer.Name); // Remind player
    plugin.KillPlayer(killer.Name, 5);
    plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
    return false;
}

// State 1: Running the lotto for maxMinutes
if (state == 1) {
    DateTime start = DateTime.Now;
    if (!plugin.RoundData.issetObject(kTime)) {
        plugin.RoundData.setObject(kTime, (Object)start);
    } else {
        start = (DateTime)plugin.RoundData.getObject(kTime);
    }
    TimeSpan since = DateTime.Now.Subtract(start);
        if (((int)since.TotalSeconds) % 10 == 0) plugin.ConsoleWrite("^b[Lotto]^n Lottery has been running for " + since.TotalSeconds.ToString("F0") + " seconds ...");
    if (since.TotalMinutes < maxMinutes) {
        if (!sniperRifleUsed) return false;
        // Punish and remind
        msg = "No sniping until after lottery: type !sniper to enter the lottery";
        ChatPlayer(killer.Name); // Remind player
        plugin.KillPlayer(killer.Name, 5);
        plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
        return false;
    }
    if (!plugin.RoundData.issetObject(kEntries1) && !plugin.RoundData.issetObject(kEntries2)) {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    List<String> entrants1 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries1)) entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    List<String> entrants2 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries2)) entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    if (entrants1.Count == 0 && entrants2.Count == 0)  {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    msg = "The lottery is over! The winners are:";
    plugin.SendGlobalMessage(msg);
    Random rnd = new Random();
    int pick = maxSnipers;
    // Team 1
    msg = String.Empty;
    while (pick > 0 && entrants1.Count > 0) {
        int winner = (entrants1.Count > 2) _ rnd.Next(entrants1.Count) : 0;
        String name = entrants1[winner];
        entrants1.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    // Team 2
    pick = maxSnipers;
    if (entrants2.Count > 0) msg = ", " + msg;
    while (pick > 0 && entrants2.Count > 0) {
        int winner = (entrants2.Count > 2) _ rnd.Next(entrants2.Count) : 0;
        String name = entrants2[winner];
        entrants2.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
[b]    plugin.SendGlobalMessage(msg);
    plugin.RoundData.setString(kWinners, msg);
    msg = msg + " : may use sniper rifles or DMR this round!";
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);[/b]

    plugin.RoundData.setInt(kState, 2);
    return false;
}

// State 2: Lottery is over, only winners may use sniper rifles or DMR
    if (state == 2) {
	    if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
		    String kCounter = killer.Name + "_LottoKillCount";
		    int warnings = 0;
		    if (server.RoundData.issetInt(kCounter))
                            warnings = server.RoundData.getInt(kCounter);

		    if (warnings == 0) {
			    msg = killer.Name + ": FIRST WARNING: You are not allowed to use sniper rifles or DMR this round!";
			    ChatPlayer(killer.Name);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 1) {
			    msg = plugin.R("FINAL WARNING %k_n%! You are not allowed to use sniper rifles or DMR this round!"); // Second warning message
			    ChatPlayer(killer.Name);
			    plugin.SendPlayerYell(killer.Name, msg, 20);
			    plugin.KillPlayer(killer.Name, 5);
		    } else if (warnings == 2) {
			    msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n% without winning the lottery!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.KickPlayerWithMessage(killer.Name, msg);
		    } else if (warnings > 2) {
			    msg = plugin.R("TBANNING %k_n% for 1 hour. For using SNIPER RIFLES, DMR after being kicked and without winning the lottery!!");
			    plugin.SendGlobalMessage(msg);
			    plugin.PRoConChat("ADMIN > " + msg);
			    plugin.PRoConEvent(msg, "Insane Limits");
			    plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 60 /* minutes */, msg);
		    }
		    server.RoundData.setInt(kCounter, warnings+1);
		    return false;
	    }
    }
* Restored post. It could be that the author is no longer active.
Link to comment
  • 1 month later...

Originally Posted by TMiland*:

 

Hi PC9, i am wondering if i where to allow reserved slots to use sniper rifles, it this going to work?

 

Code:

/* VERSION 0.9/R8 (BF4) */

// CUSTOMIZE
double maxMinutes = 5; // Number of minutes to collect players for the lottery
int maxSnipers = 5; // Number of snipers per team to choose from the lottery

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

// Use kills to update the lotto time limit
// Means it won't be exact

String kState = "Lotto_State"; // plugin.RoundData int
String kTime = "Lotto_Time"; // plugin.RoundData Object (DateTime)
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)
String kPrefix = "Lotto_";
String kWinners = "Lotto_Winners"; // plugin.RoundData String
String key = kPrefix + killer.Name;

int state = 0;
if (plugin.RoundData.issetInt(kState)) state = plugin.RoundData.getInt(kState);

bool sniperRifleUsed = (kill.Category == "SniperRifle" || kill.Category == "DMR") && !Regex.Match(kill.Weapon, @"(U_AMR2|U_AMR2_CQB|U_AMR2_MED|U_M82A3|U_M82A3_CQB|U_M82A3_MED)").Success;

if (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee")
	return false;

[b]List<String> ReservervedSlots = plugin.GetReservedSlotsList();
if (!ReservervedSlots.Contains(killer.Name))
	return false;[/b]

// State 0: Waiting for first player to type the !sniper command
if (state == 0) {
    if (!sniperRifleUsed) return false;
    // Punish and remind
    msg = "No sniper or DMR until after lottery: type !sniper to enter the lottery";
    ChatPlayer(killer.Name); // Remind player
    plugin.KillPlayer(killer.Name, 5);
    plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
    return false;
}

// State 1: Running the lotto for maxMinutes
if (state == 1) {
    DateTime start = DateTime.Now;
    if (!plugin.RoundData.issetObject(kTime)) {
        plugin.RoundData.setObject(kTime, (Object)start);
    } else {
        start = (DateTime)plugin.RoundData.getObject(kTime);
    }
    TimeSpan since = DateTime.Now.Subtract(start);
        if (((int)since.TotalSeconds) % 10 == 0) plugin.ConsoleWrite("^b[Lotto]^n Lottery has been running for " + since.TotalSeconds.ToString("F0") + " seconds ...");
    if (since.TotalMinutes < maxMinutes) {
        if (!sniperRifleUsed) return false;
        // Punish and remind
        msg = "No sniper or DMR until after lottery: type !sniper to enter the lottery";
        ChatPlayer(killer.Name); // Remind player
        plugin.KillPlayer(killer.Name, 5);
        plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
        return false;
    }
    if (!plugin.RoundData.issetObject(kEntries1) && !plugin.RoundData.issetObject(kEntries2)) {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    List<String> entrants1 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries1)) entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    List<String> entrants2 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries2)) entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    if (entrants1.Count == 0 && entrants2.Count == 0)  {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    msg = "The lottery is over! The winners are:";
    plugin.SendGlobalMessage(msg);
    Random rnd = new Random();
    int pick = maxSnipers;
    // Team 1
    msg = ": may use sniper rifles or DMR this round!";
    while (pick > 0 && entrants1.Count > 0) {
        int winner = (entrants1.Count > 2) _ rnd.Next(entrants1.Count) : 0;
        String name = entrants1[winner];
        entrants1.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    // Team 2
    pick = maxSnipers;
    if (entrants2.Count > 0) msg = ", " + msg;
    while (pick > 0 && entrants2.Count > 0) {
        int winner = (entrants2.Count > 2) _ rnd.Next(entrants2.Count) : 0;
        String name = entrants2[winner];
        entrants2.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    plugin.SendGlobalMessage(msg);
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
        plugin.RoundData.setString(kWinners, msg);

    plugin.RoundData.setInt(kState, 2);
    return false;
}

	// State 2: Lottery is over, only winners may use sniper rifles
	if (state == 2) {
		if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
			msg = killer.Name + ": You are not allowed to use sniper rifles this round!";
			ChatPlayer(killer.Name);
			plugin.KillPlayer(killer.Name, 5);
			return false;    
		}
		String kCounter = killer.Name + "_LottoKillCount";
		int warnings = 0;
		if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

		if (!sniperRifleUsed && plugin.RoundData.issetBool(key)) {
			if (warnings == 0) {
				msg = killer.Name + ": FIRST WARNING: You entered and won the lottery, you MUST use sniper rifles this round!";
				ChatPlayer(killer.Name);
			} else if (warnings == 1) {
					msg = plugin.R("FINAL WARNING %k_n%! You entered and won the lottery, you MUST use sniper rifles this round!"); // Second warning message
					ChatPlayer(killer.Name);
					plugin.SendPlayerYell(killer.Name, msg, 20);
					plugin.KillPlayer(killer.Name, 3);
			} else if (warnings == 2) {
					msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
					plugin.SendGlobalMessage(msg);
					plugin.PRoConChat("ADMIN > " + msg);
					plugin.PRoConEvent(msg, "Insane Limits");
					plugin.KickPlayerWithMessage(killer.Name, msg);
			} else if (warnings > 2) {
					msg = plugin.R("TBANNING %k_n% for 30mins. Still not using SNIPER RIFLES after being kicked!");
					plugin.SendGlobalMessage(msg);
					plugin.PRoConChat("ADMIN > " + msg);
					plugin.PRoConEvent(msg, "Insane Limits");
					plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 30 /* minutes */, msg);
			}
			server.RoundData.setInt(kCounter, warnings+1);
			return false;
		}
	}

return false;
Any help or suggestion is much appreciated! :smile:

 

Edit: That was not working lol!

 

Edit2: Guess it was working after all :smile:

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

Originally Posted by PapaCharlie9*:

 

Hi PC9, i am wondering if i where to allow reserved slots to use sniper rifles, it this going to work?

 

Code:

/* VERSION 0.9/R8 (BF4) */

// CUSTOMIZE
double maxMinutes = 5; // Number of minutes to collect players for the lottery
int maxSnipers = 5; // Number of snipers per team to choose from the lottery

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

// Use kills to update the lotto time limit
// Means it won't be exact

String kState = "Lotto_State"; // plugin.RoundData int
String kTime = "Lotto_Time"; // plugin.RoundData Object (DateTime)
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)
String kPrefix = "Lotto_";
String kWinners = "Lotto_Winners"; // plugin.RoundData String
String key = kPrefix + killer.Name;

int state = 0;
if (plugin.RoundData.issetInt(kState)) state = plugin.RoundData.getInt(kState);

bool sniperRifleUsed = (kill.Category == "SniperRifle" || kill.Category == "DMR") && !Regex.Match(kill.Weapon, @"(U_AMR2|U_AMR2_CQB|U_AMR2_MED|U_M82A3|U_M82A3_CQB|U_M82A3_MED)").Success;

if (kill.Category == "Handgun" || kill.Category == "Explosive" || kill.Weapon == "Melee")
	return false;

[b]List<String> ReservervedSlots = plugin.GetReservedSlotsList();
if (!ReservervedSlots.Contains(killer.Name))
	return false;[/b]

// State 0: Waiting for first player to type the !sniper command
if (state == 0) {
    if (!sniperRifleUsed) return false;
    // Punish and remind
    msg = "No sniper or DMR until after lottery: type !sniper to enter the lottery";
    ChatPlayer(killer.Name); // Remind player
    plugin.KillPlayer(killer.Name, 5);
    plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
    return false;
}

// State 1: Running the lotto for maxMinutes
if (state == 1) {
    DateTime start = DateTime.Now;
    if (!plugin.RoundData.issetObject(kTime)) {
        plugin.RoundData.setObject(kTime, (Object)start);
    } else {
        start = (DateTime)plugin.RoundData.getObject(kTime);
    }
    TimeSpan since = DateTime.Now.Subtract(start);
        if (((int)since.TotalSeconds) % 10 == 0) plugin.ConsoleWrite("^b[Lotto]^n Lottery has been running for " + since.TotalSeconds.ToString("F0") + " seconds ...");
    if (since.TotalMinutes < maxMinutes) {
        if (!sniperRifleUsed) return false;
        // Punish and remind
        msg = "No sniper or DMR until after lottery: type !sniper to enter the lottery";
        ChatPlayer(killer.Name); // Remind player
        plugin.KillPlayer(killer.Name, 5);
        plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
        return false;
    }
    if (!plugin.RoundData.issetObject(kEntries1) && !plugin.RoundData.issetObject(kEntries2)) {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    List<String> entrants1 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries1)) entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    List<String> entrants2 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries2)) entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    if (entrants1.Count == 0 && entrants2.Count == 0)  {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    msg = "The lottery is over! The winners are:";
    plugin.SendGlobalMessage(msg);
    Random rnd = new Random();
    int pick = maxSnipers;
    // Team 1
    msg = ": may use sniper rifles or DMR this round!";
    while (pick > 0 && entrants1.Count > 0) {
        int winner = (entrants1.Count > 2) _ rnd.Next(entrants1.Count) : 0;
        String name = entrants1[winner];
        entrants1.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    // Team 2
    pick = maxSnipers;
    if (entrants2.Count > 0) msg = ", " + msg;
    while (pick > 0 && entrants2.Count > 0) {
        int winner = (entrants2.Count > 2) _ rnd.Next(entrants2.Count) : 0;
        String name = entrants2[winner];
        entrants2.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    plugin.SendGlobalMessage(msg);
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
        plugin.RoundData.setString(kWinners, msg);

    plugin.RoundData.setInt(kState, 2);
    return false;
}

	// State 2: Lottery is over, only winners may use sniper rifles
	if (state == 2) {
		if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
			msg = killer.Name + ": You are not allowed to use sniper rifles this round!";
			ChatPlayer(killer.Name);
			plugin.KillPlayer(killer.Name, 5);
			return false;    
		}
		String kCounter = killer.Name + "_LottoKillCount";
		int warnings = 0;
		if (server.RoundData.issetInt(kCounter)) warnings = server.RoundData.getInt(kCounter);

		if (!sniperRifleUsed && plugin.RoundData.issetBool(key)) {
			if (warnings == 0) {
				msg = killer.Name + ": FIRST WARNING: You entered and won the lottery, you MUST use sniper rifles this round!";
				ChatPlayer(killer.Name);
			} else if (warnings == 1) {
					msg = plugin.R("FINAL WARNING %k_n%! You entered and won the lottery, you MUST use sniper rifles this round!"); // Second warning message
					ChatPlayer(killer.Name);
					plugin.SendPlayerYell(killer.Name, msg, 20);
					plugin.KillPlayer(killer.Name, 3);
			} else if (warnings == 2) {
					msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
					plugin.SendGlobalMessage(msg);
					plugin.PRoConChat("ADMIN > " + msg);
					plugin.PRoConEvent(msg, "Insane Limits");
					plugin.KickPlayerWithMessage(killer.Name, msg);
			} else if (warnings > 2) {
					msg = plugin.R("TBANNING %k_n% for 30mins. Still not using SNIPER RIFLES after being kicked!");
					plugin.SendGlobalMessage(msg);
					plugin.PRoConChat("ADMIN > " + msg);
					plugin.PRoConEvent(msg, "Insane Limits");
					plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, 30 /* minutes */, msg);
			}
			server.RoundData.setInt(kCounter, warnings+1);
			return false;
		}
	}

return false;
Any help or suggestion is much appreciated! :smile:

 

Edit: That was not working lol!

 

Edit2: Guess it was working after all :smile:

Uh, I don't think that would work. It's the opposite of what you want. The logic says that if the player is NOT on the reserved slots list do NOT apply the sniper rules.

 

I think you want if the player IS on the reserved slots list, do NOT apply the sniper rules:

 

Code:

[b]List<String> ReservervedSlots = plugin.GetReservedSlotsList();
if (ReservervedSlots.Contains(killer.Name))
	return false;[/b]
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

Uh, I don't think that would work. It's the opposite of what you want. The logic says that if the player is NOT on the reserved slots list do NOT apply the sniper rules.

 

I think you want if the player IS on the reserved slots list, do NOT apply the sniper rules:

 

Code:

[b]List<String> ReservervedSlots = plugin.GetReservedSlotsList();
if (ReservervedSlots.Contains(killer.Name))
	return false;[/b]
Ah crap, forgot to edit the post. I am using what you posted, just forgot to remove the ! :P
* Restored post. It could be that the author is no longer active.
Link to comment
  • 2 weeks later...

Originally Posted by superman50*:

 

I tried setting BF3, but was unsuccessful, the server does not perform in accordance with, I am a novice, so some commands might not, what could give me a hint, such as where to replace or add this command. Thank you very much

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

Originally Posted by superman50*:

 

/* VERSION 0.8/R2 */

 

// CUSTOMIZE

double maxMinutes = 5; // Number of minutes to collect players for the lottery

int maxSnipers = 3; // Number of snipers per team to choose from the lottery

 

String msg = "test";

 

Action ChatPlayer = delegate(String who) {

plugin.ServerCommand("admin.yell", msg, "15", "player", who);

plugin.ServerCommand("admin.say", msg, "player", who);

};

 

// Use kills to update the lotto time limit

// Means it won't be exact

 

String kState = "Lotto_State"; // plugin.RoundData int

String kTime = "Lotto_Time"; // plugin.RoundData Object (DateTime)

String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List)

String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List)

String kPrefix = "Lotto_";

String key = kPrefix + killer.Name;

 

int state = 0;

if (plugin.RoundData.issetInt(kState)) state = plugin.RoundData.getInt(kState);

 

bool sniperRifleUsed = (kill.Category == "SniperRifle") && !Regex.Match(kill.Weapon, @"(JNG90|M417|L96|M39|M40A5|Mk11|Model98B|QBU-88|SKS|SV98|SVD)").Success;

 

// State 0: Waiting for first player to type the !sniper command

if (state == 0) {

if (!sniperRifleUsed) return false;

// Punish and remind

msg = "No sniping until after lottery: type !sniper to enter the lottery";

ChatPlayer(killer.Name); // Remind player

plugin.KillPlayer(killer.Name, 5);

plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone

return false;

}

 

// State 1: Running the lotto for maxMinutes

if (state == 1) {

DateTime start = DateTime.Now;

if (!plugin.RoundData.issetObject(kTime)) {

plugin.RoundData.setObject(kTime, (Object)start);

} else {

start = (DateTime)plugin.RoundData.getObject(kTime);

}

TimeSpan since = DateTime.Now.Subtract(start);

if (since.TotalMinutes

if (!sniperRifleUsed) return false;

// Punish and remind

msg = "No sniping until after lottery: type !sniper to enter the lottery";

ChatPlayer(killer.Name); // Remind player

plugin.KillPlayer(killer.Name, 5);

plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone

return false;

}

if (!plugin.RoundData.issetObject(kEntries1) && !plugin.RoundData.issetObject(kEntries2)) {

plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");

plugin.RoundData.setInt(kState, 2);

return false;

}

List entrants1 = (List)plugin.RoundData.getObject(kEntries1 );

List entrants2 = (List)plugin.RoundData.getObject(kEntries2 );

if (entrants1.Count == 0 && entrants2.Count == 0) {

plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");

plugin.RoundData.setInt(kState, 2);

return false;

}

msg = "The lottery is over! The winners are:";

plugin.SendGlobalMessage(msg);

Random rnd = new Random();

int pick = maxSnipers;

// Team 1

msg = ": may use sniper rifles this round!";

while (pick > 0 && entrants1.Count > 0) {

int winner = (entrants1.Count > 2) ? rnd.Next(entrants1.Count) : 0;

String name = entrants1[winner];

entrants1.RemoveAt(winner);

key = kPrefix + name;

plugin.RoundData.setBool(key, true);

msg = name + msg;

--pick;

if (pick > 0) msg = ", " + msg;

}

// Team 2

pick = maxSnipers;

if (entrants2.Count > 0) msg = ", " + msg;

while (pick > 0 && entrants2.Count > 0) {

int winner = (entrants2.Count > 2) ? rnd.Next(entrants2.Count) : 0;

String name = entrants2[winner];

entrants2.RemoveAt(winner);

key = kPrefix + name;

plugin.RoundData.setBool(key, true);

msg = name + msg;

--pick;

if (pick > 0) msg = ", " + msg;

}

plugin.SendGlobalMessage(msg);

plugin.ServerCommand("admin.yell", msg, "15");

plugin.ConsoleWrite("^b[Lotto]^n " + msg);

 

plugin.RoundData.setInt(kState, 2);

return false;

}

 

// State 2: Lottery is over, only winners may use sniper rifles

if (state == 2) {

if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {

msg = "You are not allowed to use sniper rifles this round!";

ChatPlayer(killer.Name);

plugin.KillPlayer(killer.Name, 5);

return false;

}

}

 

return false;

 

---------------------------------------------------------------------------------

I try to write such rules, but it is not running. Use SINIPER weapons were not punished. I would like to ask what is my place appeared wrong? THANK YOU

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

Originally Posted by TMiland*:

 

I try to write such rules, but it is not running. Use SINIPER weapons were not punished. I would like to ask what is my place appeared wrong? THANK YOU

In the Insane Limits plugin, Posted Image

 

Should look like this: Posted Image

 

Try this code for BF3:

Code:

/* VERSION 0.9/R8 (BF4) */

// CUSTOMIZE
double maxMinutes = 5; // Number of minutes to collect players for the lottery
int maxSnipers = 3; // Number of snipers per team to choose from the lottery

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

// Use kills to update the lotto time limit
// Means it won't be exact

String kState = "Lotto_State"; // plugin.RoundData int
String kTime = "Lotto_Time"; // plugin.RoundData Object (DateTime)
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)
String kPrefix = "Lotto_";
String kWinners = "Lotto_Winners"; // plugin.RoundData String
String key = kPrefix + killer.Name;

int state = 0;
if (plugin.RoundData.issetInt(kState)) state = plugin.RoundData.getInt(kState);

bool sniperRifleUsed = Regex.Match(kill.Weapon, @"(_:JNG90|M417|L96|M39|M40A5|Mk11|Model98B|QBU-88|SKS|SV98|SVD)", RegexOptions.IgnoreCase).Success;

// State 0: Waiting for first player to type the !sniper command
if (state == 0) {
    if (!sniperRifleUsed) return false;
    // Punish and remind
    msg = "No sniping until after lottery: type !sniper to enter the lottery";
    ChatPlayer(killer.Name); // Remind player
    plugin.KillPlayer(killer.Name, 5);
    plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
    return false;
}

// State 1: Running the lotto for maxMinutes
if (state == 1) {
    DateTime start = DateTime.Now;
    if (!plugin.RoundData.issetObject(kTime)) {
        plugin.RoundData.setObject(kTime, (Object)start);
    } else {
        start = (DateTime)plugin.RoundData.getObject(kTime);
    }
    TimeSpan since = DateTime.Now.Subtract(start);
        if (((int)since.TotalSeconds) % 10 == 0) plugin.ConsoleWrite("^b[Lotto]^n Lottery has been running for " + since.TotalSeconds.ToString("F0") + " seconds ...");
    if (since.TotalMinutes < maxMinutes) {
        if (!sniperRifleUsed) return false;
        // Punish and remind
        msg = "No sniping until after lottery: type !sniper to enter the lottery";
        ChatPlayer(killer.Name); // Remind player
        plugin.KillPlayer(killer.Name, 5);
        plugin.ServerCommand("admin.yell", msg, "8"); // Remind everyone
        return false;
    }
    if (!plugin.RoundData.issetObject(kEntries1) && !plugin.RoundData.issetObject(kEntries2)) {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    List<String> entrants1 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries1)) entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    List<String> entrants2 = new List<String>();
        if (plugin.RoundData.issetObject(kEntries2)) entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    if (entrants1.Count == 0 && entrants2.Count == 0)  {
        plugin.ConsoleWrite("^b[Lotto]^n no entrants and time has expired!");
        plugin.RoundData.setInt(kState, 2);
        return false;
    }
    msg = "The lottery is over! The winners are:";
    plugin.SendGlobalMessage(msg);
    Random rnd = new Random();
    int pick = maxSnipers;
    // Team 1
    msg = ": may use sniper rifles this round!";
    while (pick > 0 && entrants1.Count > 0) {
        int winner = (entrants1.Count > 2) _ rnd.Next(entrants1.Count) : 0;
        String name = entrants1[winner];
        entrants1.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    // Team 2
    pick = maxSnipers;
    if (entrants2.Count > 0) msg = ", " + msg;
    while (pick > 0 && entrants2.Count > 0) {
        int winner = (entrants2.Count > 2) _ rnd.Next(entrants2.Count) : 0;
        String name = entrants2[winner];
        entrants2.RemoveAt(winner);
        key = kPrefix + name;
        plugin.RoundData.setBool(key, true);
        msg = name + msg;
        --pick;
        if (pick > 0) msg = ", " + msg;
    }
    plugin.SendGlobalMessage(msg);
    plugin.ServerCommand("admin.yell", msg, "15");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
        plugin.RoundData.setString(kWinners, msg);

    plugin.RoundData.setInt(kState, 2);
    return false;
}

// State 2: Lottery is over, only winners may use sniper rifles
if (state == 2) {
    if (sniperRifleUsed && !plugin.RoundData.issetBool(key)) {
        msg = killer.Name + ": You are not allowed to use sniper rifles this round!";
        ChatPlayer(killer.Name);
        plugin.KillPlayer(killer.Name, 5);
        return false;    
    }
}

return false;
Then in a new limit:

Step 2

 

Create a limit to evaluate OnAnyChat, call it "Lotto Command". Set Action to None.

 

Set first_check to this Code:

Code:

/* VERSION 0.9/R7 BF4 */
// CUSTOMIZE
double maxMinutes = 5; // Number of minutes to collect players for the lottery

String kWinners = "Lotto_Winners"; // plugin.RoundData String

if (Regex.Match(player.LastChat, @"(snipers|winners|list)", RegexOptions.IgnoreCase).Success) {
    if (plugin.RoundData.issetString(kWinners)) {
        plugin.SendGlobalMessage("This round's snipers: " + plugin.RoundData.getString(kWinners));
        return false;
    }
}

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

String msg = "test";

Action<String> ChatPlayer = delegate(String who) {
    plugin.ServerCommand("admin.yell", msg, "15", "player", who);
    plugin.ServerCommand("admin.say", msg, "player", who);
};

String kState = "Lotto_State"; // plugin.RoundData int
String kEntries1 = "Lotto_Entries1"; // Team 1: plugin.RoundData Object (List<String>)
String kEntries2 = "Lotto_Entries2"; // Team 2: plugin.RoundData Object (List<String>)

int state = 0;
if (!plugin.RoundData.issetInt(kState)) {
    plugin.RoundData.setInt(kState, 0); // Waiting for the first entrant
} else {
    state = plugin.RoundData.getInt(kState);
}

// Got another entrant!

if (state == 0) {
    msg = "The sniper rifle lottery will run for " + maxMinutes + " minutes. Type !sniper to enter!";
    plugin.SendGlobalMessage(msg);
    plugin.ServerCommand("admin.yell", msg, "8");
    plugin.ConsoleWrite("^b[Lotto]^n " + msg);
    plugin.RoundData.setInt(kState, 1);
    state = 1;
}

if (state == 2) {
    msg = "The lottery is over for this round. No more entries allowed.";
    ChatPlayer(player.Name);
    return false;
}

// Otherwise, we are State 1: running the lotto and taking names

msg = "You already entered the sniper rifle lottery!";

if (player.TeamId == 1) {
    List<String> entrants1 = null;
    if (!plugin.RoundData.issetObject(kEntries1)) {
        entrants1 = new List<String>();
        plugin.RoundData.setObject(kEntries1, (Object)entrants1);
    } else {
        entrants1 = (List<String>)plugin.RoundData.getObject(kEntries1);
    }
        if (!entrants1.Contains(player.Name)) {
        entrants1.Add(player.Name);
        msg = "You are the #" + entrants1.Count + " entrant in the sniper rifle lottery!";
        }
} else if (player.TeamId == 2) {
    List<String> entrants2 = null;
    if (!plugin.RoundData.issetObject(kEntries2)) {
        entrants2 = new List<String>();
        plugin.RoundData.setObject(kEntries2, (Object)entrants2);
    } else {
        entrants2 = (List<String>)plugin.RoundData.getObject(kEntries2);
    }
        if (!entrants2.Contains(player.Name)) {
        entrants2.Add(player.Name);
        msg = "You are the #" + entrants2.Count + " entrant in the sniper rifle lottery!";
        }
}

ChatPlayer(player.Name);
plugin.ConsoleWrite("^b[Lotto]^n (" + player.Name + "): " + msg);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment
  • 5 months later...

Originally Posted by UnstoppableStorm*:

 

Hello, I have used your Sniper code for my server And it works Perfectly. Thank you so much.

Can you give me modified script for SNIPERS&DMR's Lottery, Like 5/team that includes both sniper and DMR.

Thanks in advance

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

Originally Posted by God_Zilla*:

 

A lot of good ideas here. Poor they are strongly scattered by the comments. It would be nice to summarize some of the main in the first message if it possible. Such as the use of the reserve slots (white list), system of warnings, etc.

 

Whether it is possible to implement following?

- Command in chat "!snipers" show lottery winners in private message.

- Adaptive snipers number depending on players online. Sets in percentages.

- Carry out additional lottery if one or more of the winners left the server and freed sniper slot, or Increased the number players online in the server if use Adaptive snipers number.

- auto disable sniper limit on some game modes.

 

I can read the code, understand its logic, i can edit it a bit. But I can not unfortunately generated code because lack of knowledge.

 

With best regards.

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

Originally Posted by God_Zilla*:

 

How to avoid punishment for use sniper rifles and DMR in modes Scavenger and GunMaster (BF3)?

In these modes, the choice of weapons does not depend on the player.

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

Originally Posted by PapaCharlie9*:

 

How to avoid punishment for use sniper rifles and DMR in modes Scavenger and GunMaster (BF3)?

In these modes, the choice of weapons does not depend on the player.

In Step 1, first_check Code, add this at the very top, so that it becomes the first two lines of code.

 

Code:

if (Regex.Match(server.Gamemode, @"(GunMaster0|Scavenger0)").Success)
    return false;
In Step 2, first_check Code, add the same lines at the very top.
* 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.