AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Suicide Intercept (https://forums.alliedmods.net/showthread.php?t=163257)

TnTSCS 07-28-2011 09:45

Suicide Intercept
 
4 Attachment(s)
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

KyleS 07-28-2011 11:40

Re: [CS:S] Suicide Intercept
 
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.

Powerlord 07-28-2011 13:01

Re: [CS:S] Suicide Intercept
 
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.

TnTSCS 07-28-2011 17:50

Re: [CS:S] Suicide Intercept
 
Quote:

Originally Posted by KyleS (Post 1520449)
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

wazzgod 07-28-2011 20:37

Re: [CS:S] Suicide Intercept
 
Thx for all your hard work TnTSCS :)

TnTSCS 07-28-2011 21:57

Re: [CS:S] Suicide Intercept
 
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

Caffeinated 08-10-2011 18:36

Re: [CS:S] Suicide Intercept
 
I was curious, were you planning on releasing one where delay death could be set to 0?

TnTSCS 08-10-2011 22:07

Re: [CS:S] Suicide Intercept
 
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 :)

TnTSCS 08-10-2011 23:22

Re: [CS:S] Suicide Intercept
 
You might have to delete the old config file and let the plugin create a new one

KyleS 08-11-2011 03:28

Re: [CS:S] Suicide Intercept
 
Quote:

Originally Posted by TnTSCS (Post 1520642)
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 :wink:


All times are GMT -4. The time now is 01:47.

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