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

help me plugin to Force open all doors start round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vadia111
Senior Member
Join Date: Dec 2013
Old 06-19-2017 , 09:04   help me plugin to Force open all doors start round
Reply With Quote #1

Need plugin to --> force open all doors at the start of the round


is possible ??
vadia111 is offline
fiction
Member
Join Date: May 2017
Old 06-19-2017 , 11:44   Re: help me plugin to Force open all doors start round
Reply With Quote #2

Something like this https://forums.alliedmods.net/showpo...95&postcount=2

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

char g_sEntities[][] = {"func_door""func_movelinear"};

public 
void OnMapStart()
{
    
HookEvent("round_start"OnRoundStart);
}

public 
Action OnRoundStart(Event event, const char[] namebool dontBroadcast)
{
    
int iEnt;

    for(
int i 0sizeof(g_sEntities); i++)
        while((
iEnt FindEntityByClassname(iEntg_sEntities[i])) != -1)
            
AcceptEntityInput(iEnt"Open");

    return 
Plugin_Continue;


Last edited by fiction; 06-19-2017 at 13:06.
fiction is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 06-19-2017 , 13:03   Re: help me plugin to Force open all doors start round
Reply With Quote #3

Pretty sure it's func_movelinear, not "func_movinglinear"
__________________
sneaK is offline
fiction
Member
Join Date: May 2017
Old 06-19-2017 , 13:06   Re: help me plugin to Force open all doors start round
Reply With Quote #4

Quote:
Originally Posted by sneaK View Post
Pretty sure it's func_movelinear, not "func_movinglinear"
Good point, thanks.
fiction is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 06-19-2017 , 13:10   Re: help me plugin to Force open all doors start round
Reply With Quote #5

Or you can use this https://forums.alliedmods.net/showthread.php?p=2306018

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <smartjaildoors>

public void OnMapStart()
{
    
HookEvent("round_start"OnRoundStart);
}

public 
Action OnRoundStart(Event event, const char[] namebool dontBroadcast)
{
    
SJD_OpenDoors(); 

    return 
Plugin_Continue;

__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
vadia111
Senior Member
Join Date: Dec 2013
Old 06-20-2017 , 15:37   Re: help me plugin to Force open all doors start round
Reply With Quote #6

#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

new iEnt;
new const String:EntityList[][] = { "func_door", "func_movinglinear" };

public OnPluginStart()
{
RegConsoleCmd("sm_open", OnOpenCommand);
RegConsoleCmd("sm_close", OnCloseCommand);
}

public Action:OnOpenCommand(client, args)
{
for(new i = 0; i < sizeof(EntityList); i++)
while((iEnt = FindEntityByClassname(iEnt, EntityList[i])) != -1)
AcceptEntityInput(iEnt, "Open");

return Plugin_Handled;
}

public Action:OnCloseCommand(client, args)
{
for(new i = 0; i < sizeof(EntityList); i++)
while((iEnt = FindEntityByClassname(iEnt, EntityList[i])) != -1)
AcceptEntityInput(iEnt, "Close");

return Plugin_Handled;
}






-------------------------------------------------------------------------------------------------------------

It works .... But I need it to keep the doors open (forever)
vadia111 is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 06-20-2017 , 21:38   Re: help me plugin to Force open all doors start round
Reply With Quote #7

How about this ? I added a timer for keeping doors open.
PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

new const String:EntityList[][] = { "func_door""func_movinglinear" };
new 
Handle:KeepDoorsOpen INVALID_HANDLE;

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_open"OnOpenCommand);
    
RegConsoleCmd("sm_close"OnCloseCommand);
}

public 
Action:OnOpenCommand(clientargs)
{
    
MakeDoors("Open");
    
    if(
KeepDoorsOpen == INVALID_HANDLE)
    {
        
KeepDoorsOpen CreateTimer(5.0OpenDoors_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
    }
    
    return 
Plugin_Handled;
}

public 
Action:OnCloseCommand(clientargs)
{
    
KillTimer(KeepDoorsOpen);
    
KeepDoorsOpen INVALID_HANDLE;
    
MakeDoors("Close");
    return 
Plugin_Handled;



public 
MakeDoors(String:input[7])
{
    for(new 
0sizeof(EntityList); i++)
    {
        new 
iEnt = -1;
        while((
iEnt FindEntityByClassname(iEntEntityList[i])) != -1)
            
AcceptEntityInput(iEntinput);
    }
}

public 
Action:OpenDoors(Handle:timer)
{
    
MakeDoors("Open");

WatchDogs is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 06-21-2017 , 01:06   Re: help me plugin to Force open all doors start round
Reply With Quote #8

Most doors can be locked once closed or opened so after all doors are open lock them so no player can close them

PHP Code:
 AcceptEntityInput(iEnt"Lock"); 
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux 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 07:54.


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