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

Show PlayerClips


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BlankBhop
Junior Member
Join Date: Oct 2018
Old 10-07-2018 , 15:17   Show PlayerClips
Reply With Quote #1

If anyone can by chance make a plugin where a player can use !clips or !showclips and it'll show clip brushes from the command r_drawClipBrushes 1, and maybe !showsolidclips for r_drawClipBrushes2
BlankBhop is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 10-09-2018 , 08:19   Re: Show PlayerClips
Reply With Quote #2

PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_clips",      Command_Callback);
    
RegConsoleCmd("sm_solidclips"Command_Callback);
}

public 
Action Command_Callback(int clientint args)
{
    if (
IsClientInGame(client))
    {
        
char command[32];
        
GetCmdArg(0commandsizeof(command));
        if (
StrEqual(command"sm_clips"false))
        {
            
FakeClientCommandEx(client"r_drawClipBrushes 1");
        } else {
            
FakeClientCommandEx(client"r_drawClipBrushes 2");
        }
    }

    return 
Plugin_Handled;


Last edited by ThatKidWhoGames; 10-09-2018 at 11:20.
ThatKidWhoGames is offline
Nairdaa
Member
Join Date: Nov 2012
Old 10-09-2018 , 10:35   Re: Show PlayerClips
Reply With Quote #3

Quote:
Originally Posted by ThatKidWhoGames View Post
PHP Code:
#include <sourcemod>

#define r_drawClipBrushes FindConVar("r_drawClipBrushes")

public void OnPluginStart()
{
    
RegConsoleCmd("sm_clips",      Command_Callback);
    
RegConsoleCmd("sm_solidclips"Command_Callback);
}

public 
Action Command_Callback(int clientint args)
{
    if (
IsClientInGame(client))
    {
        
char command[32];
        
GetCmdArg(0commandsizeof(command));
        if (
StrEqual(command"sm_clips"false))
        {
            
r_drawClipBrushes.ReplicateToClient(client"1");
        } else {
            
r_drawClipBrushes.ReplicateToClient(client"2");
        }
    }

    return 
Plugin_Handled;

Quote:
L 10/09/2018 - 16:11:01: [SM] Exception reported: Invalid convar handle 0 (error 4)
L 10/09/2018 - 16:11:01: [SM] Blaming: clips.smx
L 10/09/2018 - 16:11:01: [SM] Call stack trace:
L 10/09/2018 - 16:11:01: [SM] [0] ConVar.ReplicateToClient
L 10/09/2018 - 16:11:01: [SM] [1] Line 19, D:\steamcmd\css\cstrike\addons\sourcemod\scri pting\clips.sp::Command_Callback
L 10/09/2018 - 16:11:25: [SM] Exception reported: Invalid convar handle 0 (error 4)
L 10/09/2018 - 16:11:25: [SM] Blaming: clips.smx
L 10/09/2018 - 16:11:25: [SM] Call stack trace:
L 10/09/2018 - 16:11:25: [SM] [0] ConVar.ReplicateToClient
L 10/09/2018 - 16:11:25: [SM] [1] Line 19, D:\steamcmd\css\cstrike\addons\sourcemod\scri pting\clips.sp::Command_Callback
L 10/09/2018 - 16:12:10: [SM] Exception reported: Invalid convar handle 0 (error 4)
L 10/09/2018 - 16:12:10: [SM] Blaming: clips.smx
L 10/09/2018 - 16:12:10: [SM] Call stack trace:
L 10/09/2018 - 16:12:10: [SM] [0] ConVar.ReplicateToClient
L 10/09/2018 - 16:12:10: [SM] [1] Line 19, D:\steamcmd\css\cstrike\addons\sourcemod\scri pting\clips.sp::Command_Callback
That just won't work.

Last edited by Nairdaa; 10-09-2018 at 10:35.
Nairdaa is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 10-09-2018 , 11:20   Re: Show PlayerClips
Reply With Quote #4

I updated my post. Try it now.
ThatKidWhoGames is offline
Nairdaa
Member
Join Date: Nov 2012
Old 10-10-2018 , 10:30   Re: Show PlayerClips
Reply With Quote #5

Quote:
Originally Posted by ThatKidWhoGames View Post
I updated my post. Try it now.
Unknown command: r_drawClipBrushes


No console error this time. I doubt you can replicate the r_ commands.
Nairdaa is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 10-10-2018 , 10:39   Re: Show PlayerClips
Reply With Quote #6

Quote:
Originally Posted by Nairdaa View Post
Unknown command: r_drawClipBrushes


No console error this time. I doubt you can replicate the r_ commands.
They might be client side, hence why they aren't working. I believe that is the case. Sorry we cannot get it to work
ThatKidWhoGames is offline
Nairdaa
Member
Join Date: Nov 2012
Old 10-10-2018 , 10:43   Re: Show PlayerClips
Reply With Quote #7

Quote:
Originally Posted by ThatKidWhoGames View Post
They might be client side, hence why they aren't working. I believe that is the case. Sorry we cannot get it to work
They are client side, yes. The only way I can think of is parsing the bsp on map launch and storing them in a dict, then output to client with beams if called.

Example of it is on 5.62.119.97:27015 (not my server).

Last edited by Nairdaa; 10-10-2018 at 10:47.
Nairdaa is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 10-10-2018 , 11:55   Re: Show PlayerClips
Reply With Quote #8

r_drawClipBrushes requires sv_cheats
mug1wara is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-11-2018 , 08:19   Re: Show PlayerClips
Reply With Quote #9

If fakeclientcommsnd produces unknown command you use Client command and pray it's not blocked by Valve
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Nairdaa
Member
Join Date: Nov 2012
Old 10-13-2018 , 14:31   Re: Show PlayerClips
Reply With Quote #10

Quote:
Originally Posted by eyal282 View Post
If fakeclientcommsnd produces unknown command you use Client command and pray it's not blocked by Valve
it's not blocked but it requires sv_cheats 1 indeed, as the guy above said.

Anyhow, enabling sv_cheats for even just a tick makes it insecure, hence my previous post.

Last edited by Nairdaa; 10-13-2018 at 14:31.
Nairdaa 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 18:33.


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