Raised This Month: $ Target: $400
 0% 

[L4D] No Mercy's Elevator [APRIL/2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Plugin ID:
7057
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    This plugin removes elevator's doors at chapter 4, just for fun.
    Old 04-21-2020 , 20:33   [L4D] No Mercy's Elevator [APRIL/2020]
    Reply With Quote #1


    DESCRIPTION:
    This plugin removes elevator's doors at chapter 4, just for fun.

    CONVARS:
    PHP Code:
    //Enable/Disable this plugin.
    l4d_nomercy_elevator_enable "1" 
    CHANGELOG:
    Version 1.0: 26 april 2020
    - Initial stable release.
    - Added explosions on doors.
    - Removed elevator's ceiling.

    Todo list:
    - Make elevator lift faster.

    Known bugs:
    - None at the moment, post on comments.

    Credits:
    - Thanks Dragokas for optimizations tips.

    Warning:
    Not tested on L4D2, please, post here.

    Beta testing versions:
    - Beta testing versions will be posted on comments.
    The purpose of this is posting my work progress oftenly. They may include unused code, unstable behaviors, non-working features.
    Beta testing plugins will be removed without warning.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_nomercy_elevator.sp - 87 views - 3.8 KB)

    Last edited by axelnieves2012; 05-17-2020 at 21:20.
    axelnieves2012 is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: Argentina
    Old 04-21-2020 , 20:36   Re: [L4D1] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #2

    I tried many ways to create an explosion on doors but nothing worked.
    My idea was creating a propane tank on doors, make it invisible and make it explode, but it didn't work because propane tank got in flames but it never explodes. Even if I shoot at it, it doesn't explode. I have to pick it up and drop it to make it vulnerable to bullets.
    axelnieves2012 is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 04-21-2020 , 20:50   Re: [L4D1] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #3

    Look at other plugins for examples. "expode" from "env_explosion" in Mutants (bomb type), or Flare Gun, or Pourgas, or Airstrike plugin. They all demonstrate one method. Another for replicating Propane tank would be using "prop_physics" and "break" input, see Greandes or Pourgas which does this using the firework /gascan models, just change to use propane model and you should have the same effect.
    __________________
    Silvers is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: Argentina
    Old 04-22-2020 , 01:17   Re: [L4D1] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #4

    Quote:
    Originally Posted by Silvers View Post
    Look at other plugins for examples. "expode" from "env_explosion" in Mutants (bomb type), or Flare Gun, or Pourgas, or Airstrike plugin. They all demonstrate one method. Another for replicating Propane tank would be using "prop_physics" and "break" input, see Greandes or Pourgas which does this using the firework /gascan models, just change to use propane model and you should have the same effect.
    It was very helpful. "prop_physics" is what I was looking for, thanks. Explosion is now working. I will update it soon
    axelnieves2012 is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 04-22-2020 , 14:35   Re: [L4D1] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #5

    Interesting idea, thanks !
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
    [My plugins] [My tools] [GitHub] [Articles]
    Dragokas is offline
    login101
    Senior Member
    Join Date: Sep 2017
    Old 04-22-2020 , 22:36   Re: [L4D1] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #6

    good
    login101 is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 04-23-2020 , 03:14   Re: [L4D1] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #7

    The code is very non-optimized.

    I would suggest to hook "player_use" only when map is "l4d_hospital04_interior" instead of checking it constantly.
    You can use OnMapStart forward to do that.

    Anyway, "player_use" is also fire too often. It's inefficient to make the check everytime.
    Instead you could just hook exactly that entity. If you decide to follow this way, some entities could not initialize yet at map start stage so "round_freeze_end" is preferrable.

    PHP Code:
    public void OnPluginStart()
    {
        
    HookEvent("round_freeze_end",         Event_RoundFreezeEnd,    EventHookMode_PostNoCopy);
    }

    public 
    void Event_RoundFreezeEnd(Event event, const char[] namebool dontBroadcast)
    {
        static 
    char sMap[32], sName[64];
        
    int entity = -1;
        
        
    GetCurrentMap(sMapsizeof(sMap));
        
        if (
    strcmp(sMap"l4d_hospital04_interior") == 0)
        {
            while (-
    != (entity FindEntityByClassname(entity"func_button")))
            {
                
    GetEntPropString(entityProp_Data"m_iName"sNamesizeof(sName));
                if (
    strcmp(sName"elevator_button") == 0)
                {
                    
    HookSingleEntityOutput(entity"OnPressed"OnButtonActiontrue);
                    break;
                }
            }
        }
    }

    void OnButtonAction(const char[] outputint callerint activatorfloat delay)
    {
        
    // some code

    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
    [My plugins] [My tools] [GitHub] [Articles]
    Dragokas is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: Argentina
    Old 04-26-2020 , 16:34   Re: [L4D1] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #8

    Quote:
    Originally Posted by Dragokas View Post
    The code is very non-optimized.

    I would suggest to hook "player_use" only when map is "l4d_hospital04_interior" instead of checking it constantly.
    You can use OnMapStart forward to do that.

    Anyway, "player_use" is also fire too often. It's inefficient to make the check everytime.
    Instead you could just hook exactly that entity. If you decide to follow this way, some entities could not initialize yet at map start stage so "round_freeze_end" is preferrable.

    PHP Code:
    public void OnPluginStart()
    {
        
    HookEvent("round_freeze_end",         Event_RoundFreezeEnd,    EventHookMode_PostNoCopy);
    }

    public 
    void Event_RoundFreezeEnd(Event event, const char[] namebool dontBroadcast)
    {
        static 
    char sMap[32], sName[64];
        
    int entity = -1;
        
        
    GetCurrentMap(sMapsizeof(sMap));
        
        if (
    strcmp(sMap"l4d_hospital04_interior") == 0)
        {
            while (-
    != (entity FindEntityByClassname(entity"func_button")))
            {
                
    GetEntPropString(entityProp_Data"m_iName"sNamesizeof(sName));
                if (
    strcmp(sName"elevator_button") == 0)
                {
                    
    HookSingleEntityOutput(entity"OnPressed"OnButtonActiontrue);
                    break;
                }
            }
        }
    }

    void OnButtonAction(const char[] outputint callerint activatorfloat delay)
    {
        
    // some code

    Hello, your optimization is very helpful. I wrote this code like this only for testing. My plan for initial release was adding a timer on OnMapStart() and check once for mapname, but round_freeze_end is better, I completely forgot about that event.
    I will consider this for first stable version.
    axelnieves2012 is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: Argentina
    Old 04-26-2020 , 19:20   Re: [L4D] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #9

    Version 1.0 stable released!
    axelnieves2012 is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: Argentina
    Old 05-05-2020 , 00:02   Re: [L4D] Door-less elevator at No Mercy [APRIL/2020]
    Reply With Quote #10

    Beta testing version released.
    Source: l4d_nomercy_elevator.sp
    Get plugin!


    Beta Changelog:
    - Removed: Explosion on door opening.
    - Added: Now door will open manually.
    - Added: Special infected inside elevator.
    - Added a witch on ventilation duct.
    - Added: Elevator break and fall down to floor (may be removed on next version).

    Last edited by axelnieves2012; 05-05-2020 at 00:06.
    axelnieves2012 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 12:45.


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