Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

  • Replies 3.2k
  • Created
  • Last Reply

Originally Posted by LCARSx64*:

 

Thanks!!! That helps a lot.

No problem, I'm happy to help. :smile:

 

Hi LCARSx64,

 

It works!!! One question, does this script reset the counter when the server has 0 players?

Yes and no. Basically the limit triggers every 30 seconds (OnIntervalServer) unless you changed the timing, so every time it's triggered it will check how many players are in the server. If there are 40 or more players, it will set the idle timeout to 300, if there are less players (including 0) it will set the idle timeout to 86400. So technically when the server is empty, the idle timeout will be 86400 seconds.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by buzZzer*:

 

Any chance to script an No SMAW/K10 Server with Multi-Action -> 1st Kill, 2nd Kill, 3rd kill, 4rd kick, 5rd ban for SMAW/K10 for BFHL?

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

Originally Posted by LCARSx64*:

 

Any chance to script an No SMAW/K10 Server with Multi-Action -> 1st Kill, 2nd Kill, 3rd kill, 4rd kick, 5rd ban for SMAW/K10 for BFHL?

While I don't have BFHL nor do I have access to a server for it, the following should work. This limit will keep its count per player even if they leave/are kicked from the server, however the count will be reset on server/Procon layer or plugin restart.


No SMAW or K10

 

Create a new limit to evaluate OnKill. Set action to None.

 

Set first_check to this Code:

Code:

// BFH No SMAW or K10 - Limit 1 of 1
// v1.0 - OnKill - first_check
//

if (!Regex.Match(kill.Weapon, @"(u_smaw|u_sp_smaw|U_K10)").Success) return false;

String kcKey = player.Name + "_NOSMAWK10_";
int kcCount = 0;
String msg = "SMAW and K10 are not permitted! (Warning ";
String[] logMsgs = { "^b^1No SMAW or K10^0^n: ",
                     "No SMAW or K10: ",
                     player.Name + " has been killed! (Warning ",
                     player.Name + " has been kicked! (Warning ",
                     player.Name + " has been banned! (Warning ",
                     " of 5" };

if (server.Data.issetInt(kcKey)) kcCount = server.Data.getInt(kcKey);
kcCount++;
switch (kcCount)
{
    case 1:
    case 2:
    case 3:
        msg = msg + kcCount.ToString() + logMsgs[5];
        logMsgs[0] = logMsgs[0] + logMsgs[2] + kcCount.ToString() + logMsgs[5];
        logMsgs[1] = logMsgs[1] + logMsgs[2] + kcCount.ToString() + logMsgs[5];
        plugin.SendPlayerMessage(player.Name, msg);
        plugin.SendPlayerYell(player.Name, "/n" + msg, 8);
        plugin.ConsoleWrite(logMsgs[0]);
        plugin.PRoConChat(logMsgs[0]);
        plugin.PRoConEvent(logMsgs[1], "Insane Limits");
        plugin.KillPlayer(player.Name);
        break;
    case 4:
        msg = msg + kcCount.ToString() + logMsgs[5];
        logMsgs[0] = logMsgs[0] + logMsgs[3] + kcCount.ToString() + logMsgs[5];
        logMsgs[1] = logMsgs[1] + logMsgs[3] + kcCount.ToString() + logMsgs[5];
        plugin.ConsoleWrite(logMsgs[0]);
        plugin.PRoConChat(logMsgs[0]);
        plugin.PRoConEvent(logMsgs[1], "Insane Limits");
        plugin.KickPlayerWithMessage(player.Name, msg);
        break;
    case 5:
        msg = msg + kcCount.ToString() + logMsgs[5];
        logMsgs[0] = logMsgs[0] + logMsgs[4] + kcCount.ToString() + logMsgs[5];
        logMsgs[1] = logMsgs[1] + logMsgs[4] + kcCount.ToString() + logMsgs[5];
        plugin.ConsoleWrite(logMsgs[0]);
        plugin.PRoConChat(logMsgs[0]);
        plugin.PRoConEvent(logMsgs[1], "Insane Limits");
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Permanent, player.Name, 0, msg);
        server.Data.unsetInt(kcKey);
        return false;
        break;
}
server.Data.setInt(kcKey, kcCount);

