View Single Post
Author Message
ne0cha0s
Senior Member
Join Date: Mar 2010
Old 03-28-2010 , 06:12   [L4D(2)]Infected Self Detonate
Reply With Quote #1

Description:
This plugin allows a player on the infected team to kill themselves by pressing a specified button (default: ZOOM). I only made the suicide possible for the infected I thought it might prove useful. Boomer of course so that while near a player, instead of getting melee'd away and proved useless, you can detonate yourself and get the bile all over them. Spitter suicide could be useful in a few different instances, perhaps you just used your spit, but still want to block a doorway so you can detonate yourself there, or perhaps on a downed survivor. Smoker I added for the people who have that dreaded smoker cloud, it could prove useful when survivors are trapped in a specific location.

Now, just for convenience, it is possible for all special infected classes to self-detonate, although only the ones I thought it would prove useful for are enabled by default.

CVARs:
l4d_detonate_button - Specifies infected self-detonation button. 0 = no self-detonation, (default) 1 = ZOOM, 2 = RELOAD, 3 = MELEE

l4d2_charger_detonate_on - Charger detonate is enabled or disabled. 1 = enabled

l4d2_jockey_detonate_on - Jockey detonate is enabled or disabled. 1 = enabled

l4d2_spitter_detonate_on - Spitter detonate enabled or disabled. 1 = enabled

l4d_boomer_detonate_on - Boomer detonate is enabled or disabled. 1 = enabled

l4d_hunter_detonate_on - Hunter detonate is enabled or disabled. 1 = enabled

l4d_smoker_detonate_on - Smoker detonate is enabled or disabled. 1 = enabled

l4d_tank_detonate_on - Tank detonate is enabled or disabled. 1 = enabled

l4d_display_detonation - Sets whether or not to display when players self-detonate. 1 = enabled

Problems:
No more problems as far as I know. It's now tested and working for Left 4 Dead and Left 4 Dead 2.

To-Dos:
- add some cvars to allow customization - DONE!!!
- add cvar to allow changing of which button suicides - DONE!!!
- add cvar to allow delay for suicide - MIGHT NOT ADD
- clean up code - DONE!!!
- change code to not slap back the infected when they suicide - DONE!!!
- fix any other bugs that come up
- take suggestions?

Info about the author:

I have limited knowledge about programming, and this is the first time I've touched any source code in about 3 years, so bear with me. This is my first plugin, but I do not intend it to be my last, I run my own server and plan to make some more mods in the future. I'm going to be taking some programming classes when I move back home within the next week, and over the next couple months plan to get some more mods published.

Plugin Versions:
0.9 - Added cvar to allow people to select which key self-detonates
0.8b - HUGE code cleanup thanks to dieteetasse
0.8 - added cvar to allow displaying when a player detonates
0.7 - not released
- changed detonate key to the ZOOM key to avoid conflicts with other plugins
0.7b - not released
- experimental code to try and allow choosing which key detonates
0.6 - not released
- added cvar to support tank
- code cleanup
0.5b - fixed spawning with 1 health bug conflicting with other mods
0.4 - added cvars for customization
- now supports all infected classes (besides tank)
- cleaned up and changed code
0.3b - not released
- cleaned up/changed some code to test
0.2: - fixed boomer not knocking back players
- fixed boomer not getting bile on players
- thanks die ;D
0.1: - initial release

UPDATE TO VERSION 0.9:
Make sure you delete your old l4d_infected_self_detonate.cfg before you update.

Credit/Thanks:
marvel - this plugin was inspired by his idea posted here: http://forums.alliedmods.net/showthread.php?t=122324

DieTeetasse - his answering to my jockey making survivor jump request and me taking a look at some source code inspired me to get started on this, plus he posted some simple code that helped jump start this plugin.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_Infected_Self_Detonate.sp - 1842 views - 4.4 KB)
__________________



Last edited by ne0cha0s; 04-23-2010 at 09:57. Reason: updated plugin to version 0.9
ne0cha0s is offline