Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    491

    Killme (Suicide) without AdKats

    NOTE: This limit requires the Insane Limits Timed Messaging System v2.0 (ILTMS) Core, SEE HERE for details.

    This limit allows a player to kill themselves (suicide) using Admin kill and thereby not registering a death on their stats.

    How it works:

    • Each player with a ProCon account is considered an Admin for the purposes of this limit and have unlimited instant suicides per round.
    • Each player on your Insane Limits whitelist (player_white_list) is considered a VIP for the purposes of this limit and have a maximum of 5 instant suicides per round.
    • Each regular player has a maximum of 3 suicides per round, each of which is delayed by 3 seconds before death.


    The available command is:
    Quote Originally Posted by Available Command(s)
    !killme - Kill self using Admin kill.

    Command can be proceeded by: / ! @ /! /@
    Example: /!killme
    NOTE: If you are using PRoCon's default In-Game Admin plugin, you will either need to rename the Kill command or disable that plugin otherwise this command will conflict.


    Killme (Suicide)

    Create a new limit to evaluate OnAnyChat. Set action to None.

    Set first_check to this Expression:
    Code:
    (plugin.IsInGameCommand(player.LastChat) && player.Role == 0)
    Set second_check to this Code:
    Code:
    // Killme (Suicide)
    // v2.0 - OnAnyChat - Limit 1 of 1
    //
    
    // ######### REQUIRES ILTMS V2.0 ######### //
    
    // ********* VARIABLES ******** //
    
    // ----------- Queue ---------- //
    Queue<Dictionary<String, Object>> _Queue = null;
    
    // ---------- Strings --------- //
    String   cmd        = "";
    String[] kmMsgs     = { "You have used all suicides this round!",
                            "\nSuicide in 3 seconds!" };
    
    // ---------- Doubles --------- //
    double   kmCount    = 0;
    
    // --------- Booleans --------- //
    bool     isAdmin    = false;
    bool     isVIP      = false;
    bool     bKill      = false;
    bool     bKick      = false;
    bool     bBan       = false;
    bool     bMove      = false;
    bool     bLevel     = false;
    
    // ***** END OF VARIABLES ***** //
    
    // ********* DELEGATES ******** //
    
    Action<Object> KillMe = delegate(Object plyName)
                            {
                                if (plyName != null)
                                {
                                    String pName = Convert.ToString(plyName);
                                    if (pName != "")
                                    {
                                        plugin.ServerCommand("admin.killPlayer", pName);
                                    }
                                }
                            };
    
    // ***** END OF DELEGATES ***** //
    
    
    
    // *********** CODE ********** //
    
    if (plugin.Data.issetObject("_ILTMS_THREAD_") && plugin.Data.issetObject("_ILTMS_QUEUE_") && plugin.Data.issetBool("_ILTMS_FLAG_"))
    {
        if (plugin.Data.getBool("_ILTMS_FLAG_"))
        {
            _Queue = (Queue<Dictionary<String, Object>>) plugin.Data.getObject("_ILTMS_QUEUE_");
        }
    }
    
    // Set Admin & VIP flags appropriately
    if (plugin.CheckAccount(player.Name, out bKill, out bKick, out bBan, out bMove, out bLevel)) isAdmin = true;
    if (plugin.isInPlayerWhitelist(player.Name)) isVIP = true;
    
    // Extract the command
    cmd = plugin.ExtractInGameCommand(player.LastChat);
    // Remove excessive command prefixes
    if ((cmd.Length != 0) && (plugin.ExtractCommandPrefix(cmd).Length != 0)) cmd = plugin.ExtractInGameCommand(cmd);
    // Make sure the command really exists
    if (null == cmd || cmd.Length == 0) return false;
    // Match on !killme
    if (!Regex.Match(cmd, @"^\bKILLME\b", RegexOptions.IgnoreCase).Success) return false;
    // Get activation count for the round
    kmCount = limit.Activations(player.Name);
    
    // Admins have unlimited instant suicides and don't require a message
    if (isVIP || isAdmin)
    {
        if (isVIP)
        {
            // VIPs have a maximum of 5 instant suicides per-round
            if (kmCount > 5)
            {
                // VIP has used up all their suicides this round
                plugin.SendPlayerMessage(player.Name, kmMsgs[0]);
                return false;
            }
        }
        KillMe(player.Name);
    }
    else
    {
        if (_Queue != null)
        {
            // Standard players have a maximum of 3 delayed suicides per-round
            if (kmCount > 3)
            {
                // Player has used up all their suicides this round
                plugin.SendPlayerMessage(player.Name, kmMsgs[0]);
            }
            else
            {
                // Display the message
                plugin.SendPlayerYell(player.Name, kmMsgs[1], 3);
                // Do the delayed kill
                Dictionary<String, Object> myMsgBlock = null;
                List<Object> myActionDelegate = null;
    
                myActionDelegate = new List<Object>();
                myActionDelegate.Add(KillMe);
                myActionDelegate.Add(player.Name);
    
                myMsgBlock = new Dictionary<String, Object>();
                myMsgBlock.Add("time", 3);
                myMsgBlock.Add("adel", myActionDelegate);
    
                if (plugin.Data.getBool("_ILTMS_FLAG_"))
                {
                    String _sVers = "";
                    double _Vers = 0.0;
                    if (plugin.Data.issetString("_ILTMS_VERSION_")) _sVers = plugin.Data.getString("_ILTMS_VERSION_");
                    if (_sVers != "") _Vers = Convert.ToDouble(_sVers);
                    if (_Vers >= 2.0)
                    {
                        lock (_Queue)
                        {
                            _Queue.Enqueue(myMsgBlock);
                            Monitor.Pulse(_Queue);
                        }
                    }
                }
            }
        }
        else
        {
            // ILTMS is not available
            plugin.SendPlayerMessage(player.Name, "Killme is currently unavailable!");
        }
    }
    
    return false;

    End of post!
    Last edited by LCARSx64; 16-09-2014 at 12:57. Reason: Updated to version 2.0

  2. #2
    Why would the default IGA kill command conflict with this?
    ____

  3. #3
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    491
    Quote Originally Posted by ColColonCleaner View Post
    Why would the default IGA kill command conflict with this?
    It only conflicts when an Admin uses this, the default IGA seems to think you're trying to kill some other player on the server. It's fine if you rename the default IGA's kill command to something else though.

  4. #4
    Not to mention the annoying, "Did you mean PapaCharlieNiner?" and having to type @yes, unless you spelt the name perfectly.
    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. #5
    Quote Originally Posted by LCARSx64 View Post
    It only conflicts when an Admin uses this, the default IGA seems to think you're trying to kill some other player on the server. It's fine if you rename the default IGA's kill command to something else though.
    @killme != @kill

    Why is it confusing the two?
    ____

  6. #6
    Quote Originally Posted by PapaCharlie9 View Post
    Not to mention the annoying, "Did you mean PapaCharlieNiner?" and having to type @yes, unless you spelt the name perfectly.
    I thought phil fixed that...it was supposed to automatically confirm if only one player matches the input.
    ____

  7. #7
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    491
    Quote Originally Posted by PapaCharlie9 View Post
    Not to mention the annoying, "Did you mean PapaCharlieNiner?" and having to type @yes, unless you spelt the name perfectly.
    This is exactly the issue.

    Quote Originally Posted by ColColonCleaner View Post
    @killme != @kill

    Why is it confusing the two?
    I'd assume that the kill command is not doing a whole word match.

  8. #8
    Quote Originally Posted by ColColonCleaner View Post
    I thought phil fixed that...it was supposed to automatically confirm if only one player matches the input.
    Maybe, I dunno, but hopefully it's one match AND a close Levenshtein distance. Any string will always have at least one match, the way Procon uses Levenshtein. And Insane Limits, for that matter.
    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. #9
    Very neat! I've actually been doing this in procon rulz using this
    Code:
    On Say;Text 459; Kill 100
    Can anyone tell me if there is an advantage to using the insane limits one instead of procon rulz?

  10. #10
    Senior Member
    Join Date
    Nov 2013
    Location
    Nsw, Australia
    Posts
    399
    Quote Originally Posted by hustl4 View Post
    Very neat! I've actually been doing this in procon rulz using this
    Code:
    On Say;Text 459; Kill 100
    Can anyone tell me if there is an advantage to using the insane limits one instead of procon rulz?
    No advantage that i am aware of that being said i never used InsaneLimits.. Proconrulz handled all my rules fairly well and the same sort of rule the OP has made here with Insane could be made with Proconrulz fairly easily too ..

 

 

Posting Permissions

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