Jump to content

Insane Limits V0.9/R6: Vote to nuke camping/base raping team, or !surrender (CQ/Rush)


ImportBot

Recommended Posts

  • 4 weeks later...
  • Replies 306
  • Created
  • Last Reply
  • 1 month later...

Originally Posted by Strudaklitt*:

 

Hello mate! Thank you for putting so much effort into helping the bunch of us to understand the plugins and make them function as intented.

 

I'm new to the Insane Limits plugin, but desperately need it for a votenuke in-game.

 

I've read through most of your posts, and I get the idea of how I get the limit to work as intended, but there is one question whose answer I couldn't find.I hope you can help us out.

 

We'd like a combination of the three different votenukes you've put together in the thread. What we want is a combo between the following three:

 

Post #101 - a variation of this limit that adds a !cancelvote command for admins.

 

Post #169 - a variation of this limit that adds a second admin.kill (second nuke) when a nuked player tries to spawn. Effectively the same as a double nuke for one successful vote.

 

Post #210 - a variation of this limit that makes the command be !votenuke and that adds a series of countdown messages before the team is nuked.

 

Also, is there any way to make the in-game command for adding a vote towards the votenuke to be !yes instead of every player having to type !votenuke, that is, first player types !votenuke to start the vote and the voters type !yes?

 

Thanks in advance!

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

Originally Posted by PapaCharlie9*:

 

Hello mate! Thank you for putting so much effort into helping the bunch of us to understand the plugins and make them function as intented.

 

I'm new to the Insane Limits plugin, but desperately need it for a votenuke in-game.

 

I've read through most of your posts, and I get the idea of how I get the limit to work as intended, but there is one question whose answer I couldn't find.I hope you can help us out.

 

We'd like a combination of the three different votenukes you've put together in the thread. What we want is a combo between the following three:

 

Post #101 - a variation of this limit that adds a !cancelvote command for admins.

 

Post #169 - a variation of this limit that adds a second admin.kill (second nuke) when a nuked player tries to spawn. Effectively the same as a double nuke for one successful vote.

 

Post #210 - a variation of this limit that makes the command be !votenuke and that adds a series of countdown messages before the team is nuked.

 

Also, is there any way to make the in-game command for adding a vote towards the votenuke to be !yes instead of every player having to type !votenuke, that is, first player types !votenuke to start the vote and the voters type !yes?

 

Thanks in advance!

Please add links for each of those posts, thanks.
* Restored post. It could be that the author is no longer active.
Link to comment
Link to comment

Originally Posted by PapaCharlie9*:

 

The countdown messages might not be feasible, but I'll have to see how the code turns out. What exactly do you want the countdown messages to be?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Blaze0075*:

 

Hey papa!I have insanelimits version 0.9.16.I have tested all this codes but no one of this works for me:sad:Can you help me to create a code for me__Max 3 attemps per round/and team.Iwill use !votenukes.I have seen guys use proconrules code for votenukes,can i do that to__How i write this code__Blaze

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

Originally Posted by Strudaklitt*:

 

The countdown messages might not be feasible, but I'll have to see how the code turns out. What exactly do you want the countdown messages to be?

Doesn't matter too much, shouldn't be too hard for me to change afterwards, right?

 

Something like:

 

Nuke incoming in 10

Nuke incoming in 9

Nuke incoming in 8

Nuke incoming in 7

Nuke incoming in 6

Nuke incoming in 5

Nuke incoming in 4

Nuke incoming in 3

Nuke incoming in 2

Nuke incoming in 1

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

Originally Posted by PapaCharlie9*:

 

Doesn't matter too much, shouldn't be too hard for me to change afterwards, right?

 

Something like:

 

Nuke incoming in 10

Nuke incoming in 9

Nuke incoming in 8

Nuke incoming in 7

Nuke incoming in 6

Nuke incoming in 5

Nuke incoming in 4

Nuke incoming in 3

Nuke incoming in 2

Nuke incoming in 1

Okay. This is a BEAST of a limit. Actually, it is two limits. Probably should be a full plugin on it's own at this point.

 

WARNING: Since this was pieced together from 3 different limits, risk is high that mistakes were made and that something won't work right. Use with care.

 

This version supports the cancel vote command, countdown messages and a second nuke on spawn.

 

FIRST LIMIT

 

Create a limit to evaluate OnAnyChat, call it "BEAST NUKER".

 

Set first_check to this Code:

 

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 35; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 20; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 3; // CUSTOMIZE: maximum number of attempts

String kCamp = "votenuke";
String kOncePrefix = "votenuke_once_";
String kVoteTime = "votenuke_time";
String kAttemptsPrefix = "votenuke_attempts_";


int level = 2;

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

String msg = "empty";

Action<String> ChatPlayer = delegate(String name) {
    // closure bound to String msg
    plugin.ServerCommand("admin.say", msg, "player", name);
    plugin.PRoConChat("ADMIN to " + name + " > *** " + msg);
};


/* Parse the command */

Match campMatch = Regex.Match(player.LastChat, @"^\s*!vote\s*nuke", RegexOptions.IgnoreCase);
Match yesMatch = Regex.Match(player.LastChat, @"^\s*!yes", RegexOptions.IgnoreCase);
Match cancelMatch = Regex.Match(player.LastChat, @"^\s*!cancelvote", RegexOptions.IgnoreCase);

/* Check for admin cancel */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);
int losing = (t1 < t2) _ 1 : 2;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;
String keyAttempts = kAttemptsPrefix + losing;
int attempts = 0;

if (cancelMatch.Success) {
    bool canKill = false;
    bool canKick = false;
    bool canBan = false;
    bool canMove = false;
    bool canChangeLevel = false;
    if (plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel)) {
        if (canKick) {
            plugin.SendGlobalMessage("votenuke has been cancelled!");
            foreach (PlayerInfoInterface can in losers) {
                // Erase the vote
                if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
            }
            server.RoundData.unsetObject(kVoteTime);

            /* Losing team only gets to try this vote maxAttempts */
            attempts = 0;
            if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
            server.RoundData.setInt(keyAttempts, attempts + 1);
        } else {
            ChatPlayer("You are not authorized to use this command");
        }
    } else {
        ChatPlayer("Nice try, but only admins can use that command");
    }
    return false;
}

/* Bail out if not a proper vote */

if (!campMatch.Success && !yesMatch.Success) return false;

/* Bail out if this player already voted */

if (player.RoundData.issetBool(kCamp)) {
    msg = "You already voted on this votenuke attempt!";
    ChatPlayer(player.Name);
    return false;
}

/* Bail out if round about to end */

