Raised This Month: $32 Target: $400
 8% 

[L4D2] suicide blocker


Post New Thread Reply   
 
Thread Tools Display Modes
Author
rekcah
Member
Join Date: Jun 2019
Plugin ID:
7564
Plugin Version:
1
Plugin Category:
All
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    blocks most player suicides
    Old 03-20-2021 , 04:12   [L4D2] suicide blocker
    Reply With Quote #1

    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.
    Attached Files
    File Type: sp Get Plugin or Get Source (block suicide jumps 5.sp - 679 views - 6.7 KB)

    Last edited by rekcah; 03-29-2021 at 00:23. Reason: updated
    rekcah is offline
    Elite Biker
    Member
    Join Date: Nov 2020
    Location: The 13 Blessings
    Old 03-20-2021 , 06:40   Re: [L4D2] suicide blocker
    Reply With Quote #2

    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.
    __________________
    *Bop*

    Last edited by Elite Biker; 04-15-2021 at 03:22. Reason: - Bug Found#1
    Elite Biker is offline
    jeremyvillanueva
    AlliedModders Donor
    Join Date: Jan 2021
    Location: dcord:Jeremy333#7632
    Old 03-23-2021 , 15:01   Re: [L4D2] suicide blocker
    Reply With Quote #3

    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,
    jeremyvillanueva is offline
    Mr. Man
    Veteran Member
    Join Date: Mar 2011
    Location: Huh?
    Old 03-23-2021 , 22:57   Re: [L4D2] suicide blocker
    Reply With Quote #4

    I see the plugin author in the .sp file as spirit. The same Spirit on our forum? May want to give him credit...
    __________________
    Mr. Man is offline
    rekcah
    Member
    Join Date: Jun 2019
    Old 03-24-2021 , 02:40   Re: [L4D2] suicide blocker
    Reply With Quote #5

    Quote:
    Originally Posted by Mr. Man View Post
    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.
    rekcah is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 03-24-2021 , 08:50   Re: [L4D2] suicide blocker
    Reply With Quote #6

    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.
    __________________

    Last edited by Spirit_12; 03-24-2021 at 08:51.
    Spirit_12 is offline
    rekcah
    Member
    Join Date: Jun 2019
    Old 03-27-2021 , 21:09   Re: [L4D2] suicide blocker
    Reply With Quote #7

    Quote:
    Originally Posted by Spirit_12 View Post
    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.
    rekcah is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 03-28-2021 , 00:41   Re: [L4D2] suicide blocker
    Reply With Quote #8

    Quote:
    Originally Posted by rekcah View Post
    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 View Post
    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 View Post
    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.
    __________________
    Spirit_12 is offline
    rekcah
    Member
    Join Date: Jun 2019
    Old 03-28-2021 , 23:57   Re: [L4D2] suicide blocker
    Reply With Quote #9

    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.
    rekcah is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 03-29-2021 , 01:05   Re: [L4D2] suicide blocker
    Reply With Quote #10

    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.
    __________________
    Spirit_12 is offline
    Reply


    Thread Tools
    Display Modes

    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:08.


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