View Single Post
Author Message
SephirothSG
SourceMod Donor
Join Date: Jun 2013
Old 01-11-2014 , 02:30   [TF2] Forcing doors open/removing them entirely?
Reply With Quote #1

So I've been struggling to get this to work how I want it, I originally tried the following
PHP Code:
{
        if (
g_bOpenDoors)
        {
                new 
ent MAXPLAYERS+1;
                while((
ent FindEntityByClassname(ent"func_door"))!=-1
                {
                        if (
IsValidEdict(ent))
                        {
                                
AcceptEntityInput(ent"unlock", -1);
                                
AcceptEntityInput(ent"open", -1);
                        }
                }
                
                
ent MAXPLAYERS+1;
                while((
ent FindEntityByClassname(ent"prop_dynamic"))!=-1
                {
                        if (
IsValidEdict(ent))
                        {
                                new 
String:tName[64];
                                
GetEntPropString(entProp_Data"m_iName"tNamesizeof(tName));
                                if ((
StrContains(tName,"door",false)!=-1) || (StrContains(tName,"gate",false)!=-1))
                                {
                                        
AcceptEntityInput(ent"unlock", -1);
                                        
AcceptEntityInput(ent"open", -1);
                                }
                        }
                }
        }

While this appears to work, the doors close if a player walks through the trigger that is meant to open the door.

I then attempted to use Stripper:Source to simply remove all func_doors, while this does remove the doors it also leaves the texture of the doors there (This causes no issues as you can just pass straight through them, however it confuses players), I figured the following in Stripper would remove those annoying textures however it did not
PHP Code:
modify:
{
    
match:
    {
    
"model" "models/props_gameplay/door_slide_large_door.mdl"
    "classname" "prop_dynamic"
    
}
    
delete:
    {
    
"model" "models/props_gameplay/door_slide_large_door.mdl"
    
}

Am I missing something extremely obvious here?

Last edited by SephirothSG; 01-11-2014 at 02:57.
SephirothSG is offline