Raised This Month: $182 Target: $400
 45% 

Suicide Intercept


Post New Thread Reply   
 
Thread Tools Display Modes
Author
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Plugin ID:
2463
Plugin Version:
1.5.6
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    20 
    Plugin Description:
    Will delay/block the death of a player if they try to suicide
    Old 07-28-2011 , 09:45   Suicide Intercept
    Reply With Quote #1

    DESCRIPTION:
    This plugin is the result of a request by wazzgod - he had the idea of a plugin that would intercept player suicides and instead of instant death, have it be a delayed death (http://forums.alliedmods.net/showthread.php?t=162870)

    I know I get frustrated when I'm about to get a kill stat and they kill themselves, robbing me of a stat. Well, this plugin will delay that request, notify the player of the intercept via chat and center chat, and if they survive my attack somehow, they'll be slain anyways after X seconds (set in config file SuicideIntercept.plugin.cfg in cstrike/cfg/sourcemod).

    This plugin will intercept player suicide attempts by capturing the following commands
    * kill
    * jointeam
    * joinclass
    * spectate
    * explode
    Plugin can be en/disabled via cvar sm_suicideintercept_enabled 1/0
    Configurable number of delay seconds to carry out players requested suicide.

    By default, ROOT admins are immune to the delays this plugin imposes. If you'd like to grant other admin flags immunity to this plugin, just add the following in the admin_overrides.cfg

    "bypass_suicideintercept" "abo"

    The above would allow those players with flags "a" "b" AND "o" immunity from delays this plugin imposes.

    CVARS


    REQUIREMENTS:
    Plugin was compiled with SourceMod 1.4.0 1.3.8 and has includes of <sourcemod> and <sdktools> and <colors>

    OPTIONAL:
    Updater plugin if you want this plugin to stay updated with changes and bug fixes.

    CREDITS:
    wazzgod for idea (REQ thread) - he posted one, but requested I post mine for approval (here)

    KyleS for the suggestions on cleaning up the code :)

    INSTALLATION:
    - Put the SMX in your cstrike/addons/sourcemod/plugins folder
    - Put the SuicideIntercept.phrases.txt in your cstrike/addons/sourcemod/translations folder
    - Either manually start the plugin, change the map, or restart your server
    --------------------------
    Thanks again to wazzgod for the idea!! I hope people find this plugin useful and fun.

    BTW, the reason I included joinclass as a suicide command to intercept is because Zombie:Reloaded uses it and this plugin "could" be used with that mod if you wanted to delay the suicide instead of outright blocking it (which is an option in ZR)

    If you find a bug, post it here and I'll jump on it. If there are additional commands players can type to suicide, post it here and I'll add them.

    CHANGE LOG

    NOTES:
    You'll have to download the attached .smx file because the web compiler cannot compile due to the <colors> include. I've attached that .inc file as well if you want to recompile yourself.

    Version 1.5.6
    + Added ability to disable immunity

    UPGRADING?
    You'll need to get the updated translation file as well - I've added a bunch of different phrases in there since 1.4b.

    You should backup your config file and let the plugin create a new one, then edit the one it creates since I added a new CVar as of 1.5.6

    If you have Updater, the plugin will auto-update itself if you have the CVar set to 1
    Attached Files
    File Type: txt SuicideIntercept.phrases.txt (2.6 KB, 502 views)
    File Type: sp Get Plugin or Get Source (SuicideIntercept.sp - 534 views - 23.5 KB)
    File Type: smx SuicideIntercept.smx (11.1 KB, 385 views)
    __________________
    View my Plugins | Donate

    Last edited by TnTSCS; 07-23-2012 at 16:31. Reason: Update from 1.5.5 to 1.5.6
    TnTSCS is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 07-28-2011 , 11:40   Re: [CS:S] Suicide Intercept
    Reply With Quote #2

    Nice plugin. It would be cool if sm_suicideintercept_delaydeathtime was set to 0 that the plugin just blocks the commands.

    EDIT: Also, the FindConVar's are kind of wrong since CreateConVar returns a Handle to the ConVar.

    Last edited by KyleS; 07-28-2011 at 11:54.
    KyleS is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 07-28-2011 , 13:01   Re: [CS:S] Suicide Intercept
    Reply With Quote #3

    Is this available for other games too, or just CS:S?

    I'm asking more for others than myself, as the only Source game I host (Team Fortress 2) awards kills for suicides (and environment deaths in general) to the last person to damage a person before they die.

    Incidentally, this plugin would be useless in TF2 for that very reason.
    __________________
    So long and thanks for all the fish.
    Powerlord is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 07-28-2011 , 17:50   Re: [CS:S] Suicide Intercept
    Reply With Quote #4

    Quote:
    Originally Posted by KyleS View Post
    Nice plugin. It would be cool if sm_suicideintercept_delaydeathtime was set to 0 that the plugin just blocks the commands.

    EDIT: Also, the FindConVar's are kind of wrong since CreateConVar returns a Handle to the ConVar.
    have a setting of 0 is a good idea - I'll get that in there.

    I'll look at the FindConVar's to see if I can see what you're talking about - I might need a little direction

    ...:: TnT Edit ::...
    Are you talking about this part?:
    PHP Code:
        g_pluginEnabled FindConVar("sm_suicideintercept_enabled");
        
    g_delay_death_time FindConVar("sm_suicideintercept_delaydeathtime"); 
    Should it just be
    PHP Code:
    g_pluginEnabled CreateConVar("sm_suicideintercept_enabled""1""Is Kill Delay Enabled? 1/0");
    g_delay_death_time CreateConVar("sm_suicideintercept_delaydeathtime""7""How many seconds to wait before forcing the suicide on the player who tried to suicide."_true1.0true25.0); 
    And I'll put an "if GetConVarInt(g_delay_death_time) is zero then plugin_handled" widget

    Last edited by TnTSCS; 07-28-2011 at 17:55.
    TnTSCS is offline
    wazzgod
    Member
    Join Date: Oct 2005
    Location: Home
    Old 07-28-2011 , 20:37   Re: [CS:S] Suicide Intercept
    Reply With Quote #5

    Thx for all your hard work TnTSCS
    __________________
    People Who Think They Know Everything
    Are Very Irritating To Those Of Us Who Do.
    wazzgod is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 07-28-2011 , 21:57   Re: [CS:S] Suicide Intercept
    Reply With Quote #6

    KyleS - ha, I looked at your code and LoL'd

    PHP Code:
    new Handle:hRandom// I HATE Handles.
        
        
    HookConVarChange((hRandom CreateConVar("nt_enabled",                "1",    "Should I even be running?"_true0.0true1.0)),                                                OnEnabledChange);
        
    g_bEnabled GetConVarBool(hRandom); 
    I HATE HANDLES!! LoL
    TnTSCS is offline
    Caffeinated
    Junior Member
    Join Date: Oct 2010
    Old 08-10-2011 , 18:36   Re: [CS:S] Suicide Intercept
    Reply With Quote #7

    I was curious, were you planning on releasing one where delay death could be set to 0?
    Caffeinated is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-10-2011 , 22:07   Re: [CS:S] Suicide Intercept
    Reply With Quote #8

    I'll fix that up right now

    I'll update the OP when it's done... sorry for the delay

    ...:: TnT Edit ::...

    Updated OP with v1.1

    Last edited by TnTSCS; 08-10-2011 at 22:27.
    TnTSCS is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-10-2011 , 23:22   Re: [CS:S] Suicide Intercept
    Reply With Quote #9

    You might have to delete the old config file and let the plugin create a new one
    TnTSCS is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 08-11-2011 , 03:28   Re: [CS:S] Suicide Intercept
    Reply With Quote #10

    Quote:
    Originally Posted by TnTSCS View Post
    Should it just be
    PHP Code:
    g_pluginEnabled CreateConVar("sm_suicideintercept_enabled""1""Is Kill Delay Enabled? 1/0");
    g_delay_death_time CreateConVar("sm_suicideintercept_delaydeathtime""7""How many seconds to wait before forcing the suicide on the player who tried to suicide."_true1.0true25.0); 
    Yup
    KyleS is offline
    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 18:42.


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