Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30
  1. #21
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    496
    Quote Originally Posted by AlcaGamerZ View Post
    if so we need a cooldown . i dont want it to be restricted for VIP player and NORMAL players , the cooldown should be apply for both of them except admins . my server is not that alot of admin tho . Is it possible to do ? just cooldown for both rank normal player and vip . i mean , both will have same permission and same cooldown time . if so please do share it to me . i tried the above setting which have different values for vip and players but it seems like only Admin can use !killme , but the vip can't .
    The following will allow only the Admins to have unlimited untimed !killme, all other players (including VIP) will have a limit of 3 !killme per round, each with a 3 second delay.

    Change the second_check Code to (this will require the ILTMS core):
    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     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;
    
    // 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 (isAdmin)
    {
        KillMe(player.Name);
    }
    else
    {
        if (_Queue != null)
        {
            // Standard & VIP 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;

  2. #22
    If I want to suicide command, Change the following text how to modify:

    !k

  3. #23
    Quote Originally Posted by HATANO_KENJI View Post
    If I want to suicide command, Change the following text how to modify:

    !k
    No, making it that short leaves it open to abuse since admin kills don't count as deaths.
    ____

  4. #24
    This is my code, from: ProconRulz - 44j.1
    Code:
    On Say;Text !k;Exec admin.killPlayer %p%
    I mean, standard players can only use 3 times, I think there should be no abuse of the problem.

    Anyway, I want to shorten the keyword.

    Can you tell me how to modify?

    !km Can also be!

    Thank you!

  5. #25
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    496
    Quote Originally Posted by HATANO_KENJI View Post
    This is my code, from: ProconRulz - 44j.1
    Code:
    On Say;Text !k;Exec admin.killPlayer %p%
    I mean, standard players can only use 3 times, I think there should be no abuse of the problem.

    Anyway, I want to shorten the keyword.

    Can you tell me how to modify?

    !km Can also be!

    Thank you!
    Find this line in the code:
    Code:
    if (!Regex.Match(cmd, @"^\bKILLME\b", RegexOptions.IgnoreCase).Success) return false;
    Change it to the following for !km:
    Code:
    if (!Regex.Match(cmd, @"^\bKM\b", RegexOptions.IgnoreCase).Success) return false;
    Or to this for !k:
    Code:
    if (!Regex.Match(cmd, @"^\bK\b", RegexOptions.IgnoreCase).Success) return false;
    But as ColColonCleaner said, making the command that short leaves it open to abuse.

  6. #26
    Quote Originally Posted by LCARSx64 View Post
    But as ColColonCleaner said, making the command that short leaves it open to abuse.
    The gravity of exposing this command is not small. Especially for admins who will abuse it without others' knowledge. The entire reason I put a mandatory 10 minute timeout on the command in AdKats was we found a player who issued it 1700 times in the span of a couple weeks. This can become even more of an issue with admins who don't take power well.
    ____

  7. #27
    Thank you for your help!

    I have changed, The admin is working properly, But the standard players can not use.

    Show message:
    Killme is currently unavailable!

    I need to be able to use standard players 3 times, VIP players can use 50 times, If so how to change this?

    PS.The code in this post need to change?

    https://forum.myrcon.com/showthread....l=1#post107997 (Insane Limits Timed Messaging System - Core v2.0 - OnJoin)

    Because I am currently only for the following code to change:
    Insane Limits Timed Messaging System - Example #1
    Insane Limits Timed Messaging System - Example #2

    Thank you for your patience!
    Last edited by HATANO_KENJI; 02-08-2017 at 13:55.

  8. #28
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    496
    Quote Originally Posted by HATANO_KENJI View Post
    Thank you for your help!

    I have changed, The admin is working properly, But the standard players can not use.

    Show message:
    Killme is currently unavailable!

    I need to be able to use standard players 3 times, VIP players can use 50 times, If so how to change this?

    PS.The code in this post need to change?

    https://forum.myrcon.com/showthread....l=1#post107997 (Insane Limits Timed Messaging System - Core v2.0 - OnJoin)

    Because I am currently only for the following code to change:
    Insane Limits Timed Messaging System - Example #1
    Insane Limits Timed Messaging System - Example #2

    Thank you for your patience!
    To make the changes you want, find:
    Code:
    if (kmCount > 5)
    Change to:
    Code:
    if (kmCount > 50)
    Everything else should be fine, standard players shouldn't have an issue.
    For the other post (ILTMS), you do not need to change the code, just make sure you only use the ILTMS Core core in the first post of that thread.

  9. #29
    My VIP still can only use 3 times suicide.

    This is my code, Can you help me confirm?

    Thank you very much for your help!

    // 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!(將在3秒鐘後自殺!)" };

    // ---------- Doubles --------- //
    double kmCount = 0;

    // --------- Booleans --------- //
    bool isAdmin = false;
    bool isVIP = true;
    bool bKill = false;
    bool bKick = false;
    bool bBan = false;
    bool bMove = false;
    bool bLevel = false;

    // ***** END OF VARIABLES ***** //

    // ********* DELEGATES ******** //

    Action<Object> KM = 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, @"^\bK\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 > 50)
    {
    // VIP has used up all their suicides this round
    plugin.SendPlayerMessage(player.Name, kmMsgs[0]);
    return false;
    }
    }
    KM(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(KM);
    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;

  10. #30
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    496
    Quote Originally Posted by HATANO_KENJI View Post
    My VIP still can only use 3 times suicide.

    This is my code, Can you help me confirm?

    Thank you very much for your help!
    VIP player names must be in the Insane Limits player_white_list.
    If you want to use the server reserved slots list instead then let me know because the code needs to be changed for that.

    Also, you do not need to change:
    Code:
    bool     isVIP      = false;
    This is a flag that is detected by the limit's code and automatically set appropriately.

 

 

Posting Permissions

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