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

Checkpoint door closed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Beatles
Senior Member
Join Date: Feb 2014
Old 08-16-2018 , 05:15   Checkpoint door closed
Reply With Quote #1

Someone can help me with the syntax to find the closed shelter door at the end of each chapter.

As you know, the doors of the shelter are always open, but I want them to be closed.
Beatles is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-16-2018 , 15:43   Re: Checkpoint door closed
Reply With Quote #2

What game?

Edit: Based on your pic, I'd say Left 4 Dead 1/2.


Take a look at how I check for it in my Anti-Speedrunner System.

You can also check out Anti-Runner System, Trap of Door Lock, and Lockdown System. They all close the ending Saferoom doors.
__________________

Last edited by Psyk0tik; 08-16-2018 at 15:46.
Psyk0tik is offline
Uncle Jessie
Member
Join Date: May 2016
Location: Mind Prison
Old 08-17-2018 , 05:33   Re: Checkpoint door closed
Reply With Quote #3

Code:
#define SAFEDOOR_MODEL_02 "models/props_doors/checkpoint_door_02.mdl"
#define SAFEDOOR_MODEL_04 "models/props_doors/checkpoint_door_-02.mdl"
#define SAFEDOOR_CLASS_01 "prop_door_rotating_checkpoint"

new ent_safedoor;
new ent_safedoor_check;

public OnPluginStart()
{
	HookEvent("round_start", Event_RoundStart);
}

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	CreateTimer(1.5, CheckDelay);
}

public Action:CheckDelay(Handle:timer)
{
	CheckSafeRoomDoor();
}

CheckSafeRoomDoor()
{
	ent_safedoor_check = -1;
	while ((ent_safedoor_check = FindEntityByClassname(ent_safedoor_check, SAFEDOOR_CLASS_01)) != -1)
	if (ent_safedoor_check > 0)
	{
		new spawn_flags;
		decl String:model[255];
		GetEntPropString(ent_safedoor_check, Prop_Data, "m_ModelName", model, sizeof(model));
		spawn_flags = GetEntProp(ent_safedoor_check, Prop_Data, "m_spawnflags");

		if (((strcmp(model, SAFEDOOR_MODEL_02) == 0) && ((spawn_flags == 8193) || (spawn_flags == 0))) || ((strcmp(model, SAFEDOOR_MODEL_04) == 0) && ((spawn_flags == 8193) || (spawn_flags == 0))))
		{
			ent_safedoor = ent_safedoor_check;
		}
	}
}
Something like this i use for this
Uncle Jessie is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-17-2018 , 17:38   Re: Checkpoint door closed
Reply With Quote #4

Quote:
Originally Posted by Crasher_3637 View Post
What game?

Edit: Based on your pic, I'd say Left 4 Dead 1/2.


Take a look at how I check for it in my Anti-Speedrunner System.

You can also check out Anti-Runner System, Trap of Door Lock, and Lockdown System. They all close the ending Saferoom doors.
It's for l4d1

I have already used:

PHP Code:
AcceptEntityInput(Entity"Close");
AcceptEntityInput(Entity"Lock");
AcceptEntityInput(Entity"ForceClosed"); 
It does what I need, but once I open the shelter, in just a couple of seconds it is closing itself, or sometimes it has not opened even half and closed again.

Last edited by Beatles; 08-17-2018 at 17:45.
Beatles is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-17-2018 , 17:44   Re: Checkpoint door closed
Reply With Quote #5

Quote:
Originally Posted by Uncle Jessie View Post
Code:
#define SAFEDOOR_MODEL_02 "models/props_doors/checkpoint_door_02.mdl"
#define SAFEDOOR_MODEL_04 "models/props_doors/checkpoint_door_-02.mdl"
#define SAFEDOOR_CLASS_01 "prop_door_rotating_checkpoint"

new ent_safedoor;
new ent_safedoor_check;

public OnPluginStart()
{
	HookEvent("round_start", Event_RoundStart);
}

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	CreateTimer(1.5, CheckDelay);
}

