Results 1 to 2 of 2
  1. #1

    Problem with Insane Limits Code

    Ok so I found the below code within a closed post. I have added it to my server but when someone says a bad word that is listed nothing happens. My question is does anyone know if it does work? If not anyone know whats wrong with it?

    ---------------------------

    Auto-Insult Responder
    Players like to vent, so I thought it would be funny if the server vented back:-


    Set limit to evaluate OnAnyChat, set action to None.

    Set first_check to this Code:
    Code:
    List<String> bad_words = new List<String>();
    bad_words.Add(@".*n+[ -/:[email protected][-`{-~]*[3e]+[ -/:[email protected][-`{-~]*w+[ -/:[email protected][-`{-~]*[bp].*");
    bad_words.Add(@".*b+[ -/:[email protected][-`{-~]*[o0]{2,}[ -/:[email protected][-`{-~]*n.*");
    bad_words.Add(@".*n+[ -/:[email protected][-`{-~]*[4aiu*]+[ -/:[email protected][-`{-~]*b.*");
    bad_words.Add(@".*n+[ -/:[email protected][-`{-~]*[o0]+[ -/:[email protected][-`{-~]*[bp]{2,}.*");
    bad_words.Add(@".*n+[ -/:[email protected][-`{-~]*[o0u]+[ -/:[email protected][-`{-~]*[o0u]+[ -/:[email protected][-`{-~]*[bp].*");
    bad_words.Add("twat");
    bad_words.Add("prick");
    bad_words.Add("noob");

    foreach(String bad_word in bad_words)
    if (Regex.Match(player.LastChat, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)
    return true;

    return false;
    Note: Member supermillhouse wrote the above code, I just modified it.

    Set second_check to this Code:
    Code:
    /* Version: V0.8/R1-Random */
    List<String> shame = new List<String>();
    shame.Add("%p_n% you are muppet!");
    shame.Add("%p_n% you are 'special'!");
    shame.Add("%p_n% that was a pathetic insult, not going to even bother!");
    shame.Add("%p_n% not much of an insult eh?!");
    shame.Add("%p_n% such a large vocalbury - we are all impressed(!)");
    // Add additional messages here with shame.Add("...");

    //Randomize
    Random rand = new Random();
    int next = rand.Next(shame.Count); // Choose random index bounded by list count

    String msg = plugin.R(shame[next]);

    //Send message
    plugin.SendGlobalMessage(msg);

    return false;
    Note: Member PapaCharlie9 wrote the above code, I just modified it.

  2. #2
    Hi, I have fixed this. This post can be closed.

 

 

Posting Permissions

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