Results 1 to 10 of 27

Thread: [UPDATE|ZE] entWatch 3.0.3 (edited)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. Default

    Whoops, sorry. What happened was I made the rar and then realized I forgot to put in a line of code and remade the rar and then blanked on putting it in. -.-

    Here it is.

    Places to note are the code on lines (The lines that deal with SDKhook)

    235-257

    262-303

    835-858

    863-888

    893-901

    975-998

    It works on my test server fine. The only problem that has plagued this is the SDKHook_Touch which causes lag. I think that if the SDKHook is only registered to people who are banned, then we should be fine? Or maybe the lines 262-303 could be reworked?
    Attached Files

  2. Default

    The function is also in efficient in that the order of operations for example is not optimized which is critical for a function that runs constantly.

    Code:
    if (G_bConfigLoaded && !G_bRoundTransition && IsValidEdict(trigger))
        {
            for (new index = 0; index < entArraySize; index++)
            {
                if (entArray[index][ent_hammerid] == Entity_GetHammerID(trigger))
                {
                    if (entArray[index][ent_trigger] == 1)
                    {
                        if (G_bRestricted[client] || G_bTemp[client])
                        {
                            if (entArray[index][ent_torient] == 0)
                            {
                                CPrintToChat(client, "\x07%s[entWatch] \x07%s%t", color_tag, color_warning, "status restricted");
                                TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, straight);
                                return Plugin_Handled;
                            }
                            else if (entArray[index][ent_torient] == 1)
                            {
                                CPrintToChat(client, "\x07%s[entWatch] \x07%s%t", color_tag, color_warning, "status restricted");
                                TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, left);
                                return Plugin_Handled;
                            }
                            else if (entArray[index][ent_torient] == 2)
                            {
                                CPrintToChat(client, "\x07%s[entWatch] \x07%s%t", color_tag, color_warning, "status restricted");
                                TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, right);
                                return Plugin_Handled;
                            }
                            else if (entArray[index][ent_torient] == 3)
                            {
                                CPrintToChat(client, "\x07%s[entWatch] \x07%s%t", color_tag, color_warning, "status restricted");
                                TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, back);
                                return Plugin_Handled;
                            }
                        }
                    }
                }
            }
        }
    Note that in this code we are waiting to check if the client is even supposed to be restricted at the very end within a loop! Also any check that can be done outside of a loop needs to for performance.



  3. Default

    I think that the use of that entire function could be removed. There is weapon plugins that prevent people from ever picking up an awp for example that work without using such an expensive hook. See: https://forums.alliedmods.net/showthread.php?p=950174

    Also there is a few other ways to go about modifying the existing plugin that do not require additional hooks to in effect achieve the same results.

    For example you can make it so that items are auto transferred when picked up by a blocked user. The transfer command already exists so why not have it just auto send it to any non zombie admin who does not currently have an item and if no admins are free it sends to a random player. This way it just hands the item off to someone who can use it.

    Sometimes the easier solution is to approach the problem from a different direction that takes less expensive code to resolve.



Posting Permissions

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