Raised This Month: $ Target: $400
 0% 

[L4D] Cvars (6/28/09)


Post New Thread Reply   
 
Thread Tools Display Modes
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-31-2009 , 16:00   Re: [L4D] Cvars (6/28/09)
Reply With Quote #11

I don't have the old plugin I used to list the cvars, but there's always an easier way. Just unlock all of the cvars with the following code:
PHP Code:
#if !defined FCVAR_DEVELOPMENTONLY
#define FCVAR_DEVELOPMENTONLY    (1<<1)
#endif

public OnPluginStart()
{
    
decl String:name[64];
    new 
Handle:cvarbool:isCommandflagsHandle:convar;

    
cvar FindFirstConCommand(namesizeof(name), isCommandflags);
    if (
cvar == INVALID_HANDLE)
    {
        
SetFailState("Could not load cvar list");
    }

    do
    {
        if (
isCommand || !(flags FCVAR_DEVELOPMENTONLY) || !StrContains(name"bot"))
        {
            continue;
        }
        
convar FindConVar(name);
        
flags &= ~FCVAR_DEVELOPMENTONLY;
        
flags &= ~FCVAR_CHEAT;
        
SetConVarFlags(convarflags);
    } while (
FindNextConCommand(cvarnamesizeof(name), isCommandflags));

    
CloseHandle(cvar);

and use the command 'cvarlist' to print out all of the cvars.
bl4nk is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 08-01-2009 , 18:10   Re: [L4D] Cvars (6/28/09)
Reply With Quote #12

Quote:
Originally Posted by bl4nk View Post
I don't have the old plugin I used to list the cvars, but there's always an easier way. Just unlock all of the cvars with the following code:
PHP Code:
#if !defined FCVAR_DEVELOPMENTONLY
#define FCVAR_DEVELOPMENTONLY    (1<<1)
#endif

public OnPluginStart()
{
    
decl String:name[64];
    new 
Handle:cvarbool:isCommandflagsHandle:convar;

    
cvar FindFirstConCommand(namesizeof(name), isCommandflags);
    if (
cvar == INVALID_HANDLE)
    {
        
SetFailState("Could not load cvar list");
    }

    do
    {
        if (
isCommand || !(flags FCVAR_DEVELOPMENTONLY) || !StrContains(name"bot"))
        {
            continue;
        }
        
convar FindConVar(name);
        
flags &= ~FCVAR_DEVELOPMENTONLY;
        
flags &= ~FCVAR_CHEAT;
        
SetConVarFlags(convarflags);
    } while (
FindNextConCommand(cvarnamesizeof(name), isCommandflags));

    
CloseHandle(cvar);

and use the command 'cvarlist' to print out all of the cvars.
If I unload metamod (and thus sourcemod) after using this will it relock the commands?
Dragonshadow is offline
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 08-01-2009 , 19:36   Re: [L4D] Cvars (6/28/09)
Reply With Quote #13

Restarting the server would be a way to make sure it locked them again.

Update: Yep, restarting the server locks them. Whew!

Last edited by Thraka; 08-01-2009 at 19:43.
Thraka is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-02-2009 , 14:23   Re: [L4D] Cvars (6/28/09)
Reply With Quote #14

It only unlocks stuff on the server-side, not the client. There's no security issues when using that plugin, it just makes it so you won't have to use sm_cvar to set some convars.
bl4nk is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 08-03-2009 , 17:49   Re: [L4D] Cvars (6/28/09)
Reply With Quote #15

What I mean by relocking them is that I don't want the metamod and sourcemod commands to show up in my cvarlist, but if unloading metamod (and thus sourcemod) relocks them, I'll have to edit out the meta/source mod commands

Last edited by Dragonshadow; 08-03-2009 at 17:54.
Dragonshadow 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 18:23.


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