return false;

End of post.

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

Originally Posted by moacco07*:

 

No problem, I'm happy to help. :smile:

 

 

 

Yes and no. Basically the limit triggers every 30 seconds (OnIntervalServer) unless you changed the timing, so every time it's triggered it will check how many players are in the server. If there are 40 or more players, it will set the idle timeout to 300, if there are less players (including 0) it will set the idle timeout to 86400. So technically when the server is empty, the idle timeout will be 86400 seconds.

Thank you very much for the confirmation.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Thank you very much for the confirmation.

No problem. :smile: Even though that limit does what you wanted, it does not do it exactly as you asked. If you'd like it to be exact then it would require 2 limits (OnJoin and OnLeave) that I could write for you instead.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by moacco07*:

 

No problem. :smile: Even though that limit does what you wanted, it does not do it exactly as you asked. If you'd like it to be exact then it would require 2 limits (OnJoin and OnLeave) that I could write for you instead.

Sure Sir,

 

That will be great.

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

Originally Posted by LCARSx64*:

 

Sure Sir,

 

That will be great.

Here you go:

 


Adaptive Idle Timeout - Limit 1 of 2

 

Create a new limit to evaluate OnJoin. Set action to None.

 

Set first_check to this Code:

Code:

// Adaptive Idle Timeout - Limit 1 of 2
// v2.1 - OnJoin - first_check
//

String[] msgs = { "^b^1Adaptive Idle Timeout^0^n: ",
                  "Adaptive Idle Timeout: ",
                  "Idle Timeout has been set to ",
                  " seconds, player count is " };
String prevKey = "_IDLE_TIMEOUT_";
int idleTimeout = 86400;
int prevTimeout = 0;
int pCount = server.PlayerCount;

if (server.Data.issetInt(prevKey)) prevTimeout = server.Data.getInt(prevKey);
if (pCount >= 40) idleTimeout = 300;
if (idleTimeout != prevTimeout)
{
    plugin.ServerCommand("vars.idleTimeout", idleTimeout.ToString());
    plugin.ConsoleWrite(msgs[0] + msgs[2] + idleTimeout.ToString() + msgs[3] + pCount.ToString() + ".");
    plugin.PRoConChat(msgs[0] + msgs[2] + idleTimeout.ToString() + msgs[3] + pCount.ToString() + ".");
    plugin.PRoConEvent(msgs[1] + msgs[2] + idleTimeout.ToString() + msgs[3] + pCount.ToString() + ".", "Insane Limits");
    server.Data.setInt(prevKey, idleTimeout);
}

return false;

Adaptive Idle Timeout - Limit 2 of 2

 

Create a new limit to evaluate OnLeave. Set action to None.

 

Set first_check to this Code:

Code:

// Adaptive Idle Timeout - Limit 2 of 2
// v2.1 - OnLeave - first_check
//

String[] msgs = { "^b^1Adaptive Idle Timeout^0^n: ",
                  "Adaptive Idle Timeout: ",
                  "Idle Timeout has been set to ",
                  " seconds, player count is " };
String prevKey = "_IDLE_TIMEOUT_";
int idleTimeout = 86400;
int prevTimeout = 0;
int pCount = server.PlayerCount;

if (server.Data.issetInt(prevKey)) prevTimeout = server.Data.getInt(prevKey);
if (pCount >= 40) idleTimeout = 300;
if (idleTimeout != prevTimeout)
{
    plugin.ServerCommand("vars.idleTimeout", idleTimeout.ToString());
    plugin.ConsoleWrite(msgs[0] + msgs[2] + idleTimeout.ToString() + msgs[3] + pCount.ToString() + ".");
    plugin.PRoConChat(msgs[0] + msgs[2] + idleTimeout.ToString() + msgs[3] + pCount.ToString() + ".");
    plugin.PRoConEvent(msgs[1] + msgs[2] + idleTimeout.ToString() + msgs[3] + pCount.ToString() + ".", "Insane Limits");
    server.Data.setInt(prevKey, idleTimeout);
}

return false;

