AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] suicide blocker (https://forums.alliedmods.net/showthread.php?t=331410)

rekcah 03-20-2021 04:12

[L4D2] suicide blocker
 
1 Attachment(s)
if a player jumps from some where attempting to suicide this will prevent the damage and teleport them back to safety.

if anyone finds any bugs let me know.

Elite Biker 03-20-2021 06:40

Re: [L4D2] suicide blocker
 
Well then work.


- Bugs:
- 1) Whenever you try to kill yourself you're available to kill yourself anytime if you takeover a bot.

- 2) When a tank punches you/survivor to a steep place or a far destination/a place that where you suppose to go and it's steep (You/survivor properly die) that where the tank punches you/survivor, you/the survivor just teleport back to where a tank punched you/the survivor off.

Sorry for my english.

jeremyvillanueva 03-23-2021 15:01

Re: [L4D2] suicide blocker
 
Thanks a lot I have been looking for this,
I see one plugin on the xygamers forum but I couldn't download because it's China login locked :c

I'll test it,

Mr. Man 03-23-2021 22:57

Re: [L4D2] suicide blocker
 
I see the plugin author in the .sp file as spirit. The same Spirit on our forum? May want to give him credit...

rekcah 03-24-2021 02:40

Re: [L4D2] suicide blocker
 
Quote:

Originally Posted by Mr. Man (Post 2741523)
I see the plugin author in the .sp file as spirit. The same Spirit on our forum? May want to give him credit...

Spirit is my steam name.

Spirit_12 03-24-2021 08:50

Re: [L4D2] suicide blocker
 
The plugin need an updated syntax and a lot of code cleanup. Look up transitional syntax and update the code please. Also, I would rather like the netprop method being used to detect the SI rather than hooking the events as that would tidy up the code a lot.

Also the plugin is missing the skip for stumble criteria such as propane explosion or boomer explosion.

rekcah 03-27-2021 21:09

Re: [L4D2] suicide blocker
 
Quote:

Originally Posted by Spirit_12 (Post 2741576)
The plugin need an updated syntax and a lot of code cleanup. Look up transitional syntax and update the code please. Also, I would rather like the netprop method being used to detect the SI rather than hooking the events as that would tidy up the code a lot.

Also the plugin is missing the skip for stumble criteria such as propane explosion or boomer explosion.

I've tried updating the syntax, not sure if there's more to be done.

i think netprops would be a good solution as well, however I'm not sure how that would work. for example if a charger dies in mid air, you cant stop blocking the death until they are safely on the ground again.

and I'm pretty sure that stumbles don't need to be blocked because they result in ledge hangs.

Spirit_12 03-28-2021 00:41

Re: [L4D2] suicide blocker
 
Quote:

Originally Posted by rekcah (Post 2742085)
I've tried updating the syntax, not sure if there's more to be done.

You can force transitional syntax in your plugins by adding the following at the top of your code. Semicolon is also a good to have as it makes your code look neat.

PHP Code:

#pragma semicolon 1
#pragma newdecls required 

Now when you compile your plugin the compiler will tell you what lines need the new syntax.

Quote:

Originally Posted by rekcah (Post 2742085)
i think netprops would be a good solution as well, however I'm not sure how that would work. for example if a charger dies in mid air, you cant stop blocking the death until they are safely on the ground again.

I was thinking of using the netprops method to detect if survivor was capped or not.

Quote:

Originally Posted by rekcah (Post 2742085)
and I'm pretty sure that stumbles don't need to be blocked because they result in ledge hangs.

Mostly its true, but there is always that rare occasion when they just completely fall off.

rekcah 03-28-2021 23:57

Re: [L4D2] suicide blocker
 
i added

PHP Code:

#pragma semicolon 1
#pragma newdecls required 

to the code and made the required changes so it should be fully updated now, im also pretty sure i found the bug that was stopping it from blocking suicides.

i'm not gonna add the propane/ boomer explosions checks because im lazy and don't think its really necessary, explosions causing hangs are rare, explosions causing falls are even rarer, but if it starts happening regularly on my server i might add it one day.

Spirit_12 03-29-2021 01:05

Re: [L4D2] suicide blocker
 
Plugin looks good. I noticed a few things that will add more functionality to the plugin, if you plan on updating it.

PHP Code:

public bool IsIncapacitated(int client)
{
    if(!
IsValidClient(client))
        return 
false;
    return (
GetEntProp(clientProp_Send"m_isIncapacitated")==1);


You don't need to check if GetEntProp is == 1 as you have already defined the return of this function as a bool and that net props only returns 0 or 1.

I also noticed this.

PHP Code:

if(JumpCount[victim] > 10)
{
    
//KickClientEx(client,"Have A Nice Day!");
    
JumpCount[victim] = 0;


I do like the kick feature. I think switching the jump count to a ConVar and allowing the kick feature based on a ConVar would be valuable additions to the plugin.

Besides that this is a great plugin. Thanks for contributing.


All times are GMT -4. The time now is 06:26.

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