Raised This Month: $ Target: $400
 0% 

How to block cvars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Speed!
BANNED
Join Date: Jan 2009
Old 02-01-2009 , 11:23   How to block cvars
Reply With Quote #1

should register_concmd("amx_cvar sv_gravity.......
RETURN_PLUGINHANDLED
work?
or there is a better way?
Speed! is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-01-2009 , 11:36   Re: How to block cvars
Reply With Quote #2

To block a command? explain abit more
__________________
Dr.G is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 02-01-2009 , 11:44   Re: How to block cvars
Reply With Quote #3

You're going to use a concmd to block a cvar?

no, that won't work. lol
BOYSplayCS is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-01-2009 , 12:02   Re: How to block cvars
Reply With Quote #4

Speed If u wanna delete a command like that, just delete it or comment it so its ignored. However u might wanna delete the function the command is calling.... Attach your script if u can get it to work.... http://www.amxmodx.org/funcwiki.php?...ncmd&go=search
__________________
Dr.G is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 02-01-2009 , 13:17   Re: How to block cvars
Reply With Quote #5

Quote:
Originally Posted by Dr.G View Post
Speed If u wanna delete a command like that, just delete it or comment it so its ignored. However u might wanna delete the function the command is calling.... Attach your script if u can get it to work.... http://www.amxmodx.org/funcwiki.php?...ncmd&go=search
He's wanting block a cvar, not delete a command.
Quote:
Originally Posted by Speed! View Post
should register_concmd("amx_cvar sv_gravity.......
RETURN_PLUGINHANDLED
work?
or there is a better way?
Do you want a method that could block admins changing some cvars, so the cvar value would be default and it couldn't be changed?

Last edited by SnoW; 02-01-2009 at 14:38.
SnoW is offline
Send a message via MSN to SnoW
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-01-2009 , 13:45   Re: How to block cvars
Reply With Quote #6

Just make a plugin that does:
Code:
public plugin_init() {     register_concmd("amx_cvar", "CmdCvar", ADMIN_CVAR); } public CmdCvar(client, level, cid) {     if( !cmd_access(client, level, cid, 2) ) return PLUGIN_HANDLED_MAIN;         new cvar[32];     read_argv(1, cvar, sizeof(cvar) - 1);         if( equali(cvar, "your_blocked_cvar") )     {         // cvar is blocked         return PLUGIN_HANDLED;     }         return PLUGIN_HANDLED_MAIN; }

And place it at the top of the plugins.ini
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
s0s0
Junior Member
Join Date: Oct 2012
Location: VEN
Old 02-23-2013 , 23:51   Re: How to block cvars
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
Just make a plugin that does:
Code:
public plugin_init() {     register_concmd("amx_cvar", "CmdCvar", ADMIN_CVAR); } public CmdCvar(client, level, cid) {     if( !cmd_access(client, level, cid, 2) ) return PLUGIN_HANDLED_MAIN;         new cvar[32];     read_argv(1, cvar, sizeof(cvar) - 1);         if( equali(cvar, "your_blocked_cvar") )     {         // cvar is blocked         return PLUGIN_HANDLED;     }         return PLUGIN_HANDLED_MAIN; }

And place it at the top of the plugins.ini
Over 1 cvar, no change allowed. The code would be correct?

PHP Code:
public plugin_init()
{
    
register_concmd("amx_cvar""CmdCvar"ADMIN_CVAR);
}

public 
CmdCvar(clientlevelcid)
{
    if( !
cmd_access(clientlevelcid2) ) return PLUGIN_HANDLED_MAIN;
    
    new 
cvar[32];
    
read_argv(1cvarsizeof(cvar) - 1);
    
    if( 
equali(cvar"sv_password","mp_friendlyfire","sv_restart","sv_voiceenable","sv_gravity") )
    {
        
// cvar is blocked
        
return PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_HANDLED_MAIN;

__________________
s0s0 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-24-2013 , 00:16   Re: How to block cvars
Reply With Quote #8

No. You need to see how equali is used correctly. It can only compare two strings to each other. So, you have to do it for every one and join them with logical OR.
__________________

Last edited by fysiks; 02-24-2013 at 00:17.
fysiks is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 02-01-2009 , 13:51   Re: How to block cvars
Reply With Quote #9

That is so retarded, you can block a cvar using a concmd.
BOYSplayCS is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-01-2009 , 15:15   Re: How to block cvars
Reply With Quote #10

That's not what I'm doing.
I'm detecting the amx_cvar command, and blocking the cvar value for that cvar being changed.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 01:52.


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