AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking Cvars (https://forums.alliedmods.net/showthread.php?t=99509)

matiaslp 08-06-2009 08:45

Blocking Cvars
 
Hi

I've found this piece of code, but is seems to be useless.

PHP Code:

#include <amxmodx> 
#include <amxmisc>

#define PLUGIN "Block Cvars"
#define VERSION "0.1"
#define AUTHOR "Zinner"

public plugin_init() {     
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_concmd("amx_cvar""CmdCvar"ADMIN_CVAR); 


public 
CmdCvar(clientlevelcid) {     
    if( !
cmd_access(clientlevelcid2) ) return PLUGIN_HANDLED_MAIN;         

    new 
cvar[32];
    new 
arg[32];
    
read_argv(1cvarsizeof(cvar) - 1);         

    if ( (
equali(cvar"mp_kickpercent")) || (equali(cvar"hostname")) ) {               
        
console_print(cid,"%s You cant change this cvar.",arg);
        return 
PLUGIN_HANDLED;     
    }         

    return 
PLUGIN_HANDLED_MAIN


Does anybody know where it's the problem?

i was told to put this plugin at the top of plugins.ini

Thanks in advance

Alucard^ 08-06-2009 12:00

Re: Blocking Cvars
 
i am not sure but maybe...

PHP Code:

new g_CvarHostname

//[...]

g_CvarHostname get_cvar_pointer("hostname")

//[...]

return PLUGIN_HANDLED 

Maybe this help or maybe i am wrong.

IneedHelp 08-06-2009 12:48

Re: Blocking Cvars
 
Check if you have the plugin before the admincmd plugin on plugins.ini

matiaslp 08-08-2009 12:43

Re: Blocking Cvars
 
hi!, yes i've got the plugin before any other one in plugins.ini, but it's not working...

the code it's fine?

xPaw 08-08-2009 12:47

Re: Blocking Cvars
 
why not just edit admincmd.sma ?

matiaslp 08-08-2009 14:30

Re: Blocking Cvars
 
Quote:

Originally Posted by xPaw (Post 893511)
why not just edit admincmd.sma ?

where? :P

AntiBots 08-08-2009 14:41

Re: Blocking Cvars
 
mmm, you can use this http://forums.alliedmods.net/showthread.php?t=93151 Work but dont is the better option. I will convert this to module. To get better performance.

EDIT: To use you need to register the cvar. and in the public put return 1

Ej
PHP Code:

public my_cvar_changeidprepost)
{
     return 
1;



matiaslp 08-08-2009 14:50

Re: Blocking Cvars
 
Quote:

Originally Posted by AntiBots (Post 893597)
mmm, you can use this http://forums.alliedmods.net/showthread.php?t=93151 Work but dont is the better option. I will convert this to module. To get better performance.

EDIT: To use you need to register the cvar. and in the public put return 1

Ej
PHP Code:

public my_cvar_changeidprepost)
{
     return 
1;



on admincmd?

Where? i'm a bit confused

any ex?

thanks!


All times are GMT -4. The time now is 18:23.

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