AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02) (https://forums.alliedmods.net/showthread.php?t=321892)

finishlast 03-05-2020 14:11

[L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02)
 
1 Attachment(s)
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

timonenluca 04-22-2020 17:56

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
Really usefull, Would love to see L4D2 support! So i can give it a try.

Lider99 05-10-2020 14:23

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
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.

ZBzibing 06-01-2020 17:54

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
Great, always looking for this feature!

Is it possible to set the birthplace of tanks and witches

finishlast 06-17-2020 05:55

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
Quote:

Originally Posted by Lider99 (Post 2699296)
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!?

finishlast 06-17-2020 06:00

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
Quote:

Originally Posted by ZBzibing (Post 2703560)
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.

ZBzibing 01-15-2021 02:31

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
Quote:

Originally Posted by finishlast (Post 2706151)
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 04-26-2021 01:50

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
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

finishlast 06-15-2021 11:45

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
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!!!");

                }
            }
        }



Silvers 06-22-2021 23:09

Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
 
"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.


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

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