gmod e2 wait command @name MAD (Multi Auto Door) @inputs @outputs Fade1 Fade2 Fade3 Fade4 @persist Player:entity [A T Allowed Commands Doors LT Timers Channels State ChID]:table I C Busy Fade Channel:string Buffer Door_Delay PlaySound @trigger # Hell Fire # Fusion Multi Door - by Hell Fire V1.5 # 1.3 - fixed indexed functions # 1.4 - Changed find player method # 1.5 - Added command "#remove " gmod e2 wait command PasteShr gmod e2 wait command interval(100) if(first()|duped()) { # Editable variables # Close_Delay = 1 # Delay time in seconds PlaySound = 0 # change to 1 to play sounds gmod e2 wait command PasteShr gmod e2 wait command # Do not edit anything below this line unless you know what your doing. runOnChat(1) Search_status = 1 T = table() findExcludeClass("*") findIncludeClass("prop_physics") findInSphere(owner():pos(),5000) gmod e2 wait command How to get it? gmod e2 wait command A = findToTable() print("Please wait while I look for your fading door(s).") Allowed[owner():toString(),string] = owner():steamID() Commands["#add",string] = "addPlayer" Commands["#remove",string] = "removePlayer" Commands["#clear",string] = "clearList" Channels = table(0,0,0,0) ## 4 Channels ## Closes a door and disconnects. function void rmWire(Args:string) { gmod e2 wait command How to get it? gmod e2 wait command if(Args == "Fade1") { Fade1 = 0 } elseif(Args == "Fade2") { Fade2 = 0 } elseif(Args == "Fade3") { Fade3 = 0 } elseif(Args == "Fade4") { gmod e2 wait command PasteShr gmod e2 wait command Fade4 = 0 } T[I,entity]:deleteWire("Fade") } # connects then opens a door. function void broadcast(Args:string) { T[I,entity]:createWire(entity(),"Fade",Args) if(Args == "Fade1") { Fade1 = 1 } gmod e2 wait command How to dowload it? gmod e2 wait command elseif(Args == "Fade2") { Fade2 = 1 } elseif(Args == "Fade3") { Fade3 = 1 } elseif(Args == "Fade4") { Fade4 = 1 } } gmod e2 wait command How to use it? gmod e2 wait command # Indexed Said Functions function number isAllowed(Ply:entity) { if(Allowed:exists(Ply:toString())) { return 1 } return 0 } function void addPlayer(Args:string) { gmod e2 wait command PasteShr gmod e2 wait command Player = findPlayerByName(Args) if(!isAllowed(Player)&Player:isPlayer()) { Allowed[Player:toString(),string] = Player:steamID() print(Player:name()+" has been added!") } } function void removePlayer(Args:string) { Player = findPlayerByName(Args) if(Allowed:exists(Player:toString())&Player:isPlayer()) gmod e2 wait command How to use it? gmod e2 wait command { Allowed:remove(Player:toString()) print(Player:name() + " was removed!") } } function void clearList(Args:string) { Allowed = table() Allowed[owner():toString(),string] = owner():steamID() print("White list has been cleared!") gmod e2 wait command How to get it? gmod e2 wait command } } if(Search_status) { ## Search for doors first then begin main script. I++ if(A[I,entity]:getWireInputs():concat():find("Fade")) { C++ T[C,entity] = A[I,entity] Doors[C,string] = "standby" gmod e2 wait command PasteShr gmod e2 wait command } if(I>=A:count()) { Search_status = 0 I = 0 print(C+" Door(s) found.") } } # main script. else { gmod e2 wait command How to dowload it? gmod e2 wait command I++ findExcludeClass("prop_physics") findIncludeClass("player") findInSphere(T[I,entity]:pos(),50) # here we check each door for a nearby player. Player = find() if(LT[I,number]<= curtime()&Doors[I,string]!="standby") { rmWire(Doors[I,string]) Doors[I,string] = "standby" gmod e2 wait command How to get it for free? gmod e2 wait command Channels[ChID[I,number],number] = 0 soundPurge() } if(isAllowed(Player)) { ##Check door state. if(Doors[I,string]=="standby") { for(I=1,Channels:count()) { if(!Channels[I,number]) { gmod e2 wait command PasteShr gmod e2 wait command Channels[I,number] = 1 ID = I Channel = "Fade"+I:toString() break } } if(PlaySound) { T[I,entity]:soundPlay(Channel,0,"buttons/bell1.wav") } ChID[I,number] = ID LT[I,number] = curtime()+Close_Delay Doors[I,string] = Channel gmod e2 wait command How to use it? gmod e2 wait command broadcast(Channel) # open da door State["LT",table] = LT } } if(I>=T:count()) { I = 0 } if(chatClk(owner())) { gmod e2 wait command How to get it? gmod e2 wait command Str = owner():lastSaid():lower():explode(" ") if(Commands:exists(Str[1,string])) { hideChat(1) Commands[Str[1,string],string](Str[2,string]) } } } gmod e2 wait command