if (server.RemainTicketsPercent(1) < minTicketPercent || server.RemainTicketsPercent(2) < minTicketPercent) {
    msg = "Round too close to ending to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if ticket ratio isn't large enough */

if (Math.Abs(t1 - t2) < minTicketGap) {
    msg = "Ticket counts too close to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if voter is not on the losing team */


if (player.TeamId != losing) {
    msg = "You are not on the losing team!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    msg = "Your team already completed a nuke vote this round!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if maxAttempts made */

if (server.RoundData.issetInt(keyAttempts)) {
    attempts = server.RoundData.getInt(keyAttempts);
    if (attempts >= maxAttempts) {
        msg = "Your team already made " + maxAttempts + " attempts at nuking this round!";
        if (!yesMatch.Success) ChatPlayer(player.Name);
        return false;
    }
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    msg = "Not enough players to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n " + player.FullName + " voted to nuke baserapers");

msg = "You voted to nuke the other team camping your base";
if (!yesMatch.Success) ChatPlayer(player.Name);

/* Tally the votes */

int votes = 0;

/* Start timer if a valid command */

if (!server.RoundData.issetObject(kVoteTime)) {
    if (yesMatch.Success) {
        return false;
    }
    server.RoundData.setObject(kVoteTime, DateTime.Now);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n vote timer started");
}
DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

/* Count the vote in the voter's dictionary */
/* Votes are kept with the voter */
/* If the voter leaves, his votes are not counted */

if (!player.RoundData.issetBool(kCamp)) player.RoundData.setBool(kCamp, true);

/* Bail out if too much time has past */

if (since.TotalMinutes > timeout) {
    msg = "The voting time has expired, the nuke vote is cancelled!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 10);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n vote timeout expired");
    foreach (PlayerInfoInterface can in losers) {
        // Erase the vote
        if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
    }
    server.RoundData.unsetObject(kVoteTime);

    /* Losing team only gets to try this vote maxAttempts */
    attempts = 0;
    if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
    server.RoundData.setInt(keyAttempts, attempts + 1);
    
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3
if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction < 0 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction < 0 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}

/* Punish the campers */
String amsg = "Vote succeeded: " + campers + " team is being nuked for camping your deployment! Break out now!";
if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + amsg);
msg = "Vote succeeded: {0} seconds to nuke of " + campers + " team!";
plugin.SendGlobalYell("Vote succeeded: 5 seconds to nuke of " + campers + " team!", 15);

List<PlayerInfoInterface> bad = new List<PlayerInfoInterface>();
bad.AddRange((losing == 1) _ team2.players : team1.players);

if (server.RoundData.issetBool("BEARTRAP")) {
    if (level >= 2) plugin.ConsoleWarn("There is a timer thread that is already active! Aborting ...");
    return false;
}

Thread nuker = new Thread(new ThreadStart(delegate {
    try {
        server.RoundData.setBool("BEARTRAP", true);

        /* Losing team only gets to do this once */

        server.RoundData.setBool(key, true);

        int rsecs = 5;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
        plugin.SendTeamMessage(losing, amsg);
        plugin.SendTeamYell(losing, amsg, 15);
        foreach (PlayerInfoInterface nuke in bad) {
            nuke.RoundData.setBool("NUKE TWICE", true);
            plugin.KillPlayer(nuke.Name);
            if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n killing " + nuke.FullName);
            Thread.Sleep(100);
        }
    } catch (Exception e) {
        plugin.ConsoleException(e.ToString());
    } finally {
        if (server.RoundData.issetBool("BEARTRAP"))
            server.RoundData.unsetBool("BEARTRAP");
    }
}));

nuker.Name = "Nuker";
nuker.Start();



return false;
For 10 seconds and add a Yell as well as a Chat for each line of countdown, find these lines towards the bottom of the code block:

 

Code:

int rsecs = 5;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
Change (replace) those lines with these lines:

 

Code:

int rsecs = [b]10[/b];
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            [b]plugin.SendGlobalYell(String.Format(msg, rsecs), 1);[/b]
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
SECOND LIMIT

 

Now, create a new limit to evaluate OnSpawn, call it "Second Nuke".

 

Set first_check to this Code:

 

Code:

int level = 2;

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

if (player.RoundData.issetBool("NUKE TWICE")) {
    player.RoundData.unsetBool("NUKE TWICE");
    plugin.SendPlayerMessage(player.Name, "You will be ADMIN KILLED one more time, then you can spawn again!");
    plugin.KillPlayer(player.Name, 3);
    if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n SECOND killing of " + player.FullName);
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Strudaklitt*:

 

Okay. This is a BEAST of a limit. Actually, it is two limits. Probably should be a full plugin on it's own at this point.

 

WARNING: Since this was pieced together from 3 different limits, risk is high that mistakes were made and that something won't work right. Use with care.

 

This version supports the cancel vote command, countdown messages and a second nuke on spawn.

 

FIRST LIMIT

 

Create a limit to evaluate OnAnyChat, call it "BEAST NUKER".

 

Set first_check to this Code:

 

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 35; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 20; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 3; // CUSTOMIZE: maximum number of attempts

String kCamp = "votenuke";
String kOncePrefix = "votenuke_once_";
String kVoteTime = "votenuke_time";
String kAttemptsPrefix = "votenuke_attempts_";


int level = 2;

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

String msg = "empty";

Action<String> ChatPlayer = delegate(String name) {
    // closure bound to String msg
    plugin.ServerCommand("admin.say", msg, "player", name);
    plugin.PRoConChat("ADMIN to " + name + " > *** " + msg);
};


/* Parse the command */

Match campMatch = Regex.Match(player.LastChat, @"^\s*!vote\s*nuke", RegexOptions.IgnoreCase);
Match yesMatch = Regex.Match(player.LastChat, @"^\s*!yes", RegexOptions.IgnoreCase);
Match cancelMatch = Regex.Match(player.LastChat, @"^\s*!cancelvote", RegexOptions.IgnoreCase);

/* Check for admin cancel */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);
int losing = (t1 < t2) _ 1 : 2;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;
String keyAttempts = kAttemptsPrefix + losing;
int attempts = 0;

if (cancelMatch.Success) {
    bool canKill = false;
    bool canKick = false;
    bool canBan = false;
    bool canMove = false;
    bool canChangeLevel = false;
    if (plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel)) {
        if (canKick) {
            plugin.SendGlobalMessage("votenuke has been cancelled!");
            foreach (PlayerInfoInterface can in losers) {
                // Erase the vote
                if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
            }
            server.RoundData.unsetObject(kVoteTime);

            /* Losing team only gets to try this vote maxAttempts */
            attempts = 0;
            if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
            server.RoundData.setInt(keyAttempts, attempts + 1);
        } else {
            ChatPlayer("You are not authorized to use this command");
        }
    } else {
        ChatPlayer("Nice try, but only admins can use that command");
    }
    return false;
}

/* Bail out if not a proper vote */

if (!campMatch.Success && !yesMatch.Success) return false;

/* Bail out if this player already voted */

if (player.RoundData.issetBool(kCamp)) {
    msg = "You already voted on this votenuke attempt!";
    ChatPlayer(player.Name);
    return false;
}

/* Bail out if round about to end */

