Raised This Month: $ Target: $400
 0% 

FindConVar and sv_pure


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Carolus
Member
Join Date: Jun 2010
Old 06-27-2010 , 17:24   FindConVar and sv_pure
Reply With Quote #1

Hi,

Am I doing something just plain stupid or ...?

PHP Code:
new Handle:hndlPure FindConVar("sv_pure");        
PrintToConsole(client"    - sv_pure %d",GetConVarInt(hndlPure)); 
Crashes the plugin...

When I type
PHP Code:
sm_cvar sv_pure 
It says
PHP Code:
[SMUnable to find cvarsv_pure 
Please help?
Carolus is offline
Kevin_b_er
SourceMod Donor
Join Date: Feb 2009
Old 06-27-2010 , 18:23   Re: FindConVar and sv_pure
Reply With Quote #2

It's not a cvar, it's a command. When typed, it tells you a phantom "value".

I know it looks like a cvar, but it's not.
__________________
Kevin_b_er is offline
Carolus
Member
Join Date: Jun 2010
Old 06-28-2010 , 17:01   Re: FindConVar and sv_pure
Reply With Quote #3

Thanks for pointing that out!
I'm pretty sure you can guess my next question :

How can one retrieve this phantom value?

I have looked at the API and at the tutorials, but I'm still not sure...

I can find explainations on how to create commands and reply to them,
but not on how to capture their reply?
__________________

Last edited by Carolus; 06-28-2010 at 17:19.
Carolus is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 06-28-2010 , 17:07   Re: FindConVar and sv_pure
Reply With Quote #4

I tried to get sv_pure by many ways a while ago and failed. You can't get cmd reply so the only thing that can point us to which value sv_pure has is an extension. =(
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Carolus
Member
Join Date: Jun 2010
Old 06-28-2010 , 17:21   Re: FindConVar and sv_pure
Reply With Quote #5

Im still pretty new to all of this, but I have managed to get some properties as in
PHP Code:
FindSendPropOffs("CBasePlayer","m_vecVelocity[0]"); 
Is there none of these that may tell us the sv_pure value or allow us
to deduce it?

Thanks for the help!
__________________
Carolus is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 06-28-2010 , 17:34   Re: FindConVar and sv_pure
Reply With Quote #6

I've searched all net/data props and found nothing useful.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
HL-SDK
Member
Join Date: Jan 2009
Old 06-28-2010 , 22:30   Re: FindConVar and sv_pure
Reply With Quote #7

It may be useful to know your intentions. (if it is for admins to change sv_pure)

Anyone can query the value easily enough. If you would like the admins to change it, create convars that they can change - hook the cvar change and just process a server command with whatever argument they give you.

sv_pure is not clientside, nor will it be a netprop (to the best of my knowledge)
HL-SDK is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 06-29-2010 , 01:19   Re: FindConVar and sv_pure
Reply With Quote #8

Quote:
Originally Posted by HL-SDK View Post
Anyone can query the value easily enough. If you would like the admins to change it, create convars that they can change - hook the cvar change and just process a server command with whatever argument they give you.
this is sorta how i did a few things like god mode toggle.. that command is the same as sv_pure.
what i did was just create a bool and toggle it every time the command was issued.. could also accept args of 0/1 on/off. the thing about the bool is it has no way of knowing if the command is changed by any other means then your plugin.
dirka_dirka is offline
Carolus
Member
Join Date: Jun 2010
Old 06-29-2010 , 07:23   Re: FindConVar and sv_pure
Reply With Quote #9

Well my intention is to have my plugin work in different modes, depending on the current sv_pure value.

Changing it should indeed be rather easy..but its not what I'm trying to do

What about this :
PHP Code:
CommandListener

Callback 
for command listenersThis is invoked whenever any command reaches the serverfrom the server console itself or a player 
Default value for sv_pure is 0.
Can't I "save" all changes that are made to it using the CommandListener?

When the server first boots, use the default 0 value,
whenever someone/something tries to change it, the CommandListener should be called, right?

If I can keep track of any and all changes to the sv_pure using the CommandListener, I should be able to "know" what sv_pure value is currently set?
__________________
Carolus 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 07:32.


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