Raised This Month: $ Target: $400
 0% 

Block Any Command in Console


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 08-16-2008 , 22:59   Block Any Command in Console
Reply With Quote #1

I was wondering if it would be possible to block clients that connect yo your server from using certain commands, for example on my server players can set_money if they know the command and a couple other things that shouldn't be used by clients or anyone.

I was planning to use this code and make it so that you can declare what commands u want block including cvars with a space.


PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <colorchat>

#define PLUGIN    "Block Command"
#define AUTHOR    "Drogocop"
#define VERSION    "1.1"

#include "BlockCommand_inc\menu.inc"

new szPrefix[19] = "[BC]";        //Prefix or TAG for all client_chat mensagges

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_cvar("bc_blockbuy""1");                    // All buys Blocked
    
register_cvar("bc_blockradio""1");                // Block Radio commands
    
register_cvar("bc_blockchooseteam""1");            // Block Choose Team
    
register_clcmd("bc_blockchat""cmd_chatmute", -1"<name>"// Muted Chat of a player. 
    
register_clcmd("bc_blockchatmenu""menu_chatmute", -1"chat mute menu"// Open Chat Mute Menu
    
register_concmd("say""say_handle")
    
register_concmd("say_team""say_handle")
    
register_dictionary "blockcommand.txt" );
    
maxplayers get_maxplayers() + 1
    SayText 
get_user_msgid("SayText")
    
register_cvar("bc_prefix"szPrefix);
    
    
//Block  All Buy and Buy Binds
    
if (get_cvar_num("bc_blockbuy"))
    {
        
register_clcmd("buy""bblocked");
        
register_clcmd("cl_autobuy""bblocked");
        
register_clcmd("cl_rebuy""bblocked");
        
register_clcmd("cl_setautobuy""bblocked");
        
register_clcmd("cl_setrebuy""bblocked");
        
        
register_clcmd("glock""bblocked");
        
register_clcmd("usp""bblocked");
        
register_clcmd("p228""bblocked");
        
register_clcmd("deagle""bblocked");
        
register_clcmd("elites""bblocked");
        
register_clcmd("fn57""bblocked");
        
        
register_clcmd("mp5""bblocked");
        
register_clcmd("smg""bblocked");
        
register_clcmd("mac10""bblocked");
        
register_clcmd("tmp""bblocked");
        
register_clcmd("ump45""bblocked");
        
register_clcmd("p90""bblocked");
        
        
register_clcmd("m3""bblocked");
        
register_clcmd("xm1014""bblocked");
        
        
register_clcmd("famas""bblocked");
        
register_clcmd("m4a1""bblocked");
        
register_clcmd("ak47""bblocked");
        
register_clcmd("sg552""bblocked");
        
register_clcmd("galil""bblocked"); 
        
register_clcmd("aug""bblocked");
        
        
register_clcmd("scout""bblocked");
        
register_clcmd("awp""bblocked");
        
register_clcmd("sg550""bblocked");
        
register_clcmd("g3sg1""bblocked");
        
        
register_clcmd("m249""bblocked");
        
        
register_clcmd("hegren""bblocked");
        
register_clcmd("flash""bblocked");
        
register_clcmd("sgren""bblocked");
        
register_clcmd("vest""bblocked");
        
register_clcmd("vesthelm""bblocked");
        
register_clcmd("shield""bblocked");
        
register_clcmd("buyammo1""bblocked");
        
register_clcmd("buyammo1""bblocked");
        
register_clcmd("buyequip""bblocked");
    }
    
    
//Block Radio Commands
    
if (get_cvar_num("bc_blockradio"))
    {
        
register_clcmd("radio1""rblocked");
        
register_clcmd("radio2""rblocked");
        
register_clcmd("radio3""rblocked");
        
register_clcmd("coverme""rblocked")
        
register_clcmd("takepoint""rblocked")
        
register_clcmd("holdpos""rblocked")
        
register_clcmd("regroup""rblocked")
        
register_clcmd("followme""rblocked")
        
register_clcmd("takingfire""rblocked")
        
register_clcmd("go""rblocked")
        
register_clcmd("fallback""rblocked")
        
register_clcmd("sticktog""rblocked")
        
register_clcmd("getinpos""rblocked")
        
register_clcmd("stormfront""rblocked")
        
register_clcmd("report""rblocked")
        
register_clcmd("roger""rblocked")
        
register_clcmd("enemyspot""rblocked")
        
register_clcmd("needbackup""rblocked")
        
register_clcmd("sectorclear""rblocked")
        
register_clcmd("inposition""rblocked")
        
register_clcmd("reportingin""rblocked")
        
register_clcmd("getout""rblocked")
        
register_clcmd("negative""rblocked")
        
register_clcmd("enemydown""rblocked")
    }
    
    
//Block Choose Team
    
if (get_cvar_num("bc_blockchooseteam"))
    {
        
register_clcmd("chooseteam""ctblocked");
    }
    
    
//Block retry
    
if (get_cvar_num("bc_blockretry"))
    {
        
register_clcmd("retry""blockr");
    }
}

public 
bblocked(id)
    {
    
ColorChat(id,GREEN"%L"id"BLOCK_BUY"szPrefix);
    return 
PLUGIN_HANDLED
    
}
    
public 
rblocked(id)
    {
    
ColorChat(id,GREEN"%L"id"BLOCK_RADIO"szPrefix);
    return 
PLUGIN_HANDLED
    
}
    
public 
ctblocked(id)
    {
    
ColorChat(id,GREEN"%L"id"BLOCK_CHOOSETEAM"szPrefix);
    return 
PLUGIN_HANDLED
    

__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.
Kitami is offline
 



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 03:16.


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