if (server.RemainTicketsPercent(1) < minTicketPercent || server.RemainTicketsPercent(2) < minTicketPercent) {
    msg = "Round too close to ending to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if ticket ratio isn't large enough */

if (Math.Abs(t1 - t2) < minTicketGap) {
    msg = "Ticket counts too close to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if voter is not on the losing team */


if (player.TeamId != losing) {
    msg = "You are not on the losing team!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    msg = "Your team already completed a nuke vote this round!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if maxAttempts made */

if (server.RoundData.issetInt(keyAttempts)) {
    attempts = server.RoundData.getInt(keyAttempts);
    if (attempts >= maxAttempts) {
        msg = "Your team already made " + maxAttempts + " attempts at nuking this round!";
        if (!yesMatch.Success) ChatPlayer(player.Name);
        return false;
    }
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    msg = "Not enough players to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n " + player.FullName + " voted to nuke baserapers");

msg = "You voted to nuke the other team camping your base";
if (!yesMatch.Success) ChatPlayer(player.Name);

/* Tally the votes */

int votes = 0;

/* Start timer if a valid command */

if (!server.RoundData.issetObject(kVoteTime)) {
    if (yesMatch.Success) {
        return false;
    }
    server.RoundData.setObject(kVoteTime, DateTime.Now);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n vote timer started");
}
DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

/* Count the vote in the voter's dictionary */
/* Votes are kept with the voter */
/* If the voter leaves, his votes are not counted */

if (!player.RoundData.issetBool(kCamp)) player.RoundData.setBool(kCamp, true);

/* Bail out if too much time has past */

if (since.TotalMinutes > timeout) {
    msg = "The voting time has expired, the nuke vote is cancelled!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 10);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n vote timeout expired");
    foreach (PlayerInfoInterface can in losers) {
        // Erase the vote
        if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
    }
    server.RoundData.unsetObject(kVoteTime);

    /* Losing team only gets to try this vote maxAttempts */
    attempts = 0;
    if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
    server.RoundData.setInt(keyAttempts, attempts + 1);
    
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3
if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction < 0 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction < 0 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}

/* Punish the campers */
String amsg = "Vote succeeded: " + campers + " team is being nuked for camping your deployment! Break out now!";
if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + amsg);
msg = "Vote succeeded: {0} seconds to nuke of " + campers + " team!";
plugin.SendGlobalYell("Vote succeeded: 5 seconds to nuke of " + campers + " team!", 15);

List<PlayerInfoInterface> bad = new List<PlayerInfoInterface>();
bad.AddRange((losing == 1) _ team2.players : team1.players);

if (server.RoundData.issetBool("BEARTRAP")) {
    if (level >= 2) plugin.ConsoleWarn("There is a timer thread that is already active! Aborting ...");
    return false;
}

Thread nuker = new Thread(new ThreadStart(delegate {
    try {
        server.RoundData.setBool("BEARTRAP", true);

        /* Losing team only gets to do this once */

        server.RoundData.setBool(key, true);

        int rsecs = 5;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
        plugin.SendTeamMessage(losing, amsg);
        plugin.SendTeamYell(losing, amsg, 15);
        foreach (PlayerInfoInterface nuke in bad) {
            nuke.RoundData.setBool("NUKE TWICE", true);
            plugin.KillPlayer(nuke.Name);
            if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n killing " + nuke.FullName);
            Thread.Sleep(100);
        }
    } catch (Exception e) {
        plugin.ConsoleException(e.ToString());
    } finally {
        if (server.RoundData.issetBool("BEARTRAP"))
            server.RoundData.unsetBool("BEARTRAP");
    }
}));

nuker.Name = "Nuker";
nuker.Start();



return false;
SECOND LIMIT

 

Now, create a new limit to evaluate OnSpawn, call it "Second Nuke".

 

Set first_check to this Code:

 

Code:

int level = 2;

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

if (player.RoundData.issetBool("NUKE TWICE")) {
    player.RoundData.unsetBool("NUKE TWICE");
    plugin.SendPlayerMessage(player.Name, "You will be ADMIN KILLED one more time, then you can spawn again!");
    plugin.KillPlayer(player.Name, 3);
    if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n SECOND killing of " + player.FullName);
}
return false;
Wow, that is indeed one beast of a limit! Huge thanks for taking your time to give us this code, we will evaluate it and get back to you asap!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

Hi PC9,

 

For the latest limit, is it correct for below structure cause i did not see you indicate for Conquest/Rush mode. Please check. Thanks.

 

 

Create a limit to evaluate OnAnyChat. Set the Action to None, call it "BEAST NUKER"

 

For BF4, Set first_check to this Expression:

Code:

(Regex.Match(server.Gamemode, @"(Rush)").Success)
Set second_check to this Code:

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 35; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 20; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 3; // CUSTOMIZE: maximum number of attempts

String kCamp = "votenuke";
String kOncePrefix = "votenuke_once_";
String kVoteTime = "votenuke_time";
String kAttemptsPrefix = "votenuke_attempts_";


int level = 2;

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

String msg = "empty";

Action<String> ChatPlayer = delegate(String name) {
    // closure bound to String msg
    plugin.ServerCommand("admin.say", msg, "player", name);
    plugin.PRoConChat("ADMIN to " + name + " > *** " + msg);
};


/* Parse the command */

Match campMatch = Regex.Match(player.LastChat, @"^\s*!vote\s*nuke", RegexOptions.IgnoreCase);
Match yesMatch = Regex.Match(player.LastChat, @"^\s*!yes", RegexOptions.IgnoreCase);
Match cancelMatch = Regex.Match(player.LastChat, @"^\s*!cancelvote", RegexOptions.IgnoreCase);

/* Check for admin cancel */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);
int losing = (t1 < t2) _ 1 : 2;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;
String keyAttempts = kAttemptsPrefix + losing;
int attempts = 0;

if (cancelMatch.Success) {
    bool canKill = false;
    bool canKick = false;
    bool canBan = false;
    bool canMove = false;
    bool canChangeLevel = false;
    if (plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel)) {
        if (canKick) {
            plugin.SendGlobalMessage("votenuke has been cancelled!");
            foreach (PlayerInfoInterface can in losers) {
                // Erase the vote
                if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
            }
            server.RoundData.unsetObject(kVoteTime);

            /* Losing team only gets to try this vote maxAttempts */
            attempts = 0;
            if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
            server.RoundData.setInt(keyAttempts, attempts + 1);
        } else {
            ChatPlayer("You are not authorized to use this command");
        }
    } else {
        ChatPlayer("Nice try, but only admins can use that command");
    }
    return false;
}

/* Bail out if not a proper vote */

if (!campMatch.Success && !yesMatch.Success) return false;

/* Bail out if this player already voted */

if (player.RoundData.issetBool(kCamp)) {
    msg = "You already voted on this votenuke attempt!";
    ChatPlayer(player.Name);
    return false;
}

/* Bail out if round about to end */