End of post.

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

Originally Posted by buzZzer*:

 

THX! Works fine! :biggrin:

 

 

While I don't have BFHL nor do I have access to a server for it, the following should work. This limit will keep its count per player even if they leave/are kicked from the server, however the count will be reset on server/Procon layer or plugin restart.


No SMAW or K10

 

Create a new limit to evaluate OnKill. Set action to None.

 

Set first_check to this Code:

Code:

// BFH No SMAW or K10 - Limit 1 of 1
// v1.0 - OnKill - first_check
//

if (!Regex.Match(kill.Weapon, @"(u_smaw|u_sp_smaw|U_K10)").Success) return false;

String kcKey = player.Name + "_NOSMAWK10_";
int kcCount = 0;
String msg = "SMAW and K10 are not permitted! (Warning ";
String[] logMsgs = { "^b^1No SMAW or K10^0^n: ",
                     "No SMAW or K10: ",
                     player.Name + " has been killed! (Warning ",
                     player.Name + " has been kicked! (Warning ",
                     player.Name + " has been banned! (Warning ",
                     " of 5" };

if (server.Data.issetInt(kcKey)) kcCount = server.Data.getInt(kcKey);
kcCount++;
switch (kcCount)
{
    case 1:
    case 2:
    case 3:
        msg = msg + kcCount.ToString() + logMsgs[5];
        logMsgs[0] = logMsgs[0] + logMsgs[2] + kcCount.ToString() + logMsgs[5];
        logMsgs[1] = logMsgs[1] + logMsgs[2] + kcCount.ToString() + logMsgs[5];
        plugin.SendPlayerMessage(player.Name, msg);
        plugin.SendPlayerYell(player.Name, "/n" + msg, 8);
        plugin.ConsoleWrite(logMsgs[0]);
        plugin.PRoConChat(logMsgs[0]);
        plugin.PRoConEvent(logMsgs[1], "Insane Limits");
        plugin.KillPlayer(player.Name);
        break;
    case 4:
        msg = msg + kcCount.ToString() + logMsgs[5];
        logMsgs[0] = logMsgs[0] + logMsgs[3] + kcCount.ToString() + logMsgs[5];
        logMsgs[1] = logMsgs[1] + logMsgs[3] + kcCount.ToString() + logMsgs[5];
        plugin.ConsoleWrite(logMsgs[0]);
        plugin.PRoConChat(logMsgs[0]);
        plugin.PRoConEvent(logMsgs[1], "Insane Limits");
        plugin.KickPlayerWithMessage(player.Name, msg);
        break;
    case 5:
        msg = msg + kcCount.ToString() + logMsgs[5];
        logMsgs[0] = logMsgs[0] + logMsgs[4] + kcCount.ToString() + logMsgs[5];
        logMsgs[1] = logMsgs[1] + logMsgs[4] + kcCount.ToString() + logMsgs[5];
        plugin.ConsoleWrite(logMsgs[0]);
        plugin.PRoConChat(logMsgs[0]);
        plugin.PRoConEvent(logMsgs[1], "Insane Limits");
        plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Permanent, player.Name, 0, msg);
        server.Data.unsetInt(kcKey);
        return false;
        break;
}
server.Data.setInt(kcKey, kcCount);

return false;

End of post.

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

Originally Posted by LCARSx64*:

 

Gun Master, anyone know how to change the preset? and can insane limit be coded with random preset each round?

You add the following vars to your startup.txt to change the preset:

Code:

vars.gunMasterWeaponsPreset X

Where X is:

0 - Standard
1 - Classic
2 - Pistol
3 - DLC
4 - Troll
As for if it can be randomly changed each round, try the following limit:

NOTE: This is untested and may not work.

 

If you added vars.gunMasterWeaponsPreset to your startup.txt, change the value highlighted in red in the code to the same value as your startup.txt

If you don't want the limit to display the next preset in Procon chat, remove the lines highlighted in green from the code.


BF4 Gunmaster Random Presets

 

Create a new limit to evaluate OnRoundOver. Set action to None.

 

Set first_check to this Code:

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 0;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC",
                  "Troll" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(5);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(5);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;

