Jump to content
  • 0

Help about BF4


B7ackhawk

Question

Hello guys first happy new year to all

i  use this code , can some one change it for me ! i need make 6 limited when player kill 6 with explosive he got kick

that mean 5 warning 6kill kick

if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;
if (plugin.RoundData.issetInt(kCounter)) warnings = plugin.RoundData.getInt(kCounter);

if (warnings == 0) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (1/3)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
}

if (limit.Activations(killer.Name, time) > 1) return false;

if (warnings == 1) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (2/3)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 2) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

 

Link to comment
Share on other sites

24 answers to this question

Recommended Posts

On 1/3/2020 at 1:58 PM, Prophet731 said:

if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;

if (limit.Activations(killer.Name, time) > 1) return false;

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

if (warnings >= 0 && warnings <= 4) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
} else if (warnings == 5) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 6) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

Try this one then. I just removed this line of code from both if statements.


plugin.KillPlayer(killer.Name, 1);

 

Hello

if i need make limited 4 kill in 4 kill he got kick what i have to edit ?

Link to comment
Share on other sites

  • Administrators
btw i dont know what you mean via ONEPLUS A5010 using Tapatalk
Just means I'm using the tapatalk app on my phone.

Sent from my ONEPLUS A5010 using Tapatalk

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

  • Administrators

Glad you got it to work.

Sent from my ONEPLUS A5010 using Tapatalk

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

  • Administrators
Unfortunately I have tried more than once
I could not do it 
Why can't you?

Sent from my ONEPLUS A5010 using Tapatalk

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

15 minutes ago, Prophet731 said:

Just change this line of code on both of them to what you want it to say. That's all you need to do.


String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";

 

Unfortunately I have tried more than once
I could not do it 

Link to comment
Share on other sites

  • Administrators
2 minutes ago, B7ackhawk said:

please can someone help me ! need change killed for warning  , in chat says player got killed i need change it for warning 

in the screen it show player die but he not . i need make it in chat say player name your warning for use explosive 



 

image.png

Just change this line of code on both of them to what you want it to say. That's all you need to do.

String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";

 

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

On 1/3/2020 at 12:56 PM, Prophet731 said:

Can you try this and let me know if it works right?


if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;

if (limit.Activations(killer.Name, time) > 1) return false;

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

if (warnings >= 0 && warnings <= 4) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
} else if (warnings == 5) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 6) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

 

please can someone help me ! need change killed for warning  , in chat says player got killed i need change it for warning 

in the screen it show player die but he not . i need make it in chat say player name your warning for use explosive 



image.png

Link to comment
Share on other sites

  • Administrators
1 minute ago, B7ackhawk said:

well . sorry my bad now work only warning but in chat says killed for use explosive and the player still live 

thank you a lot bro 

Just adjust the global message to your liking then you should be fine.

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

Just now, Prophet731 said:

Did you make sure it's not cached with the old version? That code doesn't have any kill events in it so.

well . sorry my bad now work only warning but in chat says killed for use explosive and the player still live 

thank you a lot bro 

Link to comment
Share on other sites

  • Administrators
1 minute ago, B7ackhawk said:

still player die when the killing someone with explosive 

Did you make sure it's not cached with the old version? That code doesn't have any kill events in it so.

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

18 minutes ago, Prophet731 said:

if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;

if (limit.Activations(killer.Name, time) > 1) return false;

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

if (warnings >= 0 && warnings <= 4) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
} else if (warnings == 5) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 6) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

Try this one then. I just removed this line of code from both if statements.


plugin.KillPlayer(killer.Name, 1);

 

still player die when the killing someone with explosive 

Link to comment
Share on other sites

  • Administrators
if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;

if (limit.Activations(killer.Name, time) > 1) return false;

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

if (warnings >= 0 && warnings <= 4) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
} else if (warnings == 5) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 6) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

Try this one then. I just removed this line of code from both if statements.

plugin.KillPlayer(killer.Name, 1);

 

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

  • Administrators
40 minutes ago, B7ackhawk said:

well it work but got killed by admin  . i need warning 5 in the 6 kicked 

image.png

So you don't want it to kill during the warning phase just for the final kill?

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

1 minute ago, Prophet731 said:

Can you try this and let me know if it works right?


if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;

if (limit.Activations(killer.Name, time) > 1) return false;

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

if (warnings >= 0 && warnings < 4) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
} else if (warnings == 5) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 6) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

 

[04:57:59 53] [Insane Limits] Compiling Limit #5 - no rpg - OnKill

 

well let me see if work or not wait me please 

Link to comment
Share on other sites

  • Administrators

Can you try this and let me know if it works right?

if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;

if (limit.Activations(killer.Name, time) > 1) return false;

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

if (warnings >= 0 && warnings <= 4) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
} else if (warnings == 5) {
    String globalMessage = killer.FullName + " killed for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.KillPlayer(killer.Name, 1);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 6) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

 

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
Share on other sites

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.