if (server.RemainTicketsPercent(1) < minTicketPercent || server.RemainTicketsPercent(2) < minTicketPercent) {
    msg = "Round too close to ending to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if ticket ratio isn't large enough */

if (Math.Abs(t1 - t2) < minTicketGap) {
    msg = "Ticket counts too close to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if voter is not on the losing team */


if (player.TeamId != losing) {
    msg = "You are not on the losing team!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    msg = "Your team already completed a nuke vote this round!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if maxAttempts made */

if (server.RoundData.issetInt(keyAttempts)) {
    attempts = server.RoundData.getInt(keyAttempts);
    if (attempts >= maxAttempts) {
        msg = "Your team already made " + maxAttempts + " attempts at nuking this round!";
        if (!yesMatch.Success) ChatPlayer(player.Name);
        return false;
    }
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    msg = "Not enough players to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n " + player.FullName + " voted to nuke baserapers");

msg = "You voted to nuke the other team camping your base";
if (!yesMatch.Success) ChatPlayer(player.Name);

/* Tally the votes */

int votes = 0;

/* Start timer if a valid command */

if (!server.RoundData.issetObject(kVoteTime)) {
    if (yesMatch.Success) {
        return false;
    }
    server.RoundData.setObject(kVoteTime, DateTime.Now);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n vote timer started");
}
DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

/* Count the vote in the voter's dictionary */
/* Votes are kept with the voter */
/* If the voter leaves, his votes are not counted */

if (!player.RoundData.issetBool(kCamp)) player.RoundData.setBool(kCamp, true);

/* Bail out if too much time has past */

if (since.TotalMinutes > timeout) {
    msg = "The voting time has expired, the nuke vote is cancelled!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 10);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n vote timeout expired");
    foreach (PlayerInfoInterface can in losers) {
        // Erase the vote
        if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
    }
    server.RoundData.unsetObject(kVoteTime);

    /* Losing team only gets to try this vote maxAttempts */
    attempts = 0;
    if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
    server.RoundData.setInt(keyAttempts, attempts + 1);
    
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3
if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction < 0 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction < 0 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}

/* Punish the campers */
String amsg = "Vote succeeded: " + campers + " team is being nuked for camping your deployment! Break out now!";
if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + amsg);
msg = "Vote succeeded: {0} seconds to nuke of " + campers + " team!";
plugin.SendGlobalYell("Vote succeeded: 5 seconds to nuke of " + campers + " team!", 15);

List<PlayerInfoInterface> bad = new List<PlayerInfoInterface>();
bad.AddRange((losing == 1) _ team2.players : team1.players);

if (server.RoundData.issetBool("BEARTRAP")) {
    if (level >= 2) plugin.ConsoleWarn("There is a timer thread that is already active! Aborting ...");
    return false;
}

Thread nuker = new Thread(new ThreadStart(delegate {
    try {
        server.RoundData.setBool("BEARTRAP", true);

        /* Losing team only gets to do this once */

        server.RoundData.setBool(key, true);

        int rsecs = 5;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
        plugin.SendTeamMessage(losing, amsg);
        plugin.SendTeamYell(losing, amsg, 15);
        foreach (PlayerInfoInterface nuke in bad) {
            nuke.RoundData.setBool("NUKE TWICE", true);
            plugin.KillPlayer(nuke.Name);
            if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n killing " + nuke.FullName);
            Thread.Sleep(100);
        }
    } catch (Exception e) {
        plugin.ConsoleException(e.ToString());
    } finally {
        if (server.RoundData.issetBool("BEARTRAP"))
            server.RoundData.unsetBool("BEARTRAP");
    }
}));

nuker.Name = "Nuker";
nuker.Start();



return false;
SECOND LIMIT

 

Now, create a new limit to evaluate OnSpawn, call it "Second Nuke".

 

Set first_check to this Code:

Code:

int level = 2;

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

if (player.RoundData.issetBool("NUKE TWICE")) {
    player.RoundData.unsetBool("NUKE TWICE");
    plugin.SendPlayerMessage(player.Name, "You will be ADMIN KILLED one more time, then you can spawn again!");
    plugin.KillPlayer(player.Name, 3);
    if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n SECOND killing of " + player.FullName);
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Hi PC9,

 

For the latest limit, is it correct for below structure cause i did not see you indicate for Conquest/Rush mode. Please check. Thanks.

If you want Conquest OR Rush, make first_check be this Expression:

 

Code:

(Regex.Match(server.Gamemode, @"(Conquest|Rush)").Success)
Moving the rest of the first limit code to second_check is correct and no change to the second limit is correct.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by avengedthedead*:

 

If you want Conquest OR Rush, make first_check be this Expression:

 

Code:

(Regex.Match(server.Gamemode, @"(Conquest|Rush)").Success)
Moving the rest of the first limit code to second_check is correct and no change to the second limit is correct.
Hi PC9,

 

Thank you for the check. It's working flawlessly.

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

Originally Posted by avengedthedead*:

 

Hi PC9,

 

If i want to make the nuke only once without the "Second Nuke", i'll just DISABLE the SECOND LIMIT which creates a new limit to evaluate OnSpawn, call it "Second Nuke" as per below code right?

 

 

Disable this code below

Set first_check to this Code:

 

Code:

int level = 2;

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

if (player.RoundData.issetBool("NUKE TWICE")) {
    player.RoundData.unsetBool("NUKE TWICE");
    plugin.SendPlayerMessage(player.Name, "You will be ADMIN KILLED one more time, then you can spawn again!");
    plugin.KillPlayer(player.Name, 3);
    if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n SECOND killing of " + player.FullName);
}
return false;
I suppose just disabling the second limit is acceptable, but it would be cleaner to leave the second limit enabled but change the code to this:

 

Code:

int level = 2;

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

if (player.RoundData.issetBool("NUKE TWICE")) {
    player.RoundData.unsetBool("NUKE TWICE");
    // plugin.SendPlayerMessage(player.Name, "You will be ADMIN KILLED one more time, then you can spawn again!");
    // plugin.KillPlayer(player.Name, 3);
    // if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n SECOND killing of " + player.FullName);
}
return false;
The // disables the line of code that follows. So the message to the player and kill player and the logging are all disabled, but the handling of the "NUKE TWICE" flag still works and does the necessary cleanup.
* Restored post. It could be that the author is no longer active.
Link to comment
  • 2 weeks later...

Originally Posted by PapaCharlie9*:

 

Hello PapaCharlie9,

 

I love the countdown on the say. How do i make work on both say and yell and change it to 10 secs?

In FIRST LIMIT, in first_check Code, find these lines towards the bottom:

 

Code:

int rsecs = 5;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
Change (replace) those lines with these lines:

 

Code:

int rsecs = [b]10[/b];
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            [b]plugin.SendGlobalYell(String.Format(msg, rsecs), 1);[/b]
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
* Restored post. It could be that the author is no longer active.
Link to comment
  • 4 weeks later...

Originally Posted by Blaze0075*:

 

Hey can you create a code votenuke to insanelimits version:0.9.16.Ihave test many codes here and

no one works for me.:sad:This codes here not nukes activated, only messages i get.Blaze

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

Originally Posted by Level*:

 

what I need to adjust the votenuke! only works for Conq. Locker and Metro

 

 

BF4 Code

 

Set first_check to this Expression:

 

Code:

(Regex.Match(server.Gamemode, @"(Conquest)").Success)
Set second_check to this Code:

 

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 35; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 20; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 3; // CUSTOMIZE: maximum number of attempts

String kCamp = "votenuke";
String kOncePrefix = "votenuke_once_";
String kVoteTime = "votenuke_time";
String kAttemptsPrefix = "votenuke_attempts_";


int level = 2;

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

String msg = "empty";

Action<String> ChatPlayer = delegate(String name) {
    // closure bound to String msg
    plugin.ServerCommand("admin.say", msg, "player", name);
    plugin.PRoConChat("ADMIN to " + name + " > *** " + msg);
};


/* Parse the command */

Match campMatch = Regex.Match(player.LastChat, @"^\s*!vote\s*nuke", RegexOptions.IgnoreCase);
Match yesMatch = Regex.Match(player.LastChat, @"^\s*!yes", RegexOptions.IgnoreCase);
Match cancelMatch = Regex.Match(player.LastChat, @"^\s*!cancelvote", RegexOptions.IgnoreCase);

/* Check for admin cancel */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);
int losing = (t1 < t2) _ 1 : 2;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;
String keyAttempts = kAttemptsPrefix + losing;
int attempts = 0;

if (cancelMatch.Success) {
    bool canKill = false;
    bool canKick = false;
    bool canBan = false;
    bool canMove = false;
    bool canChangeLevel = false;
    if (plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel)) {
        if (canKick) {
            plugin.SendGlobalMessage("votenuke has been cancelled!");
            foreach (PlayerInfoInterface can in losers) {
                // Erase the vote
                if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
            }
            server.RoundData.unsetObject(kVoteTime);

            /* Losing team only gets to try this vote maxAttempts */
            attempts = 0;
            if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
            server.RoundData.setInt(keyAttempts, attempts + 1);
        } else {
            ChatPlayer("You are not authorized to use this command");
        }
    } else {
        ChatPlayer("Nice try, but only admins can use that command");
    }
    return false;
}

/* Bail out if not a proper vote */

if (!campMatch.Success && !yesMatch.Success) return false;

/* Bail out if this player already voted */

if (player.RoundData.issetBool(kCamp)) {
    msg = "You already voted on this votenuke attempt!";
    ChatPlayer(player.Name);
    return false;
}

/* Bail out if round about to end */

