Results 1 to 9 of 9
  1. #1

    Insane Limits: Punish C4, Claymore, M320, RPG, USAS - Domination

    Version 0.8/R1: Not compiled or tested, but copied from other examples and slightly modified, so should be okay.

    This code is only for BF4

    You will need plugin Insane Limits:
    https://forum.myrcon.com/showthread....ghlight=insane

    Set the limit to evaluate OnKill and set the Action to None.

    Set first_check to this Expression.

    Code:
    (Regex.Match(server.Gamemode, @"(?:Domination)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(C4|NLAW|RPG7|SMAW|SRAW|M320|XM25|Claymore|U_M34)", RegexOptions.IgnoreCase).Success)
    Set second_check to this Code:

    Code:
    /* Version: V0.8/R1 */
    String kCounter = killer.Name + "_TreatAsOne_Count";
    TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1
    
    int warnings = 0;
    if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);
        
    /*
    The first time through, warnings is zero. Whether this is an isolated
    activation or the first of a sequence of activations in a short period
    of time, do something on this first time through.
    */
    String msg = "none";
    if (warnings == 0) {
            msg = plugin.R("Attention %k_n%! Do not use %w_n%!"); // First warning message
            plugin.SendGlobalMessage(msg);
            plugin.PRoConChat("ADMIN > " + msg);
            server.Data.setInt(kCounter, warnings+1);
            return false;
    }
    
    /*
    The second and subsequent times through, check to make sure we are not
    getting multiple activations in a short period of time. Ignore if
    less than the time span required.
    */
    
    if (limit.Activations(killer.Name, time) > 1) return false;
    
    /*
    We get here only if there was exactly one activation in the time span
    */
    
    if (warnings == 1) {
            msg = plugin.R("FINAL WARNING %k_n%! Do not use %w_n%!"); // Second warning message
            plugin.SendGlobalMessage(msg);
            plugin.PRoConChat("ADMIN > " + msg);
    } else if (warnings >= 2) {
            msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
            plugin.SendGlobalMessage(msg);
            plugin.PRoConChat("ADMIN > " + msg);
            plugin.PRoConEvent(msg, "Insane Limits");
            plugin.KickPlayerWithMessage(killer.Name, msg);
    }
    server.Data.setInt(kCounter, warnings+1);
    return false;
    * Used as the basis PapaCharlie9 code which you can check here.
    Last edited by clanbfb; 14-06-2015 at 15:15.

  2. #2
    Nice job! I'd suggest putting BF4 in the title also, or else people might try it with BF3.
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  3. #3
    Thank you!

  4. #4
    Not compiled or tested, but copied from other examples and slightly modified, so should be okay.

    Use these settings only to BF4.

    You need Insane Limits plugin:
    https://forum.myrcon.com/showthread....=insane+limits

    Credits to PapaCharlie9 you access the plugin here.

    START HERE

    This plugin punishes those who use explosives (C4 and Claymore), RPG, MBT LAW, M320, XM25 and M32 in Domination game mode.

    Set the limit to evaluate OnKill and set the Action to None.

    Set first_check to this Expression:

    Code:
    (Regex.Match(server.Gamemode, @"(?:Domination)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(C4|NLAW|RPG7|SMAW|SRAW|M320|XM25|Claymore|U_M34|U_MGL)", RegexOptions.IgnoreCase).Success)
    Set second_check to this Code:

    Code:
    /* Version: V0.8/R1 */
    String kCounter = killer.Name + "_TreatAsOne_Count";
    TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1
    
    int warnings = 0;
    if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);
        
    /*
    The first time through, warnings is zero. Whether this is an isolated
    activation or the first of a sequence of activations in a short period
    of time, do something on this first time through.
    */
    String msg = "none";
    if (warnings == 0) {
            msg = plugin.R("Attention %k_n%! Do not use %w_n%!"); // First warning message
            plugin.SendGlobalMessage(msg);
            plugin.PRoConChat("ADMIN > " + msg);
            server.Data.setInt(kCounter, warnings+1);
            return false;
    }
    
    /*
    The second and subsequent times through, check to make sure we are not
    getting multiple activations in a short period of time. Ignore if
    less than the time span required.
    */
    
    if (limit.Activations(killer.Name, time) > 1) return false;
    
    /*
    We get here only if there was exactly one activation in the time span
    */
    
    if (warnings == 1) {
            msg = plugin.R("FINAL WARNING %k_n%! Do not use %w_n%!"); // Second warning message
            plugin.SendGlobalMessage(msg);
            plugin.PRoConChat("ADMIN > " + msg);
    } else if (warnings >= 2) {
            msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
            plugin.SendGlobalMessage(msg);
            plugin.PRoConChat("ADMIN > " + msg);
            plugin.PRoConEvent(msg, "Insane Limits");
            plugin.KickPlayerWithMessage(killer.Name, msg);
    }
    server.Data.setInt(kCounter, warnings+1);
    return false;
    Last edited by clanbfb; 18-06-2015 at 15:55. Reason: Correction description of the plugin

  5. #5
    Junior Member
    Join Date
    Jul 2016
    Location
    Malaysia (Corrupted country but i manage to live)
    Posts
    29
    hi , i want to remove from my player using MBT LAW in all gamemode and maps how should i config it ? sorry maybe i've got wrong section hehe

  6. #6
    Senior Member
    Join Date
    Oct 2015
    Location
    Germany
    Posts
    276
    Quote Originally Posted by AlcaGamerZ View Post
    hi , i want to remove from my player using MBT LAW in all gamemode and maps how should i config it ? sorry maybe i've got wrong section hehe
    to forbid the weapons NLAW, RPG7, SMAW and SRAW for all maps and all gamemodes set the first_check to this expression:
    Code:
    ((Regex.Match(server.Gamemode, @"(?:Domination)", RegexOptions.IgnoreCase).Success && Regex.Match(kill.Weapon, @"(C4|NLAW|RPG7|SMAW|SRAW|M320|XM25|Claymore|U_M34|U_MGL)", RegexOptions.IgnoreCase).Success) || (Regex.Match(kill.Weapon, @"(NLAW|RPG7|SMAW|SRAW)", RegexOptions.IgnoreCase).Success))

  7. #7
    Junior Member
    Join Date
    Jul 2016
    Location
    Malaysia (Corrupted country but i manage to live)
    Posts
    29
    it looks like doesn't work . even the original one i dont know what went wrong however i overcome this problem using ProconRulz plugin . may i ask anyway ? is there a way disabling from letting player lock ons us ? well originally i would like to play Air supperiority without anyone playing lock ons is there a way doing so? if so please do share does config . thnks in advance

  8. #8
    use this for first_check:

    Code:
    (Regex.Match(kill.Weapon, @"(NLAW|RPG7|SMAW|SRAW)", RegexOptions.IgnoreCase).Success)

  9. #9
    Procon Addict
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    502
    Quote Originally Posted by AlcaGamerZ View Post
    hi , i want to remove from my player using MBT LAW in all gamemode and maps how should i config it ? sorry maybe i've got wrong section hehe
    To forbid only the MBT LAW for all gamemodes and maps, change the first_check Expression to:
    Code:
    (kill.Weapon == "U_NLAW")

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •