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 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. 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 |
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. |
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. |
Re: [CS:S] Suicide Intercept
Quote:
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:
PHP Code:
|
Re: [CS:S] Suicide Intercept
Thx for all your hard work TnTSCS :)
|
Re: [CS:S] Suicide Intercept
KyleS - ha, I looked at your code and LoL'd
PHP Code:
|
Re: [CS:S] Suicide Intercept
I was curious, were you planning on releasing one where delay death could be set to 0?
|
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 :) |
Re: [CS:S] Suicide Intercept
You might have to delete the old config file and let the plugin create a new one
|
Re: [CS:S] Suicide Intercept
Quote:
|
Re: [CS:S] Suicide Intercept
Quote:
I appreciate any help and criticism when it comes to plugins I put up. |
Re: [CS:S] Suicide Intercept
Updated to 1.2 - if you update, you need to delete the old config file and let the plugin create you a new one.
* Version 1.2 * Applied KyleS' suggestions regarding the FindConVar * Added min 0 and max 1 to sm_suicideintercept_enabled * Added ability to modify the settings while in game (enable or disable it, change the death time) * Updated description to include ability to block the suicide command |
Re: [CS:S] Suicide Intercept
Updated to 1.2a
Version 1.2a (if you update from older version, delete the old config file and let the plugin create a new one) - Cleaned up the code a bit and fixed the bool for enabling the plugin. |
Re: [CS:S] Suicide Intercept
Updated OP with version 1.3a.
Changes include the removal of the config file (just set cvars in sourcemod.cfg or per map config file), cleaned up code more (handles and hookconvarchange) according to KyleS' suggestions, added translations file, and added the colors include. Check it out and let me know what you think. ...:: TnT Edit ::... Oh ya, forgot to mention I put in that if you have the "o" flag, you're allowed to use the suicide commands. You can override this in the admin_overrides.cfg using this: "allow_suicide" "z" The above would only allow those with ROOT flag to be able to use the suicide command right away. |
Re: [CS:S] Suicide Intercept
Note there is a bug when you type spectate in console.
it waits x var then kills you, but doesnt send you to spectate. you have to type spectate in console again (after your dead) in order for you to switch Maybe you should add some vars bla_teamswitch_enable 1 bla_suicide_enable 1 ect so that if a user only wants "kill in console" to be delayed, they dont have to use any of those other features. Just a idea :P |
Re: [CS:S] Suicide Intercept
ya... I noticed that if a player legitimately wants to change teams, it kills them after X seconds , but doesn't display the change team screen...
I'll fix that and update the OP in a bit. Because players can use jointeam and joinclass to commit suicide, I have to keep those in there, but I'll add a cvar to use only "kill and explode" or to use the other three as well... the other three will just delay the action of either spectate or jointeam/class thoughts? |
Re: [CS:S] Suicide Intercept
For the time being, I removed the hook for JOINTEAM and SPECTATE.
Updated OP: Version 1.4 - As brought up by wazzgod, there is a bug with using the commands suicide or jointeam, so I removed those commands from being hooked. Now, only "kill" "explode" and "joinclass" are captured and delayed. - Changed default flag for allow_suicide from CUSTOM1 to ROOT. |
Re: [CS:S] Suicide Intercept
Added back the JOINTEAM and SPECTATE hooks. See OP for further details.
Version 1.4a - Added back the hooks for "jointeam" and "spectate". Now if a player types one of those, it will delay it (if you have it set to) by X seconds, then after that time is up, it will perform the action of either of those commands (move them to spectate, or bring up the team selection menu). - I added a few more entries in the translations file, so you'll have to get the new SuicideIntercept.phrases.txt if you are going to use this version. - I changed the admin_overrides.cfg entry from allow_suicide to "bypass_suicideintercept". By default, ROOT admins can use the commands without the delay. If you want other flags to bypass this plugin, just add their flags to the command "bypass_suicideintercept" ...:: TnT Edit ::... Version 1.4b - Fixed janky translation file - now it has proper variables :) * You need the newly upload translation file with the new smx |
Re: [CS:S] Suicide Intercept
Updated this plugin - addressed some issues and added a few cvars. If upgrading, make sure you download and replace the translation file. See the OP for the latest files
Version 1.5 - Redesigned the code to be cleaner and more effecient * Fixed the bad Int of -1 in convars :oops: * Added new cvars to allow configuration of blocking the "kill", "explode", "spectate", "jointeam", and "joinclass" commands - Reworked some of the code so it keeps itself clean Version 1.5.1 - Added Updater capability UPGRADING? You'll want to delete the old config file (after backing it up) so a new, updated one, will be created. You'll need to get the updated translation file as well - I've added a bunch of different phrases in there since 1.4b. |
Re: Suicide Intercept
Version 1.5.2
- Removed requirement for cstrike - This plugin works on TF2 - confirmed |
Re: Suicide Intercept
Nice plugin.
The only thing i noticed that should be changed is the version cvar flags should have the FCVAR_DONTRECORD so that it isn't written into the config file. Other than that all looks good! |
Re: Suicide Intercept
okay, I'll update this one as well... I'll post an update today :)
thank you |
Re: Suicide Intercept
Updated the plugin - if you have Updater it should auto-update, if not, get the new files from the OP
Code:
Version 1.5.3 |
Re: Suicide Intercept
just one question, If they are already dead, will it still delay? I would install this plugin if it doesn't delay any commands if they are already dead.
|
Re: Suicide Intercept
I believe when they die after trying to suicide, I coded to kill all delayed timers.
|
Re: Suicide Intercept
no, i mean, say I kill them with a soilders rocket, then they attempt to switch classes, will they switch immideatly or will they have to wait?
So, die, attempt to switch, what happens? instead of attempt to switch, wait, dies and switches. |
Re: Suicide Intercept
if they're dead, and want to switch classes, it will let them... the class switch will be handled by the game and game rules
This is the first check in the command callback (when a player switches classes, or types a suicide command) and it checks to make sure the player is alive before acting on the command: PHP Code:
|
Re: Suicide Intercept
well, I want to use this plugin in conjunction with the rtd plugin. I like this plugin because it will stop people from killing themselves when they roll a negative effect. Only problem I see is that it could be frusterating. I also have instant spawn in my server, which doesn't exactly always instantly spawn them, usually takes about 3-4 seconds after dying. If a player spawns then wants to switch but was late because he/she already spawned, then they'll be waiting longer. Is there anyway I can make a request? I was wondering if this could be enabled ONLY during the time a player is rolling (rtd, roll the dice). Or even maybe allow them to swich classes up to after 15 seconds after spawn?
|
Re: Suicide Intercept
Sure, I can add a configurable timer (CVar to set the number of seconds) so that a player can use a suicide command (jointeam, joinclass, spectate, kill, explode) within n seconds after player_spawn.
Give me till the weekend (maybe a few more days) as I have another request I need to fulfill first on another of my plugins, plus I'm out of town till week after next. |
Re: Suicide Intercept
ill be watching.
|
Re: Suicide Intercept
1 Attachment(s)
Here - this is untested, but should work... added a new CVar (sm_suicideintercept_time defaulted to 0) where you can set the number of seconds to allow players to use suicide commands after spawn.
You'll need to compile it yourself with all of the required includes since I'm not home and don't have access to my server - I only edited the sourcecode while sitting here in my hotel room... Let me know if there are any issues. Hopefully you have a test server :) Once I get back home, I'll test the plugin and officially release it. ...:: TnT Edit ::... Actually, I just uploaded a version that doesn't use updater - go to http://www.sourcemodplugins.org/pages/smwebide/ and upload the .sp file there and it will compile it for you. |
Re: Suicide Intercept
Sweet, I'll be testing it as soon as my server is empty.
|
Re: Suicide Intercept
tested. nothing works.
|
Re: Suicide Intercept
Quote:
...:: TnT Edit ::... Found the error in the code - it was in the player_spawn event... I had a rogue "!" in the check :) should be: if(IsFakeClient(client)) - it was if(!IsFakeClient(client))... I'll publish an update today. |
Re: Suicide Intercept
Plugin Updated:
Version 1.5.4 - Added timer to ignore suicide commands by player for n seconds after player spawn (by request) - disabled by default - Added bool for checks if plugin is enabled or not for the console commands - Modified the variable in the translation file so it doesn't print so many 0's in the delay notification ------------------ If you have the Updater plugin and have this plugin set to use it, your copy will auto-update soon, otherwise, get the latest files from the OP. |
Re: Suicide Intercept
thanks for the update, will test again as soon as server empty's. My server is getting too popular. lol.
And it's thanks to people like you! so Thanks a bunch! EDIT: Tested, didn't work. Deleted plugin and config from server, restarted server, reinstalled plugin again just to be sure it was updated. restarted server. still didn't work. I also saw nothing relevant in the logs. |
Re: Suicide Intercept
Actually, do you have it set so admins are immune to it? because Some people are telling me it is working, but for me it is not. I am the only one with the z flag.
|
Re: Suicide Intercept
yes:
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 if you want, I can add a CVar to enable/disable the immunity |
Re: Suicide Intercept
Quote:
|
Re: Suicide Intercept
Hi TnTSCS,
Thanks for this plugin. I have just one error log on my linux cs:s sever, using sm 1.4.4 stable version: Code:
L 07/08/2012 - 16:19:20: SourceMod error session started Regards, St00ne |
All times are GMT -4. The time now is 10:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.