if (server.RemainTicketsPercent(1) < minTicketPercent || server.RemainTicketsPercent(2) < minTicketPercent) {
    msg = "Round too close to ending to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if ticket ratio isn't large enough */

if (Math.Abs(t1 - t2) < minTicketGap) {
    msg = "Ticket counts too close to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if voter is not on the losing team */


if (player.TeamId != losing) {
    msg = "You are not on the losing team!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    msg = "Your team already completed a nuke vote this round!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if maxAttempts made */

if (server.RoundData.issetInt(keyAttempts)) {
    attempts = server.RoundData.getInt(keyAttempts);
    if (attempts >= maxAttempts) {
        msg = "Your team already made " + maxAttempts + " attempts at nuking this round!";
        if (!yesMatch.Success) ChatPlayer(player.Name);
        return false;
    }
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    msg = "Not enough players to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n " + player.FullName + " voted to nuke baserapers");

msg = "You voted to nuke the other team camping your base";
if (!yesMatch.Success) ChatPlayer(player.Name);

/* Tally the votes */

int votes = 0;

/* Start timer if a valid command */

if (!server.RoundData.issetObject(kVoteTime)) {
    if (yesMatch.Success) {
        return false;
    }
    server.RoundData.setObject(kVoteTime, DateTime.Now);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n vote timer started");
}
DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

/* Count the vote in the voter's dictionary */
/* Votes are kept with the voter */
/* If the voter leaves, his votes are not counted */

if (!player.RoundData.issetBool(kCamp)) player.RoundData.setBool(kCamp, true);

/* Bail out if too much time has past */

if (since.TotalMinutes > timeout) {
    msg = "The voting time has expired, the nuke vote is cancelled!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 10);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n vote timeout expired");
    foreach (PlayerInfoInterface can in losers) {
        // Erase the vote
        if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
    }
    server.RoundData.unsetObject(kVoteTime);

    /* Losing team only gets to try this vote maxAttempts */
    attempts = 0;
    if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
    server.RoundData.setInt(keyAttempts, attempts + 1);
    
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3
if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction < 0 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction < 0 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}

/* Punish the campers */
String amsg = "Vote succeeded: " + campers + " team is being nuked for camping your deployment! Break out now!";
if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + amsg);
msg = "Vote succeeded: {0} seconds to nuke of " + campers + " team!";
plugin.SendGlobalYell("Vote succeeded: 5 seconds to nuke of " + campers + " team!", 15);

List<PlayerInfoInterface> bad = new List<PlayerInfoInterface>();
bad.AddRange((losing == 1) _ team2.players : team1.players);

if (server.RoundData.issetBool("BEARTRAP")) {
    if (level >= 2) plugin.ConsoleWarn("There is a timer thread that is already active! Aborting ...");
    return false;
}

Thread nuker = new Thread(new ThreadStart(delegate {
    try {
        server.RoundData.setBool("BEARTRAP", true);

        /* Losing team only gets to do this once */

        server.RoundData.setBool(key, true);

        int rsecs = 10;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.SendGlobalYell(String.Format(msg, rsecs), 1);
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
        plugin.SendTeamMessage(losing, amsg);
        plugin.SendTeamYell(losing, amsg, 15);
        foreach (PlayerInfoInterface nuke in bad) {
            nuke.RoundData.setBool("NUKE TWICE", true);
            plugin.KillPlayer(nuke.Name);
            if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n killing " + nuke.FullName);
            Thread.Sleep(100);
        }
    } catch (Exception e) {
        plugin.ConsoleException(e.ToString());
    } finally {
        if (server.RoundData.issetBool("BEARTRAP"))
            server.RoundData.unsetBool("BEARTRAP");
    }
}));

nuker.Name = "Nuker";
nuker.Start();



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

Originally Posted by PapaCharlie9*:

 

what I need to adjust the votenuke! only works for Conq. Locker and Metro

 

 

BF4 Code

 

Set first_check to this Expression:

 

Code:

(Regex.Match(server.Gamemode, @"(Conquest)").Success)
Change first_check to this Expression:

 

Code:

(Regex.Match(server.Gamemode, @"(Conquest)").Success && Regex.Match(server.MapFileName, @"(MP_Prison|XP0_Metro)").Success)
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Level*:

 

Change first_check to this Expression:

 

Code:

(Regex.Match(server.Gamemode, @"(Conquest)").Success && Regex.Match(server.MapFileName, @"(MP_Prison|XP0_Metro)").Success)
many thanks it works

 

can the yell msg be repeated?

 

Code:

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    [b]plugin.SendGlobalYell(msg, 20);  [/b]
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

many thanks it works

 

can the yell msg be repeated?

 

Code:

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    [b]plugin.SendGlobalYell(msg, 20);  [/b]
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}
Create a new limit to evaluate OnIntervalServer, set interval to 60 seconds (that will make the message repeat every 60 seconds), call it "Votenuke Repeater".

 

Set first_check to this Code:

 

IMPORTANT: This limit must have the SAME settings as the OnAnyChat limit! If you change percent or timeout or minPlayers or minTicketPercent or minTicketGap in the OnAnyChat limit, you must make the same change in thist limit.

 

Code:

/* VERSION 0.9.15/R7 BEARTRAP */
double percent = 25; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 50; // CUSTOMIZE: minimum ticket gap between winning and losing teams

String kCamp = "votecamp";
String kOncePrefix = "votecamp_once_";
String kVoteTime = "votecamp_time";

/* Bail out if no vote active */

if (!server.RoundData.issetObject(kVoteTime)) {
    return false;
}

/* Bail out if ticket ratio isn't large enough */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);

int losing = (t1 < t2) _ 1 : 2;
int level = 2;

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

String msg = "empty";

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    return false;
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    return false;
}

/* Tally the votes */

int votes = 0;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;

/* Bail out if too much time has past */

DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

if (since.TotalMinutes > timeout) {
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3

if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction == -1 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction == -1 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to NUKE " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + msg);
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Level*:

 

I use this code from you, without the Nuke Twice

 

 

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 35; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 50; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 3; // CUSTOMIZE: maximum number of attempts

String kCamp = "votenuke";
String kOncePrefix = "votenuke_once_";
String kVoteTime = "votenuke_time";
String kAttemptsPrefix = "votenuke_attempts_";


int level = 2;

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

String msg = "empty";

Action<String> ChatPlayer = delegate(String name) {
    // closure bound to String msg
    plugin.ServerCommand("admin.say", msg, "player", name);
    plugin.PRoConChat("ADMIN to " + name + " > *** " + msg);
};


/* Parse the command */

Match campMatch = Regex.Match(player.LastChat, @"^\s*!vote\s*nuke", RegexOptions.IgnoreCase);
Match yesMatch = Regex.Match(player.LastChat, @"^\s*!yes", RegexOptions.IgnoreCase);
Match cancelMatch = Regex.Match(player.LastChat, @"^\s*!cancelvote", RegexOptions.IgnoreCase);

/* Check for admin cancel */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);
int losing = (t1 < t2) _ 1 : 2;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;
String keyAttempts = kAttemptsPrefix + losing;
int attempts = 0;

if (cancelMatch.Success) {
    bool canKill = false;
    bool canKick = false;
    bool canBan = false;
    bool canMove = false;
    bool canChangeLevel = false;
    if (plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel)) {
        if (canKick) {
            plugin.SendGlobalMessage("votenuke has been cancelled!");
            foreach (PlayerInfoInterface can in losers) {
                // Erase the vote
                if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
            }
            server.RoundData.unsetObject(kVoteTime);

            /* Losing team only gets to try this vote maxAttempts */
            attempts = 0;
            if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
            server.RoundData.setInt(keyAttempts, attempts + 1);
        } else {
            ChatPlayer("You are not authorized to use this command");
        }
    } else {
        ChatPlayer("Nice try, but only admins can use that command");
    }
    return false;
}

/* Bail out if not a proper vote */

if (!campMatch.Success && !yesMatch.Success) return false;

/* Bail out if this player already voted */

if (player.RoundData.issetBool(kCamp)) {
    msg = "You already voted on this votenuke attempt!";
    ChatPlayer(player.Name);
    return false;
}

/* Bail out if round about to end */

