Raised This Month: $51 Target: $400
 12% 

Block Kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Xuqe Noia
SourceMod Donor
Join Date: Jan 2010
Location: Brazil
Plugin ID:
1783
Plugin Version:
1.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Block the Kill cvar
    Unapprover:
    Reason for Unapproving:
    Extremely limited use. (even also catching 'explode' would have been better). There are at least a couple plugins that will block any of a given list of commands for higher flexability.
    Old 07-05-2010 , 13:15   Block Kill
    Reply With Quote #1

    This is a simple plugin that blocks the kill cvar
    and is my first sourcemod plugin

    Changelog
    • 1.1 - Added a Enable/Disable cvar
    Attached Files
    File Type: sp Get Plugin or Get Source (blockkill.sp - 2258 views - 782 Bytes)

    Last edited by Xuqe Noia; 07-05-2010 at 13:57.
    Xuqe Noia is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Old 07-05-2010 , 13:26   Re: Block Kill
    Reply With Quote #2

    I see, so when a player type's kill in console, they don't get killed? Thanks for the plugin!
    Sreaper is offline
    Xuqe Noia
    SourceMod Donor
    Join Date: Jan 2010
    Location: Brazil
    Old 07-05-2010 , 13:28   Re: Block Kill
    Reply With Quote #3

    yeah
    Xuqe Noia is offline
    matrixmark
    Senior Member
    Join Date: Jun 2010
    Old 07-06-2010 , 03:08   Re: Block Kill
    Reply With Quote #4

    This is quite usefull... I regularly get the griefers that join, perform the kill command then leave.

    Thanks
    matrixmark is offline
    freakzoid
    Junior Member
    Join Date: Jun 2010
    Old 07-29-2010 , 17:08   Re: Block Kill
    Reply With Quote #5

    Hey all, I just read Yak's FAQs on Scripting and found:

    Quote:
    EDIT: As of version 1.3, there is a better way to hook and block commands that are already registered. Unlike RegConsoleCmd, the new AddCommandListener(CommandListener:callback, const String:command[]="") creates only a lightweight hook for when the command is run, instead of creating a whole new command and slowing down the command dispatch. Thus, you should always use AddCommandListener when possible.
    So here is edited version of Block Kill with AddCommandListener:

    PHP Code:
    #include <sourcemod>

    #define BLOCKKILL_VERSION "1.2"
    new Handle:blockkill_enabled;

    public 
    Plugin:myinfo 
    {
        
    name "Block Kill",
        
    author "Xuqe Noia",
        
    description "Block's the cvar KILL",
        
    version BLOCKKILL_VERSION,
        
    url "http://LiquidBR.com"
    };

    public 
    OnPluginStart()
    {
        
    CreateConVar"blockkill_varsion"BLOCKKILL_VERSION"KillBlock Version"FCVAR_NOTIFY );
        
    blockkill_enabled CreateConVar("blockkill_enabled""1""Enable or disable KillBlock; 0 - disabled, 1 - enabled");
        
    AddCommandListener(BlockKill"kill");
    }

    public 
    Action:BlockKill(client, const String:command[], argc)
    {
        if (
    GetConVarInt(blockkill_enabled) == 1)
        {
            
    PrintToChat(client"\x04[BlockKill]\x01 The \x05kill\x01 cvar is blocked!");
            return 
    Plugin_Handled;
        }
        return 
    Plugin_Continue;


    Greetz
    Attached Files
    File Type: sp Get Plugin or Get Source (blockkill.sp - 926 views - 811 Bytes)
    __________________

    freakzoid is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 08-15-2010 , 06:07   Re: Block Kill
    Reply With Quote #6

    wow, way to kill off his first plugin. lol
    Drixevel is offline
    Sanya_Zol
    New Member
    Join Date: Mar 2010
    Old 11-10-2010 , 12:23   Re: Block Kill
    Reply With Quote #7

    Useful, but

    1.
    CreateConVar( "blockkill_varsion", <...>
    maybe version?

    2.
    This blocks "explode" too?

    3.
    I think admins (a flag) should be able to kill himself

    4.
    What should player do if they get stuck? "HELP PLZ KILL ME"?

    5.
    oh, please... blockkill_* -> sm_blockkill_*

    6.
    freakzoid
    +10
    Sanya_Zol is offline
    Send a message via ICQ to Sanya_Zol Send a message via Skype™ to Sanya_Zol
    Sanya_Zol
    New Member
    Join Date: Mar 2010
    Old 11-10-2010 , 12:58   Re: Block Kill
    Reply With Quote #8


    improved a bit
    PHP Code:
        #include <sourcemod>
        
        #define BLOCKKILL_VERSION "1.3"
        
    new Handle:sm_blockkill_enabled;
        new 
    Handle:sm_blockkill_notify;
        
        public 
    Plugin:myinfo 
        {
            
    name "Block Kill",
            
    author "Xuqe Noia & Sanya_Zol",
            
    description "Blocks suicide commands",
            
    version BLOCKKILL_VERSION,
            
    url "http://LiquidBR.com"
        
    };
        
        public 
    OnPluginStart()
        {
            
    CreateConVar"sm_blockkill_version"BLOCKKILL_VERSION"KillBlock Version"FCVAR_NOTIFY );
            
    sm_blockkill_enabled CreateConVar("sm_blockkill_enabled""1""Enable or disable KillBlock; 0 - disabled, 1 - enabled");
            
    sm_blockkill_notify CreateConVar("sm_blockkill_notify""1""Enable or disable KillBlock chat notify; 0 - disabled, 1 - enabled");
            
    AddCommandListener(BlockKill"kill");
            
    AddCommandListener(BlockKill"explode");
        }
        
        public 
    Action:BlockKill(client, const String:command[], argc)
        {
            if (
    GetConVarInt(sm_blockkill_enabled) != 1) { return Plugin_Continue; }
            
    // don't forget to credit Sanya_Zol
            
    new flags GetUserFlagBits(client);
            if(
    flags ADMFLAG_GENERIC || flags ADMFLAG_ROOT || flags ADMFLAG_SLAY || flags ADMFLAG_CHEATS) {
                
    // admins with one of this 4 flags constantly shouldn't be affected
                
    return Plugin_Continue;
            }
            if(
    GetConVarInt(sm_blockkill_notify)==1) {
                
    PrintToChat(client"\x04[BlockKill]\x01 Suicide commands is blocked!");
            }
            return 
    Plugin_Handled;
        } 
    ... hope this works (untested)
    Attached Files
    File Type: sp Get Plugin or Get Source (blockkill.sp - 878 views - 1.4 KB)

    Last edited by Sanya_Zol; 11-10-2010 at 12:59. Reason: forgot "untested"
    Sanya_Zol is offline
    Send a message via ICQ to Sanya_Zol Send a message via Skype™ to Sanya_Zol
    eric0279
    AlliedModders Donor
    Join Date: May 2007
    Old 04-04-2011 , 16:52   Re: Block Kill
    Reply With Quote #9

    Quote:
    Originally Posted by Sanya_Zol View Post

    improved a bit
    PHP Code:
        #include <sourcemod>
        
        #define BLOCKKILL_VERSION "1.3"
        
    new Handle:sm_blockkill_enabled;
        new 
    Handle:sm_blockkill_notify;
        
        public 
    Plugin:myinfo 
        {
            
    name "Block Kill",
            
    author "Xuqe Noia & Sanya_Zol",
            
    description "Blocks suicide commands",
            
    version BLOCKKILL_VERSION,
            
    url "http://LiquidBR.com"
        
    };
        
        public 
    OnPluginStart()
        {
            
    CreateConVar"sm_blockkill_version"BLOCKKILL_VERSION"KillBlock Version"FCVAR_NOTIFY );
            
    sm_blockkill_enabled CreateConVar("sm_blockkill_enabled""1""Enable or disable KillBlock; 0 - disabled, 1 - enabled");
            
    sm_blockkill_notify CreateConVar("sm_blockkill_notify""1""Enable or disable KillBlock chat notify; 0 - disabled, 1 - enabled");
            
    AddCommandListener(BlockKill"kill");
            
    AddCommandListener(BlockKill"explode");
        }
        
        public 
    Action:BlockKill(client, const String:command[], argc)
        {
            if (
    GetConVarInt(sm_blockkill_enabled) != 1) { return Plugin_Continue; }
            
    // don't forget to credit Sanya_Zol
            
    new flags GetUserFlagBits(client);
            if(
    flags ADMFLAG_GENERIC || flags ADMFLAG_ROOT || flags ADMFLAG_SLAY || flags ADMFLAG_CHEATS) {
                
    // admins with one of this 4 flags constantly shouldn't be affected
                
    return Plugin_Continue;
            }
            if(
    GetConVarInt(sm_blockkill_notify)==1) {
                
    PrintToChat(client"\x04[BlockKill]\x01 Suicide commands is blocked!");
            }
            return 
    Plugin_Handled;
        } 
    ... hope this works (untested)

    Hi,

    Quote:
    blockkill.sp(1) : error 010: invalid function or declaration
    eric0279 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 07:19.


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