AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block Commands Help (https://forums.alliedmods.net/showthread.php?t=51891)

Styles 02-25-2007 19:51

Block Commands Help
 
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?

Cheap_Suit 02-25-2007 20:03

Re: Block Commands Help
 
Try, return PLUGIN_HANDLED

Styles 02-25-2007 20:05

Re: Block Commands Help
 
Did, its for an RP Server, but it doesn't work, is there somewhere special I should put it on the list?

Cheap_Suit 02-25-2007 20:16

Re: Block Commands Help
 
Also try registering it in register_clcmd not register_concmd with the return PLUGIN_HANDLED

ClanStyles 02-25-2007 21:01

Re: Block Commands Help
 
Still nothing :( its for TS..

Styles 02-25-2007 21:05

Re: Block Commands Help
 
still nothing im using it for ts.

Cheap_Suit 02-25-2007 21:10

Re: Block Commands Help
 
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.

Styles 02-25-2007 21:18

Re: Block Commands Help
 
can you give an example please? i dont understand the query_client_cvar thing.. I looked it up

Cheap_Suit 02-25-2007 21:32

Re: Block Commands Help
 
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

Styles 02-25-2007 21:40

Re: Block Commands Help
 
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.


All times are GMT -4. The time now is 00:38.

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