Raised This Month: $ Target: $400
 0% 

Block Commands Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-25-2007 , 19:51   Block Commands Help
Reply With Quote #1

I searched around and was looking how you would block commands...I don't know exactly how to go about it now.

They were blocking Fullupdate with
Code:
client_command("fullupdate", "blockCommand");
I tryed to extend it with

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Command Restrictor"
#define VERSION "1.0"
#define AUTHOR "[email protected]"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_concmd("model", "blockCommand");
	register_concmd("retry", "blockCommand");
	register_concmd("reconnect", "blockCommand");
	register_concmd("cl_backspeed", "blockCommand");
	register_concmd("cl_sidespeed", "blockCommand");
	register_concmd("cl_forwardspeed", "blockCommand");
}

public blockCommand(id) {
	client_print(id, print_chat, "You can't use that command");
	return PLUGIN_CONTINUE;
}
This doesn't even load right, it doesn't work.. so How do you go about doing this?
Styles is offline
Send a message via AIM to Styles
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 02-25-2007 , 20:03   Re: Block Commands Help
Reply With Quote #2

Try, return PLUGIN_HANDLED
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-25-2007 , 20:05   Re: Block Commands Help
Reply With Quote #3

Did, its for an RP Server, but it doesn't work, is there somewhere special I should put it on the list?
Styles is offline
Send a message via AIM to Styles
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 02-25-2007 , 20:16   Re: Block Commands Help
Reply With Quote #4

Also try registering it in register_clcmd not register_concmd with the return PLUGIN_HANDLED
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
ClanStyles
BANNED
Join Date: Jun 2006
Old 02-25-2007 , 21:01   Re: Block Commands Help
Reply With Quote #5

Still nothing its for TS..
ClanStyles is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-25-2007 , 21:05   Re: Block Commands Help
Reply With Quote #6

still nothing im using it for ts.
Styles is offline
Send a message via AIM to Styles
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 02-25-2007 , 21:10   Re: Block Commands Help
Reply With Quote #7

Hmmm. I just re-readed your script in the first post. I dont think those are commands, they seem to be client cvars.

You can try checking the value in query_client_cvar and using client_cmd to set it.
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-25-2007 , 21:18   Re: Block Commands Help
Reply With Quote #8

can you give an example please? i dont understand the query_client_cvar thing.. I looked it up
Styles is offline
Send a message via AIM to Styles
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 02-25-2007 , 21:32   Re: Block Commands Help
Reply With Quote #9

Im also new to this, but ill try.
Note: Untested
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Owner"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("amx_getcvar""cmd_get"0"usage: <userid> <cvar>  eg. amx_getcvar cheap_suit volume")
}

public 
cmd_get(id
{
    new 
arg1[32], arg2[32]
    
read_argv(1arg131)
    
read_argv(2arg231)

    new 
player cmd_target(idarg110)
    if(!
player)
        return 
PLUGIN_HANDLED
    
    query_client_cvar
(playerarg2"cvar_result")
    
    return 
PLUGIN_HANDLED
}

public 
cvar_result(id, const cvar[] , const value[])
{
    new 
name[32]
    
get_user_name(idname31)
    
client_print(0print_chat"%s's %s cvar value is %s"namecvarvalue)

Also you can check tis plugins out:
http://forums.alliedmods.net/showthread.php?t=46198
http://forums.alliedmods.net/showthread.php?p=155936
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-25-2007 , 21:40   Re: Block Commands Help
Reply With Quote #10

How is query_client_cvargoing to help me? Ok, it might work with the cl_forwardspeed, cl_sidespeed, cl_backspeed.. there cvars. But what about retry, reconnect, and model.

Whats really odd about all this is that it NEVER prints out anything! whenever I type retry i never get a printout saying tht. or anything! I even tryed typeing say fuck

fuck doesn't cause a printout.
Styles is offline
Send a message via AIM to Styles
Reply


Thread Tools
Display Modes

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 00:38.


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