public Action:CheckDelay(Handle:timer)
{
	CheckSafeRoomDoor();
}

CheckSafeRoomDoor()
{
	ent_safedoor_check = -1;
	while ((ent_safedoor_check = FindEntityByClassname(ent_safedoor_check, SAFEDOOR_CLASS_01)) != -1)
	if (ent_safedoor_check > 0)
	{
		new spawn_flags;
		decl String:model[255];
		GetEntPropString(ent_safedoor_check, Prop_Data, "m_ModelName", model, sizeof(model));
		spawn_flags = GetEntProp(ent_safedoor_check, Prop_Data, "m_spawnflags");

		if (((strcmp(model, SAFEDOOR_MODEL_02) == 0) && ((spawn_flags == 8193) || (spawn_flags == 0))) || ((strcmp(model, SAFEDOOR_MODEL_04) == 0) && ((spawn_flags == 8193) || (spawn_flags == 0))))
		{
			ent_safedoor = ent_safedoor_check;
		}
	}
}
Something like this i use for this
Excellent video but I only want that when arriving at the refuge, the checkpoint is always closed

Last edited by Beatles; 08-17-2018 at 17:47.
Beatles is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-17-2018 , 18:10   Re: Checkpoint door closed
Reply With Quote #6

Show us your code so we can assist you.
__________________
Psyk0tik is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-18-2018 , 02:24   Re: Checkpoint door closed
Reply With Quote #7

Quote:
Originally Posted by Crasher_3637 View Post
Show us your code so we can assist you.
PHP Code:
    int iCheckpointEnt = - 1
    while ((
iCheckpointEnt FindEntityByClassname(iCheckpointEnt"prop_door_rotating_checkpoint")) != INVALID_ENT_REFERENCE
    { 
        
AcceptEntityInput(iCheckpointEnt"Close");
        
AcceptEntityInput(iCheckpointEnt"Lock");
        
AcceptEntityInput(iCheckpointEnt"ForceClosed");
    } 

Last edited by Beatles; 08-18-2018 at 02:26.
Beatles is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-18-2018 , 02:27   Re: Checkpoint door closed
Reply With Quote #8

Quote:
Originally Posted by Beatles View Post
PHP Code:
    int iCheckpointEnt = - 1
    while ((
iCheckpointEnt FindEntityByClassname(iCheckpointEnt"prop_door_rotating_checkpoint")) != INVALID_ENT_REFERENCE
    { 
        
AcceptEntityInput(iCheckpointEnt"Close");
        
AcceptEntityInput(iCheckpointEnt"Lock");
        
AcceptEntityInput(iCheckpointEnt"ForceClosed");
    } 
We need the full code. You must not be unlocking the door properly in your code or you added a function that keeps it closed.
__________________
Psyk0tik is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 08-18-2018 , 03:04   Re: Checkpoint door closed
Reply With Quote #9

Quote:
Originally Posted by Crasher_3637 View Post
We need the full code. You must not be unlocking the door properly in your code or you added a function that keeps it closed.
It's just this

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_use"OnPlayerUse);
}

public 
Action:OnPlayerUse(Handle:event, const String:name[], bool:dontBroadcast)
{
    
int iCheckpointEnt = - 1;  
    while ((
iCheckpointEnt FindEntityByClassname(iCheckpointEnt"prop_door_rotating_checkpoint")) != INVALID_ENT_REFERENCE)  
    {  
        
AcceptEntityInput(iCheckpointEnt"Close"); 
        
AcceptEntityInput(iCheckpointEnt"Lock"); 
        
AcceptEntityInput(iCheckpointEnt"ForceClosed"); 
    } 

Beatles is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-18-2018 , 03:11   Re: Checkpoint door closed
Reply With Quote #10

No wonder it's locking the door... The player_use event is fired multiple times in a second and when you touch the door, your code is telling the door to close and lock. You need to lock the door some other way and unlock it inside player_use.

Like I said, refer to the plugins I mentioned.
__________________
Psyk0tik 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 11:29.


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