Page 2 of 10 FirstFirst 1234 ... LastLast
Results 11 to 20 of 97
  1. #11
    When using

    !Regex.Match(kill.Weapon, @"(U_Taurus44|U_HK45C|U_CZ75|U_FN57|U_Glock18|U_M1 911|U_M9|U_M93R|U_MP412Rex|U_MP443|U_P226|U_QSZ92| Melee|Suicide|SoldierCollision|DamageArea|Death)", RegexOptions.IgnoreCase).Success
    It fails to compile, with error:

    [19:40:26 48] [Insane Limits] ERROR: (CS1002, line: 27, column: 223): ; expected
    Any ideas?

  2. #12
    Ignore that, was putting the Regex.Match as code not expression - derp!

  3. #13
    Tested it a lot tonight and working well, except M98B (sniper) is still permitted, and it definitely isn't in that list - weird as hell!

  4. #14
    Quote Originally Posted by iamrandmhero View Post
    Yes, it is a pistols only server minus the shorty, g18 and 93r. The code is working for all weapons except the 93r.
    Oh, I see why. The code for 93r is U_M93R. But there is also the U_M9. Since U_M9 is a proper substring of U_M93R, they both match.

    Change the Regex.Match line to this:

    Code:
    kill.Weapon == "U_M93R" || !Regex.Match(kill.Weapon, @"(U_Taurus44|U_HK45C|U_CZ75|U_FN57|U_M1911|U_M9|U_MP412Rex|U_MP443|U_P226|U_QSZ92|U_Defib|Melee|Suicide|SoldierCollision|DamageArea|Death)", RegexOptions.IgnoreCase).Success
    Last edited by PapaCharlie9; 28-11-2013 at 16:38.
    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.

  5. #15
    Quote Originally Posted by t0p8uzz View Post
    Tested it a lot tonight and working well, except M98B (sniper) is still permitted, and it definitely isn't in that list - weird as hell!
    Same problem, U_M98B is a substring of U_M9. Make a similar change:

    Code:
    kill.Weapon == "U_M98B" || !Regex.Match(kill.Weapon, @"(U_Taurus44|U_HK45C|U_CZ75|U_FN57|U_M1911|U_M9|U_MP412Rex|U_MP443|U_P226|U_QSZ92|U_Defib|Melee|Suicide|SoldierCollision|DamageArea|Death)", RegexOptions.IgnoreCase).Success
    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.

  6. #16
    Yeah thought it was to do with U_M9xxx but didn't know how to separate it. Will test in 10 mins

  7. #17
    Senior Member
    Join Date
    Nov 2013
    Location
    Green Spring, WV
    Posts
    109
    This is what I have so far
    Code:
    !Regex.Match(kill.Weapon, @"(DamageArea|Death|Melee|SoldierCollision|Suicide|Defib|Medkit|PortableMedicpack|Repairtool|Taurus44|HK45C|CZ75|FN57|Glock18|M1911|M9|M93R|MP412Rex|MP443|P226|QSZ92|M320_SMK|M320SMK|XM25_Smoke|Handflare)", RegexOptions.IgnoreCase).Success
    What I am doing is allowing these items however some weapons are still able to be used for some weird reason, Like the 338-Recon for instance. How would I add code to this that wont give me an error to not allow this item? I tried adding Kill.Weapon == "338-Recon" || as well as Kill.Weapon == "SRS" however it keeps my code from running and throws an error at me. I have a few other mods installed but didn't get this error until I changed my gun code.

    Code:
    [05:19:41 98] [Statslogger]Error: getUpdateServerID1: System.NullReferenceException: Object reference not set to an instance of an object.
       at PRoConEvents.CChatGUIDStatsLogger.getUpdateServerID(CServerInfo csiServerInfo)
    Last edited by lordicon; 26-11-2013 at 09:30.

  8. #18
    Quote Originally Posted by lordicon View Post
    This is what I have so far
    Code:
    !Regex.Match(kill.Weapon, @"(DamageArea|Death|Melee|SoldierCollision|Suicide|Defib|Medkit|PortableMedicpack|Repairtool|Taurus44|HK45C|CZ75|FN57|Glock18|M1911|M9|M93R|MP412Rex|MP443|P226|QSZ92|M320_SMK|M320SMK|XM25_Smoke|Handflare)", RegexOptions.IgnoreCase).Success
    What I am doing is allowing these items however some weapons are still able to be used for some weird reason, Like the 338-Recon for instance. How would I add code to this that wont give me an error to not allow this item? I tried adding Kill.Weapon == "338-Recon" || as well as Kill.Weapon == "SRS" however it keeps my code from running and throws an error at me. I have a few other mods installed but didn't get this error until I changed my gun code.

    Code:
    [05:19:41 98] [Statslogger]Error: getUpdateServerID1: System.NullReferenceException: Object reference not set to an instance of an object.
       at PRoConEvents.CChatGUIDStatsLogger.getUpdateServerID(CServerInfo csiServerInfo)
    You need the exact spelling of those codes. Look in your procon/Configs/BF4.defs file to get the exact codes. They should start with "U_".
    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.

  9. #19
    Senior Member
    Join Date
    Nov 2013
    Location
    Green Spring, WV
    Posts
    109
    Quote Originally Posted by PapaCharlie9 View Post
    You need the exact spelling of those codes. Look in your procon/Configs/BF4.defs file to get the exact codes. They should start with "U_".
    Can I do it like this? adding kill.Weapon == "U_SRS" || kill.Weapon == "U_M98B" || exactly as it shows below to the front separating each weapon with ||??

    Code:
    kill.Weapon == "U_SRS" || kill.Weapon == "U_M98B" || !Regex.Match(kill.Weapon, @"(DamageArea|Death|Melee|SoldierCollision|Suicide|Defib|Medkit|PortableMedicpack|Repairtool|Taurus44|HK45C|CZ75|FN57|Glock18|M1911|M9|M93R|MP412Rex|MP443|P226|QSZ92|Handflare)", RegexOptions.IgnoreCase).Success

  10. #20
    Quote Originally Posted by lordicon View Post
    Can I do it like this? adding kill.Weapon == "U_SRS" || kill.Weapon == "U_M98B" || exactly as it shows below to the front separating each weapon with ||??

    Code:
    kill.Weapon == "U_SRS" || kill.Weapon == "U_M98B" || !Regex.Match(kill.Weapon, @"(DamageArea|Death|Melee|SoldierCollision|Suicide|Defib|Medkit|PortableMedicpack|Repairtool|Taurus44|HK45C|CZ75|FN57|Glock18|M1911|M9|M93R|MP412Rex|MP443|P226|QSZ92|Handflare)", RegexOptions.IgnoreCase).Success
    EDIT: Yes, that looks good. Confused me because the Regex didn't have U_, but that's fine.

    Why do you need U_SRS, though? That should be handled by the Regex.Match already, that is, it will not be allowed.
    Last edited by PapaCharlie9; 26-11-2013 at 18:51.
    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.

 

 

Posting Permissions

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