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.




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