End of post.

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

Originally Posted by LCARSx64*:

 

Hello LCARSx64

Thank you this code is work

 

But i want delete "Troll'' preset? Can you help me with this?

Change the code to this:

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 0;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(4);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(4);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

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

Originally Posted by NomNom*:

 

You add the following vars to your startup.txt to change the preset:

Code:

vars.gunMasterWeaponsPreset X

Where X is:

0 - Standard
1 - Classic
2 - Pistol
3 - DLC
4 - Troll
As for if it can be randomly changed each round, try the following limit:

NOTE: This is untested and may not work.

 

If you added vars.gunMasterWeaponsPreset to your startup.txt, change the value highlighted in red in the code to the same value as your startup.txt

If you don't want the limit to display the next preset in Procon chat, remove the lines highlighted in green from the code.


BF4 Gunmaster Random Presets

 

Create a new limit to evaluate OnRoundOver. Set action to None.

 

Set first_check to this Code:

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 0;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC",
                  "Troll" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(5);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(5);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;

End of post.

I'm loving this, is there any way for the plugin to tell people in chat that the next preset will be?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

I'm loving this, is there any way for the plugin to tell people in chat that the next preset will be?

Yes, find this line in the code:

Code:

plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
Add this line straight after it:

Code:

plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
If you want to send a yell message as well/instead, add this line:

Code:

plugin.SendGlobalYell("\nThe next Gunmaster preset will be: " + msgs[nextPreset], 8);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by NomNom*:

 

Yes, find this line in the code:

Code:

plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
Add this line straight after it:

Code:

plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
If you want to send a yell message as well/instead, add this line:

Code:

plugin.SendGlobalYell("\nThe next Gunmaster preset will be: " + msgs[nextPreset], 8);
Thank you, will test it now and let you know.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by binnysidhu*:

 

Thank you, will test it now and let you know.

Dumb question again , I can change the prsent on startup.txt , but where do i add the following code

 

// BF4 Gunmaster Random Presets - Limit 1 of 1

// v1.0 - OnRoundOver - first_check

//

 

int lastPreset = 0;

int nextPreset = 0;

Random rnd = new Random();

String lastKey = "_LASTGM_";

String[] msgs = { "Standard",

"Classic",

"Pistol",

"DLC",

"Troll" };

 

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);

nextPreset = rnd.Next(5);

while (nextPreset == lastPreset)

{

nextPreset = rnd.Next(5);

}

plugin.ServerCommand("vars.gunMasterWeaponsPreset" , nextPreset.ToString());

plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");

server.Data.setInt(lastKey, nextPreset);

 

return false;

 

on teh startup.txt as well _, If so , just after the preset ?

Also how does it work if I got vote map and Mix maps in my list of maps

please help

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

Originally Posted by LCARSx64*:

 

Dumb question again , I can change the prsent on startup.txt , but where do i add the following code

 

on teh startup.txt as well _, If so , just after the preset ?

Also how does it work if I got vote map and Mix maps in my list of maps

please help

You only add the vars.gunMasterWeaponsPreset to the startup.txt, the code I supplied is a limit for the Insane Limits plugin. Install Insane Limits if you haven't already done so (see post #1 here: showthread....R-2015%29-BFHL* )

Create a new limit with the plugin, using the details in the lower half of the following post: myrcon.net/...insane-limits-requests#entry27913

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

Originally Posted by daveee*:

 

Yes, find this line in the code:

Code:

plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
Add this line straight after it:

Code:

plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
If you want to send a yell message as well/instead, add this line:

Code:

plugin.SendGlobalYell("\nThe next Gunmaster preset will be: " + msgs[nextPreset], 8);
I'm not getting the "The next gunmater preset will be:" messages, code is here:

 

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 1;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(5);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(5);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;
Not sure if I should't have that third line in there?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

I'm not getting the "The next gunmater preset will be:" messages, code is here:

 

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 1;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(5);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(5);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;
Not sure if I should't have that third line in there?
I'm assuming that you don't want the Troll preset. There's an error in the code you posted that could cause the message issue, it would also possibly cause the preset to be set to Troll.

 

