Raised This Month: $32 Target: $400
 8% 

[TF2] Hook +inspect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 06-30-2017 , 11:09   [TF2] Hook +inspect
Reply With Quote #1

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?

Last edited by RumbleFrog; 07-01-2017 at 13:28.
RumbleFrog is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 06-30-2017 , 11:16   Re: Hook +inspect
Reply With Quote #2

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
__________________
coding & free software

Last edited by shanapu; 06-30-2017 at 11:17.
shanapu is offline
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 06-30-2017 , 11:20   Re: Hook +inspect
Reply With Quote #3

Quote:
Originally Posted by shanapu View Post
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.
RumbleFrog is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 06-30-2017 , 12:18   Re: [TF2] Hook +inspect
Reply With Quote #4

AddCommandListener(Command_LAW, +inspect");

maybe???
8guawong is offline
sdz
Senior Member
Join Date: Feb 2012
Old 06-30-2017 , 13:03   Re: [TF2] Hook +inspect
Reply With Quote #5

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

Last edited by sdz; 06-30-2017 at 20:13.
sdz is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-30-2017 , 13:33   Re: [TF2] Hook +inspect
Reply With Quote #6

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; }
psychonic is offline
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 06-30-2017 , 15:53   Re: [TF2] Hook +inspect
Reply With Quote #7

Quote:
Originally Posted by psychonic View Post
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 is offline
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 07-01-2017 , 13:28   Re: [TF2] Hook +inspect
Reply With Quote #8

Quote:
Originally Posted by psychonic View Post
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?
RumbleFrog is offline
cigzag
AlliedModders Donor
Join Date: Nov 2014
Location: NZ
Old 07-01-2017 , 18:42   Re: [TF2] Hook +inspect
Reply With Quote #9

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.
cigzag is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 07-02-2017 , 04:58   Re: [TF2] Hook +inspect
Reply With Quote #10

try tf2items to remove the inspection attribute
__________________
Chdata is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:29.


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