Raised This Month: $ Target: $400
 0% 

Blocking Cvars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
matiaslp
Senior Member
Join Date: Apr 2007
Old 08-06-2009 , 08:45   Blocking Cvars
Reply With Quote #1

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
matiaslp is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-06-2009 , 12:00   Re: Blocking Cvars
Reply With Quote #2

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.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 08-06-2009 , 12:48   Re: Blocking Cvars
Reply With Quote #3

Check if you have the plugin before the admincmd plugin on plugins.ini
__________________
IneedHelp is offline
matiaslp
Senior Member
Join Date: Apr 2007
Old 08-08-2009 , 12:43   Re: Blocking Cvars
Reply With Quote #4

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

the code it's fine?
matiaslp is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-08-2009 , 12:47   Re: Blocking Cvars
Reply With Quote #5

why not just edit admincmd.sma ?
__________________
xPaw is offline
matiaslp
Senior Member
Join Date: Apr 2007
Old 08-08-2009 , 14:30   Re: Blocking Cvars
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
why not just edit admincmd.sma ?
where?
matiaslp is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 08-08-2009 , 14:41   Re: Blocking Cvars
Reply With Quote #7

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;

__________________

Last edited by AntiBots; 08-08-2009 at 14:44.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
matiaslp
Senior Member
Join Date: Apr 2007
Old 08-08-2009 , 14:50   Re: Blocking Cvars
Reply With Quote #8

Quote:
Originally Posted by AntiBots View Post
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!
matiaslp 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