The code you posted needs the following modifications (highlighted in red):

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 1;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(4);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(4);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;
See if that fixes your problem. :ohmy:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by daveee*:

 

I'm assuming that you don't want the Troll preset, if that is correct then there's an error in the code you posted that could cause the message issue, it would also possibly cause the preset to be set to Troll.

 

The code you posted needs the following modifications (highlighted in red):

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 1;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(4);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(4);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;
See if that fixes your problem. :ohmy:
Will do, I thought that might be the case but wasn't entirely sure. Thanks for the help :smile:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by binnysidhu*:

 

You only add the vars.gunMasterWeaponsPreset to the startup.txt, the code I supplied is a limit for the Insane Limits plugin. Install Insane Limits if you haven't already done so (see post #1 here: showthread....R-2015%29-BFHL* )

Create a new limit with the plugin, using the details in the lower half of the following post: myrcon.net/...insane-limits-requests#entry27913

Thanks for that , just quick one , do I need to have every preset in the start.txt or just the one I put in ( say 4 ) and then user 4 in the config( where red mentioned )
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Thanks for that , just quick one , do I need to have every preset in the start.txt or just the one I put in ( say 4 ) and then user 4 in the config( where red mentioned )

You only need the one preset in the startup.txt, e.g. vars.gunMasterWeaponsPreset 4

And yes, change the value in the limit code to 4.

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

Originally Posted by moacco07*:

 

You add the following vars to your startup.txt to change the preset:

Code:

vars.gunMasterWeaponsPreset X

Where X is:

0 - Standard
1 - Classic
2 - Pistol
3 - DLC
4 - Troll
As for if it can be randomly changed each round, try the following limit:

NOTE: This is untested and may not work.

 

If you added vars.gunMasterWeaponsPreset to your startup.txt, change the value highlighted in red in the code to the same value as your startup.txt

If you don't want the limit to display the next preset in Procon chat, remove the lines highlighted in green from the code.


BF4 Gunmaster Random Presets

 

Create a new limit to evaluate OnRoundOver. Set action to None.

 

Set first_check to this Code:

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 0;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "Pistol",
                  "DLC",
                  "Troll" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(5);
while (nextPreset == lastPreset)
{
    nextPreset = rnd.Next(5);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;

End of post.

Hi LCARSx64,

 

It work very well. In addition could you make it display at round end (scoreboard) informing players what is the next preset for next round.

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

Originally Posted by NomNom*:

 

Yes, find this line in the code:

Code:

plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
Add this line straight after it:

Code:

plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
If you want to send a yell message as well/instead, add this line:

Code:

plugin.SendGlobalYell("\nThe next Gunmaster preset will be: " + msgs[nextPreset], 8);
Works as advertised thanks!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Hello LCARSx64 Thank you

Can you delete "Pistol" preset from you code?

 

Because 'DLC' preset It falls very rarely, but pistol after each round.

Thank you.

Here you go:

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 1;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "",
                  "DLC" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(4);
if (nextPreset == 2) nextPreset = lastPreset;
while (nextPreset == lastPreset || nextPreset == 2)
{
    nextPreset = rnd.Next(4);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

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

Originally Posted by NomNom*:

 

Here you go:

Code:

// BF4 Gunmaster Random Presets - Limit 1 of 1
// v1.0 - OnRoundOver - first_check
//

int lastPreset = 1;
int nextPreset = 0;
Random rnd = new Random();
String lastKey = "_LASTGM_";
String[] msgs = { "Standard",
                  "Classic",
                  "",
                  "DLC" };

if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
nextPreset = rnd.Next(4);
while (nextPreset == lastPreset || nextPreset == 2)
{
    nextPreset = rnd.Next(4);
}
plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
plugin.SendGlobalMessage("The next Gunmaster preset will be: " + msgs[nextPreset]);
plugin.PRoConChat("Next Gunmaster preset changed to: ^b^1" + msgs[nextPreset] + "^0^n.");
server.Data.setInt(lastKey, nextPreset);

return false;
Now LCARS can you make a plugin that allows people to vote what preset they want for the next map? :biggrin:
* 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.