Raised This Month: $12 Target: $400
 3% 

[L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Plugin ID:
6966
Plugin Version:
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 03-05-2020 , 14:11   [L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02)
    Reply With Quote #1

    Description:
    This plugin announces tank spawns and locks the safehouse door until the tank is dead.

    ATM L4D1 vs only. (For Coop just add the final map names)

    Feature:
    It makes rushers who try to skip the tank look really dump... when they try to open the safehouse door...

    CVAR/Command list:
    None

    Changelog:
    2020-03-05 (v1.0.3)
    * Initial release.
    2020-03-06 (v1.0.4)
    * added l4d_vs_smalltown03_ranchhouse to "is final map" check because churchguy door would open after tank kill...
    2020-03-28 (v1.0.7)
    * added a workaround for the multiple tanks error, so it only announce the 1st tank and opens the door when all tanks are dead. It will not announce the second tank on final or when they get spawned via other addons
    2021-12-18 (v1.1.6)
    * added Marttts door checks plus the old one, added message on opening locked end door
    2022-01-02 (v1.1.7)
    * added Silvers replacement for the cooldown timer

    Installation instructions:
    Click 'Get Plugin' button, place SMX in the sourcemod plugins folder. Or compile it yourself.

    Dependencies:
    None

    Bugs:
    None atm

    Plans:
    None atm

    Credits:
    Based on code from:
    * [L4D / L4D2] Lockdown System | 1.7 [Final] : Jan. 30, 2019 |
    * https://forums.alliedmods.net/showthread.php?t=281305
    * Aya Supay for making the code look great again
    * MasterMind420 for providing a fix to check for all kinds of ending checkpoint doors
    * Silvers for check for "end maps" & replacement for cooldown timer
    * Marttt for unethically adding support for l4d2 and timer to check tank and door checks
    * ZBzibing for additional testing on door detection problem
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_tank_announce_lock_door_v1.1.7.sp - 364 views - 7.9 KB)
    __________________

    Last edited by finishlast; 01-02-2022 at 10:43.
    finishlast is offline
    timonenluca
    Member
    Join Date: Apr 2020
    Location: Europe
    Old 04-22-2020 , 17:56   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #2

    Really usefull, Would love to see L4D2 support! So i can give it a try.
    timonenluca is offline
    Lider99
    Member
    Join Date: Mar 2020
    Old 05-10-2020 , 14:23   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #3

    Hello,
    such errors appeared
    Quote:
    L 05/10/2020 - 22:49:06: [SM] Exception reported: Entity 523 (523) is not a CBaseEntity
    L 05/10/2020 - 22:49:06: [SM] Blaming: door.smx
    L 05/10/2020 - 22:49:06: [SM] Call stack trace:
    L 05/10/2020 - 22:49:06: [SM] [0] AcceptEntityInput
    L 05/10/2020 - 22:49:06: [SM] [1] Line 116, plugin.sp::ControlDoor
    L 05/10/2020 - 22:49:06: [SM] [2] Line 77, plugin.sp::Event_PlayerSpawn
    L 05/10/2020 - 22:52:44: [SM] Exception reported: Entity 523 (523) is invalid
    L 05/10/2020 - 22:52:44: [SM] Blaming: door.smx
    L 05/10/2020 - 22:52:44: [SM] Call stack trace:
    L 05/10/2020 - 22:52:44: [SM] [0] FindDataMapInfo
    L 05/10/2020 - 22:52:44: [SM] [1] Line 523, include/entity.inc::HasEntProp
    L 05/10/2020 - 22:52:44: [SM] [2] Line 127, plugin.sp::ControlDoor
    L 05/10/2020 - 22:52:44: [SM] [3] Line 99, plugin.sp::Event_PlayerDeath
    L 05/10/2020 - 22:59:21: Error log file session closed.

    Last edited by Lider99; 05-10-2020 at 16:12.
    Lider99 is offline
    ZBzibing
    Senior Member
    Join Date: Dec 2012
    Old 06-01-2020 , 17:54   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #4

    Great, always looking for this feature!

    Is it possible to set the birthplace of tanks and witches
    ZBzibing is offline
    finishlast
    Senior Member
    Join Date: Nov 2018
    Location: In Reno with the vitamin
    Old 06-17-2020 , 05:55   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #5

    Quote:
    Originally Posted by Lider99 View Post
    Hello,
    such errors appeared
    Strange, unfortunatelly I am a total noob when it come to these kinds of entity errors.

    Is this happening on stock or custom campaigns?
    Or a particular map!?
    __________________

    Last edited by finishlast; 06-17-2020 at 06:00.
    finishlast is offline
    finishlast
    Senior Member
    Join Date: Nov 2018
    Location: In Reno with the vitamin
    Old 06-17-2020 , 06:00   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #6

    Quote:
    Originally Posted by ZBzibing View Post
    Great, always looking for this feature!

    Is it possible to set the birthplace of tanks and witches
    With Sourcemod everything is possible.
    There are a other plugins messing with tanks and witches.
    MB you can request a plugin where you can put individual spawn points and amounts an a per map cfg basis.

    That would be indeed cool to spawn tanks and witches on some unusual places.
    __________________
    finishlast is offline
    ZBzibing
    Senior Member
    Join Date: Dec 2012
    Old 01-15-2021 , 02:31   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #7

    Quote:
    Originally Posted by finishlast View Post
    With Sourcemod everything is possible.
    There are a other plugins messing with tanks and witches.
    MB you can request a plugin where you can put individual spawn points and amounts an a per map cfg basis.

    That would be indeed cool to spawn tanks and witches on some unusual places.

    My English is not good, I don't know how to ask
    ZBzibing is offline
    ZBzibing
    Senior Member
    Join Date: Dec 2012
    Old 04-26-2021 , 01:50   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #8

    Can you add a hint?
    When the tank appeared, the security door was locked. When the player tried to open the security door, a prompt message appeared
    ZBzibing is offline
    finishlast
    Senior Member
    Join Date: Nov 2018
    Location: In Reno with the vitamin
    Old 06-15-2021 , 11:45   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #9

    Haven't tested it, mabye replace the Event_PlayerDeath Event_PlayerSpawn and then hook the opendoor event.
    And then make a message.
    Not sure if this works, haven't tested it.
    PHP Code:
    public void Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast
    {
        
    int UserId event.GetInt("userid");
        if (
    UserId != 0) {
            
    int client GetClientOfUserId(UserId);
            if (
    client != 0) {
                if (
    IsTank(client) && !g_bIsTankAlive) {
                    
    g_bIsTankAlive true;
                    
    Command_Play("ui\\pickup_secret01.wav");
                    
    Command_Play("player\\tank\\voice\\yell\\hulk_yell_4.wav");
                    if(!
    IsFinaleMap()) {
                        
    ControlDoor(iCheckpointDoorLOCK);
                        
    PrintToChatAll("[SM] A Tank spawned. The safehouse is locked!");
                        
    HookEvent("door_open"Event_DoorOpen);
                    }
                    else {
                        
    PrintToChatAll("[SM] A Tank spawned!");
                    }
                }
            }
        }
    }

    public 
    void Event_PlayerDeath(Event hEvent, const char[] namebool DontBroadcast)
    {
        
    int client GetClientOfUserId(hEvent.GetInt("userid"));
        if (
    client && IsClientInGame(client)) {
            if (
    IsTank(client)) {
                
    int Tankcount 0
                   for (
    int i 1<= MaxClientsi++) 
                    if (
    IsClientConnected(i) && IsClientInGame(i) &&  IsPlayerAlive(i) && GetEntProp(iProp_Send"m_zombieClass") == 5Tankcount++; 
                if(
    Tankcount==0){
                    if(!
    IsFinaleMap()) {
                        
    PrintToChatAll("[SM] The Tank is dead! The safehouse is open!");
                        
    ControlDoor(iCheckpointDoorUNLOCK);
                    
    UnhookEvent("door_open"Event_DoorOpen);
                    }
                    else {
                    
    PrintToChatAll("[SM] The Tank is dead!");    
                    }
                    
    g_bIsTankAlive false;
                }
            }
        }
    }


    public 
    void Event_DoorOpen(Event event, const char[] namebool dontBroadcast)
    {
            
    int client GetClientOfUserId(event.GetInt("userid"));
            if( 
    client )
            {
                    if( 
    IsClientInGame(client) )
                    {
                        
    PrintCenterText(client"A Tank is alive, the door is locked!!!");

                    }
                }
            }

    __________________

    Last edited by finishlast; 06-15-2021 at 11:45.
    finishlast is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-22-2021 , 23:09   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
    Reply With Quote #10

    "IsClientConnected(i) && IsClientInGame(i)" - There's no need to check "IsClientConnected" because "IsClientInGame" already does that.

    If you want to support L4D2, the "m_zombieClass" for tank is 8 in L4D2 and 5 in L4D1. Suggest something like "g_iClassTank = g_bLeft4Dead2 ? 8 : 5;" in plugin start, then checking against that var.
    __________________

    Last edited by Silvers; 06-22-2021 at 23:10.
    Silvers 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 02:16.


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