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

Solved Safe room L4D2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ricksfishin
Senior Member
Join Date: Oct 2017
Old 10-23-2020 , 11:55   Safe room L4D2
Reply With Quote #1

Need plugin or Something where tank can get through Safe room door at start of map, When it's closed
Thanks

Last edited by ricksfishin; 10-25-2020 at 22:37.
ricksfishin is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 10-23-2020 , 23:27   Re: Safe room L4D2
Reply With Quote #2

You can try this,

https://forums.alliedmods.net/showthread.php?p=2700212
__________________
Marttt is offline
ricksfishin
Senior Member
Join Date: Oct 2017
Old 10-24-2020 , 11:28   Re: Safe room L4D2
Reply With Quote #3

Thanks Marttt I am already using that plugin. wanting tank to break through saferoom door for players who might not open the door and just farm tanks. I only have tanks on my server maps'
ricksfishin is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 10-24-2020 , 13:14   Re: Safe room L4D2
Reply With Quote #4

You mean that the tanks spawns before the saferoom opens?
Well you might just take a look in the Silvers code and force the same behavior on player_spawn (maybe)
__________________
Marttt is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-24-2020 , 19:37   Re: Safe room L4D2
Reply With Quote #5

Now I have test much.

*edit
*edit
*edit
*edit
Updated code.

Checkpoint Exit Door will be forced to open after 30 seconds at round start.
- To get door open automatically, there should be bots or players in team survivor.

PHP Code:
#include <sdktools>

Handle TimerCheckpointDoor;
bool DoOnce;

public 
void OnPluginStart()
{
    
HookEventEx("round_freeze_end"round_freeze_end);
    
HookEventEx("player_first_spawn"player_first_spawn);
}


public 
void round_freeze_end(Event event, const char[] namebool dontBroadcast)
{
    
// when map start

    
DoOnce false;

    if(
TimerCheckpointDoor == null) return;

    
delete TimerCheckpointDoor;
}


public 
void player_first_spawn(Event event, const char[] namebool dontBroadcast)
{
    
// Timer already executed
    
if(DoOnce || TimerCheckpointDoor != null) return;


    
int client GetClientOfUserId(event.GetInt("userid"));
    
    
// Don't check unnecessary events. Only players in team survivor
    
if(client == || !IsClientInGame(client) || GetClientTeam(client) != 2) return;

    
char doorname[30];
    
int door = -1;


    
int entity = -1;
    
    while( (
entity FindEntityByClassname(entity"prop_door_rotating_checkpoint")) != -)
    {
        
//PrintToServer("m_hasUnlockSequence %i,   %i", GetEntProp(entity, Prop_Data, "m_hasUnlockSequence"), entity);
        
GetEntPropString(entityProp_Data"m_iName"doornamesizeof(doorname));
        
        if(
StrEqual(doorname"checkpoint_exit"false))
        {
            
// yes
            
door entity;
            break;
        }
        else if(
StrEqual(doorname"checkpoint_entrance"false))
        {
            
// skip
            
continue;
        }
        else if(
GetEntProp(entityProp_Data"m_hasUnlockSequence") == 1)
        {
            
// empty targetname ex. Look door m_hasUnlockSequence
            
door entity;
            break;
        }
    }


    if(
door == -1) return;


    
SetVariantString("OnOpen !self:Lock::0.1:1");
    
AcceptEntityInput(door"AddOutput");
    
    
SetVariantString("OnUser1 !self:playeropen::0.1:1");
    
AcceptEntityInput(door"AddOutput");

    
SetVariantString("OnUser1 !self:playeropen::1.0:1");
    
AcceptEntityInput(door"AddOutput");
    
    
PrintToChatAll("\x05[SM] \x04Checkpoint Exit Door \x05will be forced open in 30 seconds");

    
DoOnce true;
    
TimerCheckpointDoor CreateTimer(30.0OpenDoorEntIndexToEntRef(door));
}

public 
Action OpenDoor(Handle timerint ref)
{
    
TimerCheckpointDoor null;

    
int door EntRefToEntIndex(ref);

    if(
door != -1)
    {
        for(
int i 1<= MaxClientsi++)
        {
            if(!
IsClientInGame(i) || GetClientTeam(i) != 2) continue;

            
AcceptEntityInput(door"FireUser1"i);
            
PrintToChatAll("\x05[SM] \x04Checkpoint Exit Door \x05will be forced open!");
            break;
        }
    }

Attached Files
File Type: sp Get Plugin or Get Source (L4D2openCheckpointDoor.sp - 168 views - 2.4 KB)
__________________
Do not Private Message @me

Last edited by Bacardi; 10-25-2020 at 20:58. Reason: updated code, again
Bacardi is offline
ricksfishin
Senior Member
Join Date: Oct 2017
Old 10-25-2020 , 15:27   Re: Safe room L4D2
Reply With Quote #6

Bacardi compiled fine I did restart of server and made a few map changes But the door never opened.
ricksfishin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-25-2020 , 16:21   Re: Safe room L4D2
Reply With Quote #7

In which map ?
*edit
Ouh, I think it is event round_freeze_end. It works only mp_restartgame.

Last edited by Bacardi; 10-25-2020 at 16:38.
Bacardi is offline
ricksfishin
Senior Member
Join Date: Oct 2017
Old 10-25-2020 , 16:58   Re: Safe room L4D2
Reply With Quote #8

Sorry forgot all maps are finale maps. Tank only server Tried on c2m5_concert,c4m5_milltown_escape and c3m4_plantation
ricksfishin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-25-2020 , 21:01   Re: Safe room L4D2
Reply With Quote #9

Ok, good you tell those maps.

- c4m5_milltown_escape map didn't event trigger event player_entered_checkpoint until player step out room.
- some maps don't have targetname.
- and in my previous code, timer work too early. I changed to common, player_spawn event.

Try plugin again, from my previous post.

It should work.
__________________
Do not Private Message @me
Bacardi is offline
ricksfishin
Senior Member
Join Date: Oct 2017
Old 10-25-2020 , 22:43   Re: Safe room L4D2
Reply With Quote #10

Thank you Bacardi works great. If i may ask when you restart game mp_restartgame it doesn't work
And if possible could you change PrintToChatAll to PrintCenterText Exit door will be forced open in 30 seconds.Thanks
ricksfishin is offline
Reply



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 17:35.


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