Raised This Month: $ Target: $400
 0% 

[L4D2] Command To Kill Self When Incapacitated


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DARG367
AlliedModders Donor
Join Date: Aug 2018
Old 04-18-2023 , 06:14   [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #1

About

Commands to kill yourself only when incapacitated or while ledge hanging.
There are no confirmations. When you use the command you will be instantly killed.

Commands

PHP Code:
sm_kill
sm_killme
sm_killself
sm_kms
sm_suicide
sm_giveup 
Console CVars

Only a console variable. The plugin does not create a .cfg file in cfg/sourcemod.
PHP Code:
// 0=Plugin off, 1=Plugin on.
sm_kill_enabled 
Notes

The plugin uses both PrintHintText and PrintToChat. Remove or comment out one of these if you don't want to much screen clutter.

Thanks

TotalChaos SourcePawner for creating the plugin.


Original Post
Spoiler
Attached Files
File Type: sp Get Plugin or Get Source (suicide.sp - 77 views - 3.6 KB)

Last edited by DARG367; 05-17-2023 at 15:02.
DARG367 is offline
TotalChaos SourcePawner
Senior Member
Join Date: Feb 2023
Location: IN PINEAPPLE, UNDER SEA
Old 04-18-2023 , 12:47   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #2

Here is a very simple plugin which works for the most part.
This plugin is an absolute mess, and uses a mixture of old syntax and new syntax.
I could not be bothered to fully convert it to the new syntax.

With that being said, I have absolutely no idea if it would work for non-hosts/non-admins.
In fact, I only tested it on my own listen server. Every test seems to have worked perfectly.

Console commands:
sm_kill, sm_killme, sm_kms, sm_suicide, sm_giveup.

Chat commands:
Public:
!kill, !killme, !kms, !suicide, !giveup.
Silent/Private:
/kill, /killme, /kms, /suicide, /giveup.

Other notes:
There are lots of comments within the code that explain what things do.
This plugin may work with L4D1, but I never tested that.
There is no L4D1 version, contrary to what one of the comments say.
There is no engine check for L4D2 or L4D1. If you run it on, for example, TF2, it will throw errors.
This is only a start. If somebody else can come in and finalize it, that would be great.
Attached Files
File Type: sp Get Plugin or Get Source (L4D2_Suicide.sp - 55 views - 2.9 KB)
TotalChaos SourcePawner is offline
DARG367
AlliedModders Donor
Join Date: Aug 2018
Old 04-18-2023 , 15:34   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #3

Quote:
Originally Posted by TotalChaos SourcePawner View Post
Here is a very simple plugin which works for the most part.
This plugin is an absolute mess, and uses a mixture of old syntax and new syntax.
I could not be bothered to fully convert it to the new syntax.

With that being said, I have absolutely no idea if it would work for non-hosts/non-admins.
In fact, I only tested it on my own listen server. Every test seems to have worked perfectly.

Console commands:
sm_kill, sm_killme, sm_kms, sm_suicide, sm_giveup.

Chat commands:
Public:
!kill, !killme, !kms, !suicide, !giveup.
Silent/Private:
/kill, /killme, /kms, /suicide, /giveup.

Other notes:
There are lots of comments within the code that explain what things do.
This plugin may work with L4D1, but I never tested that.
There is no L4D1 version, contrary to what one of the comments say.
There is no engine check for L4D2 or L4D1. If you run it on, for example, TF2, it will throw errors.
This is only a start. If somebody else can come in and finalize it, that would be great.
No error logs, no console spamming and works for non-admins/host (dedicated server). I like how you also made the message appear in the center of the screen as well to be more noticeable. Plugin so far works great for what I need it to do. Thanks!

Like you mentioned if anyone else would like to clean up the plugin, I wouldn't mind that either.

But once again thanks for the quick turnaround.

Last edited by DARG367; 04-18-2023 at 15:34.
DARG367 is offline
TotalChaos SourcePawner
Senior Member
Join Date: Feb 2023
Location: IN PINEAPPLE, UNDER SEA
Old 04-18-2023 , 16:13   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #4

Quote:
Originally Posted by DARG367 View Post
No error logs, no console spamming and works for non-admins/host (dedicated server). I like how you also made the message appear in the center of the screen as well to be more noticeable. Plugin so far works great for what I need it to do. Thanks!

Like you mentioned if anyone else would like to clean up the plugin, I wouldn't mind that either.

But once again thanks for the quick turnaround.
No problem; good to hear that it works.

I just remembered that I forgot to do a team check, though. So the messages would appear for people that aren't on the Survivor team. But the commands won't work anyway because spectators/Infected can't be incapped by normal means.
The plugin also works for anybody who's hanging on a ledge, because that's technically being incapped, I think.
I never tested the ledge hanging, though.

Also, if you force incapped Survivor bots to say one of the commands in the chat, that should work too.
I never tested that either, but I don't see why it wouldn't work.

I probably should've tested the plugin more thoroughly before releasing it... Sorry about that.

Last edited by TotalChaos SourcePawner; 04-18-2023 at 16:15.
TotalChaos SourcePawner is offline
DARG367
AlliedModders Donor
Join Date: Aug 2018
Old 04-18-2023 , 16:43   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #5

Quote:
Originally Posted by TotalChaos SourcePawner View Post
No problem; good to hear that it works.

I just remembered that I forgot to do a team check, though. So the messages would appear for people that aren't on the Survivor team. But the commands won't work anyway because spectators/Infected can't be incapped by normal means.
The plugin also works for anybody who's hanging on a ledge, because that's technically being incapped, I think.
I never tested the ledge hanging, though.

Also, if you force incapped Survivor bots to say one of the commands in the chat, that should work too.
I never tested that either, but I don't see why it wouldn't work.

I probably should've tested the plugin more thoroughly before releasing it... Sorry about that.
Ledge hang does work as it should I saw you put that there while I was checking the .sp file. I'm glad you added it I tried mentioning everything I needed but forgot that so thank you.

Also no worries the plugin works like a charm no noticeable bugs. My server is mainly coop or a few mutations not VS. So infected isn't a problem for me at least.

Last edited by DARG367; 04-18-2023 at 16:45.
DARG367 is offline
DARG367
AlliedModders Donor
Join Date: Aug 2018
Old 04-19-2023 , 21:31   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #6

I was wondering if someone could add onto this plugin with the possibility of checking if the finale has been activated. I'm not sure if there is a default way of checking and if custom campaigns change it? Right now I have the message to say don't use it on finale maps.

If there is a way to check if finale has been activated display another message saying can't use while finale is activated or something along those lines.

Last edited by DARG367; 04-19-2023 at 21:39.
DARG367 is offline
TotalChaos SourcePawner
Senior Member
Join Date: Feb 2023
Location: IN PINEAPPLE, UNDER SEA
Old 04-20-2023 , 10:47   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #7

Quote:
Originally Posted by DARG367 View Post
I was wondering if someone could add onto this plugin with the possibility of checking if the finale has been activated. I'm not sure if there is a default way of checking and if custom campaigns change it? Right now I have the message to say don't use it on finale maps.

If there is a way to check if finale has been activated display another message saying can't use while finale is activated or something along those lines.
That would be an incredibly easy check for me to add.
But, resetting it after the finale (exited, failed, finished, etc.) might be a challenge for me. Mostly because of how many different ways a finale can "end".

So how about a console variable to toggle the plugin on and off instead (e.g. "sm_kill_enable 1/0")?
0 (off): The commands don't do anything. No messages pop up when they're used.
1 (on): The commands work as intended.

Last edited by TotalChaos SourcePawner; 04-20-2023 at 10:50.
TotalChaos SourcePawner is offline
DARG367
AlliedModders Donor
Join Date: Aug 2018
Old 04-20-2023 , 15:33   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #8

Quote:
Originally Posted by TotalChaos SourcePawner View Post
That would be an incredibly easy check for me to add.
But, resetting it after the finale (exited, failed, finished, etc.) might be a challenge for me. Mostly because of how many different ways a finale can "end".

So how about a console variable to toggle the plugin on and off instead (e.g. "sm_kill_enable 1/0")?
0 (off): The commands don't do anything. No messages pop up when they're used.
1 (on): The commands work as intended.
That could be a nice work around for now. Most of the time anyways that the server is populated is when I'm actually there so this works.
DARG367 is offline
TotalChaos SourcePawner
Senior Member
Join Date: Feb 2023
Location: IN PINEAPPLE, UNDER SEA
Old 04-20-2023 , 15:50   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #9

Here's a version with the enable/disable console variable that you can use until I can make a version that doesn't work on finales.

"sm_kill_enabled", default "1".
If 0, the plugin's commands cannot be used and no messages will be displayed.

Edit: When I make the version that disables itself on finales, I'll update the plugin to the new syntax if I can, and I'll add an engine check for L4D1 and L4D2.
I'll admit, I know more about the old syntax than the new. I blame Google for that.
Attached Files
File Type: sp Get Plugin or Get Source (L4D2_Suicide.sp - 73 views - 3.2 KB)

Last edited by TotalChaos SourcePawner; 04-20-2023 at 16:06.
TotalChaos SourcePawner is offline
DARG367
AlliedModders Donor
Join Date: Aug 2018
Old 04-20-2023 , 16:05   Re: [L4D2] Command To Kill Self When Incapacitated
Reply With Quote #10

Quote:
Originally Posted by TotalChaos SourcePawner View Post
Here's a version with the enable/disable console variable that you can use until I can make a version that doesn't work on finales.

"sm_kill_enabled", default "1".
If 0, the plugin's commands cannot be used and no messages will be displayed.
Thanks for the quick turn around! I'll be testing this a little later today.
DARG367 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 06:53.


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