AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Hook +inspect (https://forums.alliedmods.net/showthread.php?t=299036)

RumbleFrog 06-30-2017 11:09

[TF2] Hook +inspect
 
Are there ways to block +inspect command? It seems that +inspect is a client side command never sent to the server, so the server can't block it, I tried using AddCommandListener


Any other ways to prevent players from inspecting other's inventory?

shanapu 06-30-2017 11:16

Re: Hook +inspect
 
PHP Code:

    AddCommandListener(Command_LAW"+lookatweapon");    //Hooks cs:go's flashlight replacement 'look at weapon'.
}

public 
Action:Command_LAW(client, const String:command[], argc)
{
    return 
Plugin_Handled;


taken from https://forums.alliedmods.net/showthread.php?t=227224

RumbleFrog 06-30-2017 11:20

Re: Hook +inspect
 
Quote:

Originally Posted by shanapu (Post 2532664)
PHP Code:

    AddCommandListener(Command_LAW"+lookatweapon");    //Hooks cs:go's flashlight replacement 'look at weapon'.
}

public 
Action:Command_LAW(client, const String:command[], argc)
{
    return 
Plugin_Handled;


taken from https://forums.alliedmods.net/showthread.php?t=227224

Sorry, I forgot to mention this is for TF2.

8guawong 06-30-2017 12:18

Re: [TF2] Hook +inspect
 
AddCommandListener(Command_LAW, +inspect");

maybe???

sdz 06-30-2017 13:03

Re: [TF2] Hook +inspect
 
You need to use OnPlayerRunCmdfor hook commands (+/- cmdname)
however, it doesn't look like we have any buttons for inspect so..

psychonic 06-30-2017 13:33

Re: [TF2] Hook +inspect
 
Code:
public Action OnClientCommandKeyValues(int client, KeyValues kv) {     char szBuffer[64];     kv.GetSectionName(szBuffer, sizeof(szBuffer));     if (StrEqual(szBuffer, "+inspect_server", false))         return Plugin_Handled;         return Plugin_Continue; }

RumbleFrog 06-30-2017 15:53

Re: [TF2] Hook +inspect
 
Quote:

Originally Posted by psychonic (Post 2532701)
Code:
public Action OnClientCommandKeyValues(int client, KeyValues kv) {     char szBuffer[64];     kv.GetSectionName(szBuffer, sizeof(szBuffer));     if (StrEqual(szBuffer, "+inspect_server", false))         return Plugin_Handled;         return Plugin_Continue; }

Thanks!

RumbleFrog 07-01-2017 13:28

Re: [TF2] Hook +inspect
 
Quote:

Originally Posted by psychonic (Post 2532701)
Code:
public Action OnClientCommandKeyValues(int client, KeyValues kv) {     char szBuffer[64];     kv.GetSectionName(szBuffer, sizeof(szBuffer));     if (StrEqual(szBuffer, "+inspect_server", false))         return Plugin_Handled;         return Plugin_Continue; }

Bummer, it doesn't block inspect for some reason. Any other ideas?

cigzag 07-01-2017 18:42

Re: [TF2] Hook +inspect
 
I see you're trying to figure it out still, If you want you can add me on Steam and I can try work with you to create some sort of workaround.

Chdata 07-02-2017 04:58

Re: [TF2] Hook +inspect
 
try tf2items to remove the inspection attribute


All times are GMT -4. The time now is 19:50.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.