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

HELP: How To Get Client Variables?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
za_bullet2
Junior Member
Join Date: Jul 2006
Old 11-17-2006 , 06:38   HELP: How To Get Client Variables?
Reply With Quote #1

Hey Guys,

I've been trying to find out how to get client variables from a server plugin.

stuff like cl_updaterate etc etc.

I remember reading in a post in the forum, but can't seem to find it again.

Can someone remind me how its done?

D.
za_bullet2 is offline
Knagg0
SourceMod Donor
Join Date: Dec 2005
Location: Germany
Old 11-17-2006 , 08:18   Re: HELP: How To Get Client Variables?
Reply With Quote #2

const char *pszValue = m_Engine->GetClientConVarValue(index, "cl_updaterate");
Knagg0 is offline
za_bullet2
Junior Member
Join Date: Jul 2006
Old 11-17-2006 , 10:24   Re: HELP: How To Get Client Variables?
Reply With Quote #3

Shot thanks. I had just found the other post and was about to put a response here. I'm trying to detect the new cl_restrict_....command. Doing a straight GetClientConVarValue doesn't work, so managed to do it by trying to set a cl_ variable to something and checking whether it got changed.

Anyone know a better way.

Thanks for the response anyway.

D.
za_bullet2 is offline
Knagg0
SourceMod Donor
Join Date: Dec 2005
Location: Germany
Old 11-17-2006 , 17:35   Re: HELP: How To Get Client Variables?
Reply With Quote #4

When you check cl_restrict_.... with GetClientConVarValue is returns \0
You can fire a dummy_command with helpers and check if it was fired in the cliencommand callback.
Knagg0 is offline
waza123
Junior Member
Join Date: Sep 2006
Old 06-30-2008 , 07:57   Re: HELP: How To Get Client Variables?
Reply With Quote #5

Quote:
Originally Posted by Knagg0 View Post
When you check cl_restrict_.... with GetClientConVarValue is returns \0
You can fire a dummy_command with helpers and check if it was fired in the cliencommand callback.
Can you give an example how to do it ?
waza123 is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 06-30-2008 , 11:20   Re: HELP: How To Get Client Variables?
Reply With Quote #6

Quote:
Originally Posted by waza123 View Post
Can you give an example how to do it ?
There is no need to try and detect cl_restrict_server_commands since Valve has removed that cvar and made it the same as having it turned on. You can safely assume every client is restricting server commands.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke 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 10:52.


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