if (server.RemainTicketsPercent(1) < minTicketPercent || server.RemainTicketsPercent(2) < minTicketPercent) {
    msg = "Round too close to ending to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if ticket ratio isn't large enough */

if (Math.Abs(t1 - t2) < minTicketGap) {
    msg = "Ticket counts too close to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if voter is not on the losing team */


if (player.TeamId != losing) {
    msg = "You are not on the losing team!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    msg = "Your team already completed a nuke vote this round!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if maxAttempts made */

if (server.RoundData.issetInt(keyAttempts)) {
    attempts = server.RoundData.getInt(keyAttempts);
    if (attempts >= maxAttempts) {
        msg = "Your team already made " + maxAttempts + " attempts at nuking this round!";
        if (!yesMatch.Success) ChatPlayer(player.Name);
        return false;
    }
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    msg = "Not enough players to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n " + player.FullName + " voted to nuke baserapers");

msg = "You voted to nuke the other team camping your base";
if (!yesMatch.Success) ChatPlayer(player.Name);

/* Tally the votes */

int votes = 0;

/* Start timer if a valid command */

if (!server.RoundData.issetObject(kVoteTime)) {
    if (yesMatch.Success) {
        return false;
    }
    server.RoundData.setObject(kVoteTime, DateTime.Now);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n vote timer started");
}
DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

/* Count the vote in the voter's dictionary */
/* Votes are kept with the voter */
/* If the voter leaves, his votes are not counted */

if (!player.RoundData.issetBool(kCamp)) player.RoundData.setBool(kCamp, true);

/* Bail out if too much time has past */

if (since.TotalMinutes > timeout) {
    msg = "The voting time has expired, the nuke vote is cancelled!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 10);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n vote timeout expired");
    foreach (PlayerInfoInterface can in losers) {
        // Erase the vote
        if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
    }
    server.RoundData.unsetObject(kVoteTime);

    /* Losing team only gets to try this vote maxAttempts */
    attempts = 0;
    if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
    server.RoundData.setInt(keyAttempts, attempts + 1);
    
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3
if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction < 0 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction < 0 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 20);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}

/* Punish the campers */
String amsg = "Vote succeeded: " + campers + " team is being nuked for camping your deployment! Break out now!";
if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + amsg);
msg = "Vote succeeded: {0} seconds to nuke of " + campers + " team!";
plugin.SendGlobalYell("Vote succeeded: 5 seconds to nuke of " + campers + " team!", 15);

List<PlayerInfoInterface> bad = new List<PlayerInfoInterface>();
bad.AddRange((losing == 1) _ team2.players : team1.players);

if (server.RoundData.issetBool("BEARTRAP")) {
    if (level >= 2) plugin.ConsoleWarn("There is a timer thread that is already active! Aborting ...");
    return false;
}

Thread nuker = new Thread(new ThreadStart(delegate {
    try {
        server.RoundData.setBool("BEARTRAP", true);

        /* Losing team only gets to do this once */

        server.RoundData.setBool(key, true);

        int rsecs = 10;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.SendGlobalYell(String.Format(msg, rsecs), 1);
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
        plugin.SendTeamMessage(losing, amsg);
        plugin.SendTeamYell(losing, amsg, 15);
        foreach (PlayerInfoInterface nuke in bad) {
            nuke.RoundData.setBool("NUKE TWICE", true);
            plugin.KillPlayer(nuke.Name);
            if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n killing " + nuke.FullName);
            Thread.Sleep(100);
        }
    } catch (Exception e) {
        plugin.ConsoleException(e.ToString());
    } finally {
        if (server.RoundData.issetBool("BEARTRAP"))
            server.RoundData.unsetBool("BEARTRAP");
    }
}));

nuker.Name = "Nuker";
nuker.Start();



return false;

Create a new limit to evaluate OnIntervalServer, set interval to 60 seconds (that will make the message repeat every 60 seconds), call it "Votenuke Repeater".

 

Set first_check to this Code:

 

IMPORTANT: This limit must have the SAME settings as the OnAnyChat limit! If you change percent or timeout or minPlayers or minTicketPercent or minTicketGap in the OnAnyChat limit, you must make the same change in thist limit.

 

Code:

/* VERSION 0.9.15/R7 BEARTRAP */
double percent = 25; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 50; // CUSTOMIZE: minimum ticket gap between winning and losing teams

String kCamp = "votecamp";
String kOncePrefix = "votecamp_once_";
String kVoteTime = "votecamp_time";

/* Bail out if no vote active */

if (!server.RoundData.issetObject(kVoteTime)) {
    return false;
}

/* Bail out if ticket ratio isn't large enough */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);

int losing = (t1 < t2) _ 1 : 2;
int level = 2;

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

String msg = "empty";

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    return false;
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    return false;
}

/* Tally the votes */

int votes = 0;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;

/* Bail out if too much time has past */

DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

if (since.TotalMinutes > timeout) {
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3

if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction == -1 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction == -1 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to NUKE " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + msg);
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment
  • 4 weeks later...

Originally Posted by Level*:

 

Votenuke Repeater dont work for me:

 

Votenuke.png

 

Here are my Settings:

 

Votenuke OnAnyChat, Expression:

 

Code:

(Regex.Match(server.Gamemode, @"(Conquest)").Success && Regex.Match(server.MapFileName, @"(MP_Prison|XP0_Metro)").Success)
Code:

 

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 35; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 50; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 3; // CUSTOMIZE: maximum number of attempts

String kCamp = "votenuke";
String kOncePrefix = "votenuke_once_";
String kVoteTime = "votenuke_time";
String kAttemptsPrefix = "votenuke_attempts_";


int level = 2;

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

String msg = "empty";

Action<String> ChatPlayer = delegate(String name) {
    // closure bound to String msg
    plugin.ServerCommand("admin.say", msg, "player", name);
    plugin.PRoConChat("ADMIN to " + name + " > *** " + msg);
};


/* Parse the command */

Match campMatch = Regex.Match(player.LastChat, @"^\s*!vote\s*nuke", RegexOptions.IgnoreCase);
Match yesMatch = Regex.Match(player.LastChat, @"^\s*!yes", RegexOptions.IgnoreCase);
Match cancelMatch = Regex.Match(player.LastChat, @"^\s*!cancelvote", RegexOptions.IgnoreCase);

/* Check for admin cancel */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);
int losing = (t1 < t2) _ 1 : 2;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;
String keyAttempts = kAttemptsPrefix + losing;
int attempts = 0;

if (cancelMatch.Success) {
    bool canKill = false;
    bool canKick = false;
    bool canBan = false;
    bool canMove = false;
    bool canChangeLevel = false;
    if (plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel)) {
        if (canKick) {
            plugin.SendGlobalMessage("votenuke has been cancelled!");
            foreach (PlayerInfoInterface can in losers) {
                // Erase the vote
                if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
            }
            server.RoundData.unsetObject(kVoteTime);

            /* Losing team only gets to try this vote maxAttempts */
            attempts = 0;
            if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
            server.RoundData.setInt(keyAttempts, attempts + 1);
        } else {
            ChatPlayer("You are not authorized to use this command");
        }
    } else {
        ChatPlayer("Nice try, but only admins can use that command");
    }
    return false;
}

/* Bail out if not a proper vote */

if (!campMatch.Success && !yesMatch.Success) return false;

/* Bail out if this player already voted */

if (player.RoundData.issetBool(kCamp)) {
    msg = "You already voted on this votenuke attempt!";
    ChatPlayer(player.Name);
    return false;
}

/* Bail out if round about to end */

