Raised This Month: $51 Target: $400
 12% 

Detect record/stop commands?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
urus
Senior Member
Join Date: Jan 2007
Old 03-25-2012 , 15:17   Detect record/stop commands?
Reply With Quote #1

Hi.
Is there any way to hook/detect record command while it executed by client.
Or any other possible ways to detect start/stop record on client?
__________________
urus is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 03-26-2012 , 11:33   Re: Detect record/stop commands?
Reply With Quote #2

Have you tryed RegConsoleCmd ?
ecca is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-26-2012 , 11:38   Re: Detect record/stop commands?
Reply With Quote #3

Or AddCommandListener
11530 is offline
Lord Canistra
Senior Member
Join Date: Mar 2009
Location: Tallinn, Estonia
Old 03-26-2012 , 12:06   Re: Detect record/stop commands?
Reply With Quote #4

These are for server-side commands. I doubt they'll be of any use when trying to interact with client.
__________________
Lord Canistra is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 03-26-2012 , 14:23   Re: Detect record/stop commands?
Reply With Quote #5

You might be able to use QueryClientConVar on 'record' and see whether it returns anything.
TheAvengers2 is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 03-26-2012 , 15:26   Re: Detect record/stop commands?
Reply With Quote #6

"record" is a clientside command, not a convar. That means you have no way of hooking it.
believe it or not.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 03-26-2012 , 15:42   Re: Detect record/stop commands?
Reply With Quote #7

Well you can use this:
PHP Code:
public Action:OnClientCommand(clientargs)
{
    static 
String:Buffer[32];   
    
GetCmdArg(0Buffersizeof(Buffer));
    
    if(
StrEqual(Buffer"demorestart"true))
    {
        
PrintToServer("%N has started a demo"client);
    }
        
    return 
Plugin_Continue;

Works for me

Yours sincerely
Impact
__________________

Last edited by Impact123; 03-26-2012 at 15:44.
Impact123 is offline
Lord Canistra
Senior Member
Join Date: Mar 2009
Location: Tallinn, Estonia
Old 03-26-2012 , 15:54   Re: Detect record/stop commands?
Reply With Quote #8

Why demorestart?
Also, one silly mistake (which I've committed myself once) can be made when testing such stuff. Always test your plugins on dedicated server. Initially I had been testing mine on listen server (basically, on my game client installation) and wrote some code which hooked clientside commands like chooseteam. And then, of course, a nasty surprise followed as I put it on a dedicated server, thinking about only polishing up some minor flaws.
__________________
Lord Canistra is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 03-26-2012 , 16:09   Re: Detect record/stop commands?
Reply With Quote #9

Wow, it works. Nice!

Spoiler
TheAvengers2 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 03-26-2012 , 16:55   Re: Detect record/stop commands?
Reply With Quote #10

Quote:
Originally Posted by Lord Canistra View Post
Why demorestart?
Don't know, that command doesn't even exist, but it works
Quote:
Originally Posted by Lord Canistra View Post
Always test your plugins on dedicated server.
What makes you think i'm not testing on a dedicated server?
I use a local install for testing.

Yours sincerely
Impact
__________________

Last edited by Impact123; 03-26-2012 at 17:00.
Impact123 is offline
Reply



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 19:33.


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