if (server.RemainTicketsPercent(1) < minTicketPercent || server.RemainTicketsPercent(2) < minTicketPercent) {
    msg = "Round too close to ending to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if ticket ratio isn't large enough */

if (Math.Abs(t1 - t2) < minTicketGap) {
    msg = "Ticket counts too close to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if voter is not on the losing team */


if (player.TeamId != losing) {
    msg = "You are not on the losing team!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    msg = "Your team already completed a nuke vote this round!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if maxAttempts made */

if (server.RoundData.issetInt(keyAttempts)) {
    attempts = server.RoundData.getInt(keyAttempts);
    if (attempts >= maxAttempts) {
        msg = "Your team already made " + maxAttempts + " attempts at nuking this round!";
        if (!yesMatch.Success) ChatPlayer(player.Name);
        return false;
    }
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    msg = "Not enough players to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n " + player.FullName + " voted to nuke baserapers");

msg = "You voted to nuke the other team camping your base";
if (!yesMatch.Success) ChatPlayer(player.Name);

/* Tally the votes */

int votes = 0;

/* Start timer if a valid command */

if (!server.RoundData.issetObject(kVoteTime)) {
    if (yesMatch.Success) {
        return false;
    }
    server.RoundData.setObject(kVoteTime, DateTime.Now);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n vote timer started");
}
DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

/* Count the vote in the voter's dictionary */
/* Votes are kept with the voter */
/* If the voter leaves, his votes are not counted */

if (!player.RoundData.issetBool(kCamp)) player.RoundData.setBool(kCamp, true);

/* Bail out if too much time has past */

if (since.TotalMinutes > timeout) {
    msg = "The voting time has expired, the nuke vote is cancelled!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 10);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n vote timeout expired");
    foreach (PlayerInfoInterface can in losers) {
        // Erase the vote
        if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
    }
    server.RoundData.unsetObject(kVoteTime);

    /* Losing team only gets to try this vote maxAttempts */
    attempts = 0;
    if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
    server.RoundData.setInt(keyAttempts, attempts + 1);
    
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3
if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction < 0 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction < 0 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 16);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}

/* Punish the campers */
String amsg = "Vote succeeded: " + campers + " team is being nuked for camping your deployment! Break out now!";
if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + amsg);
msg = "Vote succeeded: {0} seconds to nuke of " + campers + " team!";
plugin.SendGlobalYell("Vote succeeded: 5 seconds to nuke of " + campers + " team!", 15);

List<PlayerInfoInterface> bad = new List<PlayerInfoInterface>();
bad.AddRange((losing == 1) _ team2.players : team1.players);

if (server.RoundData.issetBool("BEARTRAP")) {
    if (level >= 2) plugin.ConsoleWarn("There is a timer thread that is already active! Aborting ...");
    return false;
}

Thread nuker = new Thread(new ThreadStart(delegate {
    try {
        server.RoundData.setBool("BEARTRAP", true);

        /* Losing team only gets to do this once */

        server.RoundData.setBool(key, true);

        int rsecs = 10;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.SendGlobalYell(String.Format(msg, rsecs), 1);
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
        plugin.SendTeamMessage(losing, amsg);
        plugin.SendTeamYell(losing, amsg, 15);
        foreach (PlayerInfoInterface nuke in bad) {
            nuke.RoundData.setBool("NUKE TWICE", true);
            plugin.KillPlayer(nuke.Name);
            if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n killing " + nuke.FullName);
            Thread.Sleep(100);
        }
    } catch (Exception e) {
        plugin.ConsoleException(e.ToString());
    } finally {
        if (server.RoundData.issetBool("BEARTRAP"))
            server.RoundData.unsetBool("BEARTRAP");
    }
}));

nuker.Name = "Nuker";
nuker.Start();



return false;
And Votenuke Repeater, OnIntervalServer, 60

 

Code:

 

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 35; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 16; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 10; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 50; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 3; // CUSTOMIZE: maximum number of attempts


String kCamp = "votecamp";
String kOncePrefix = "votecamp_once_";
String kVoteTime = "votecamp_time";

/* Bail out if no vote active */

if (!server.RoundData.issetObject(kVoteTime)) {
    return false;
}

/* Bail out if ticket ratio isn't large enough */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);

int losing = (t1 < t2) _ 1 : 2;
int level = 2;

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

String msg = "empty";

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    return false;
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    return false;
}

/* Tally the votes */

int votes = 0;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;

/* Bail out if too much time has past */

DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

if (since.TotalMinutes > timeout) {
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3

if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction == -1 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction == -1 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to NUKE " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + msg);
}
return false;
* Restored post. It could be that the author is no longer active.
Link to comment
  • 2 weeks later...

Originally Posted by moacco07*:

 

Another question, what about stage? For example Siege of shanghai there are 10 mcoms and Procon don't recognize mcoms right, what about by stage level. All together there are 5 stages 2 mcoms each. Is procon able to read by stage and if so is it possible to disable the votenuke for attackers on the last stage instead of mcoms?

 

I'm just trying my luck here.

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

Originally Posted by PapaCharlie9*:

 

Another question, what about stage? For example Siege of shanghai there are 10 mcoms and Procon don't recognize mcoms right, what about by stage level. All together there are 5 stages 2 mcoms each. Is procon able to read by stage and if so is it possible to disable the votenuke for attackers on the last stage instead of mcoms?

 

I'm just trying my luck here.

Theoretically that is possible, but would be very difficult to code. You would have to monitor each OnSpawn event and detect when the lowest score increases to a higher level. That would indicate that a new stage has started.

 

Determining the "last" stage is not possible, since no one know what the last stage is until the round is over. Suppose the defenders successfully defend both mcoms on the first stage? That means the first stage is the last stage. See what I mean?

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

Originally Posted by moacco07*:

 

thank you for excellent explanation and i understand. How i wish that both server and procon can relays all information. It will be great tho.. Thank you PC9.

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

Originally Posted by pspjim*:

 

I used this code and everything works fine untill i tried to increase the available times to votenuke by deleting the follow codes:

 

Code:

/* Bail out if this team already completed a vote camp this round */

String key = kOncePrefix + losing;
if (server.RoundData.issetBool(key)) {
    msg = "Your team already completed a nuke vote this round!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
all I want to do is the allow players to succesfully votenuke as many times as they wanted.

 

following are my current codes

 

Code:

/* VERSION 0.9/R8-yes-cancel */
double percent = 30; // CUSTOMIZE: of losing team that has to vote
double timeout = 5.0; // CUSTOMIZE: number of minutes before vote times out
int minPlayers = 10; // CUSTOMIZE: minimum players to enable vote
double minTicketPercent = 5; // CUSTOMIZE: minimum ticket percentage remaining in the round
double minTicketGap = 5; // CUSTOMIZE: minimum ticket gap between winning and losing teams
int maxAttempts = 30; // CUSTOMIZE: maximum number of attempts

String kCamp = "votenuke";
String kOncePrefix = "votenuke_once_";
String kVoteTime = "votenuke_time";
String kAttemptsPrefix = "votenuke_attempts_";


int level = 2;

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

String msg = "empty";

Action<String> ChatPlayer = delegate(String name) {
    // closure bound to String msg
    plugin.ServerCommand("admin.say", msg, "player", name);
    plugin.PRoConChat("ADMIN to " + name + " > *** " + msg);
};


/* Parse the command */

Match campMatch = Regex.Match(player.LastChat, @"^\s*!vote\s*nuke", RegexOptions.IgnoreCase);
Match yesMatch = Regex.Match(player.LastChat, @"^\s*!yes", RegexOptions.IgnoreCase);
Match cancelMatch = Regex.Match(player.LastChat, @"^\s*!cancelvote", RegexOptions.IgnoreCase);

/* Check for admin cancel */

double t1 = server.RemainTickets(1);
double t2 = server.RemainTickets(2);
int losing = (t1 < t2) _ 1 : 2;
List<PlayerInfoInterface> losers = (losing == 1) _ team1.players : team2.players;
String keyAttempts = kAttemptsPrefix + losing;
int attempts = 0;

if (cancelMatch.Success) {
    bool canKill = false;
    bool canKick = false;
    bool canBan = false;
    bool canMove = false;
    bool canChangeLevel = false;
    if (plugin.CheckAccount(player.Name, out canKill, out canKick, out canBan, out canMove, out canChangeLevel)) {
        if (canKick) {
            plugin.SendGlobalMessage("votenuke has been cancelled!");
            foreach (PlayerInfoInterface can in losers) {
                // Erase the vote
                if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
            }
            server.RoundData.unsetObject(kVoteTime);

            /* Losing team only gets to try this vote maxAttempts */
            attempts = 0;
            if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
            server.RoundData.setInt(keyAttempts, attempts + 1);
        } else {
            ChatPlayer("You are not authorized to use this command");
        }
    } else {
        ChatPlayer("Nice try, but only admins can use that command");
    }
    return false;
}

/* Bail out if not a proper vote */

if (!campMatch.Success && !yesMatch.Success) return false;

/* Bail out if this player already voted */

if (player.RoundData.issetBool(kCamp)) {
    msg = "You already voted on this votenuke attempt!";
    ChatPlayer(player.Name);
    return false;
}

/* Bail out if round about to end */

if (server.RemainTicketsPercent(1) < minTicketPercent || server.RemainTicketsPercent(2) < minTicketPercent) {
    msg = "Round too close to ending to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if ticket ratio isn't large enough */

if (Math.Abs(t1 - t2) < minTicketGap) {
    msg = "Ticket counts too close to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if voter is not on the losing team */


if (player.TeamId != losing) {
    msg = "You are not on the losing team!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

/* Bail out if maxAttempts made */

if (server.RoundData.issetInt(keyAttempts)) {
    attempts = server.RoundData.getInt(keyAttempts);
    if (attempts >= maxAttempts) {
        msg = "Your team already made " + maxAttempts + " attempts at nuking this round!";
        if (!yesMatch.Success) ChatPlayer(player.Name);
        return false;
    }
}

/* Bail out if not enough players to enable vote */

if (server.PlayerCount < minPlayers) {
    msg = "Not enough players to hold a nuke vote!";
    if (!yesMatch.Success) ChatPlayer(player.Name);
    return false;
}

if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n " + player.FullName + " voted to nuke baserapers");

msg = "You voted to nuke the other team camping your base";
if (!yesMatch.Success) ChatPlayer(player.Name);

/* Tally the votes */

int votes = 0;

/* Start timer if a valid command */

if (!server.RoundData.issetObject(kVoteTime)) {
    if (yesMatch.Success) {
        return false;
    }
    server.RoundData.setObject(kVoteTime, DateTime.Now);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNuke]^n vote timer started");
}
DateTime started = (DateTime)server.RoundData.getObject(kVoteTime);
TimeSpan since = DateTime.Now.Subtract(started);

/* Count the vote in the voter's dictionary */
/* Votes are kept with the voter */
/* If the voter leaves, his votes are not counted */

if (!player.RoundData.issetBool(kCamp)) player.RoundData.setBool(kCamp, true);

/* Bail out if too much time has past */

if (since.TotalMinutes > timeout) {
    msg = "The voting time has expired, the nuke vote is cancelled!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 10);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n vote timeout expired");
    foreach (PlayerInfoInterface can in losers) {
        // Erase the vote
        if (can.RoundData.issetBool(kCamp)) can.RoundData.unsetBool(kCamp);
    }
    server.RoundData.unsetObject(kVoteTime);

    /* Losing team only gets to try this vote maxAttempts */
    attempts = 0;
    if (server.RoundData.issetInt(keyAttempts)) attempts = server.RoundData.getInt(keyAttempts);
    server.RoundData.setInt(keyAttempts, attempts + 1);
    
    return false;
}

/* Otherwise tally */

foreach(PlayerInfoInterface p in losers) {
    if (p.RoundData.issetBool(kCamp)) votes++;
}
if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n loser votes = " + votes + " of " + losers.Count);

int needed = Convert.ToInt32(Math.Ceiling((double) losers.Count * (percent/100.0)));
int remain = needed - votes;

if (level >= 3) plugin.ConsoleWrite("^b[VoteNuke]^n needed = " + needed);

String campers = (losing == 1) _ "RU" : "US"; // BF3
String voters = (losing == 1) _ "US" : "RU"; // BF3
if (server.GameVersion == "BF4") {
    String[] factionNames = new String[]{"US", "RU", "CN"};
    int f1 = (team1.Faction < 0 || team1.Faction > 2) _ 0 : team1.Faction;
    int f2 = (team2.Faction < 0 || team2.Faction > 2) _ 1 : team2.Faction;
    campers = (losing == 1) _ factionNames[f2] : factionNames[f1];
    voters = (losing == 1) _ factionNames[f1] : factionNames[f2];
}

if (remain > 0) {
    msg = remain + " " + voters + " votes needed to punish " + campers + " team! " + Convert.ToInt32(Math.Ceiling(timeout - since.TotalMinutes)) + " mins left to vote!";
    plugin.SendGlobalMessage(msg);
    plugin.SendGlobalYell(msg, 8);
    if (level >= 2) plugin.ConsoleWrite("^b[VoteNote]^n " + msg);
    return false;
}

/* Punish the campers */
String amsg = "Vote succeeded: " + campers + " team is being nuked for camping your deployment! Break out now!";
if (level >= 2) plugin.ConsoleWrite("^b[VoteCamp]^n " + amsg);
msg = "Vote succeeded: {0} seconds to nuke of " + campers + " team!";
plugin.SendGlobalYell("Vote succeeded: 5 seconds to nuke of " + campers + " team!", 15);

List<PlayerInfoInterface> bad = new List<PlayerInfoInterface>();
bad.AddRange((losing == 1) _ team2.players : team1.players);

if (server.RoundData.issetBool("BEARTRAP")) {
    if (level >= 2) plugin.ConsoleWarn("There is a timer thread that is already active! Aborting ...");
    return false;
}

Thread nuker = new Thread(new ThreadStart(delegate {
    try {
        server.RoundData.setBool("BEARTRAP", true);

        /* Losing team only gets to do this once */

        server.RoundData.setBool(key, true);

        int rsecs = 5;
        while (rsecs > 0) {
            plugin.SendGlobalMessage(String.Format(msg, rsecs));
            plugin.PRoConChat(String.Format(msg, rsecs));
            --rsecs;
            Thread.Sleep(1*1000);
        }
        plugin.SendTeamMessage(losing, amsg);
        plugin.SendTeamYell(losing, amsg, 15);
        foreach (PlayerInfoInterface nuke in bad) {
            nuke.RoundData.setBool("NUKE TWICE", true);
            plugin.KillPlayer(nuke.Name);
            if (level >= 3) plugin.ConsoleWrite("^b[VoteCamp]^n killing " + nuke.FullName);
            Thread.Sleep(100);
        }
    } catch (Exception e) {
        plugin.ConsoleException(e.ToString());
    } finally {
        if (server.RoundData.issetBool("BEARTRAP"))
            server.RoundData.unsetBool("BEARTRAP");
    }
}));

nuker.Name = "Nuker";
nuker.Start();



return false;
I am receiving follow message

[16:50:07 16] [insane Limits] Thread(settings): Compiling Limit #3 - Votenuke - OnAnyChat

[16:50:07 26] [insane Limits] Thread(settings): ERROR: 1 error compiling Expression

[16:50:07 26] [insane Limits] Thread(settings): ERROR: (CS0103, line: 268, column: 46): The name 'key' does not exist in the current context

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

Originally Posted by thunderje*:

 

hi guys

im really green with insane limits,would anyone have the time to setup insane limits on my server with this plugin,im running a bf4 server and feel free to come anytime.pm me if you can help

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