OK, this is Jeff Walters swinging door cog which I've added a switch to
trouble is the door still opens when you press on the door itself. I dont really understand the GetSender ID reference. Any help would be great. Thanks.
Code:
# Jedi Knight Cog Script # # Swing_Sr.cog # # Generic Swinging Door Script, C/S version, Server side # # [JW] # # (C) 1998 Jeff Walters # # modified by SlingsRat. Added switch. symbols message activated message blocked message arrived message timer thing Door surface switch sound on_snd=set_hi2.wav local flex Time=4.0 flex AutoCloseDelay=0.0 int doorID int Rotating=0 local end ## Code Section code activated: if (Rotating) return; // Rotation already in progress Rotating = 1; if (GetSenderID() != 0) return; SetWallCel(switch, 1); PlaySoundPos(on_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0); SendTrigger(-1, 500000 + doorID, door, 1, Time, 0); return; blocked: Time = -Time; SendTrigger(-1, 500000 + doorID, door, 1, Time, 0); Return; delayed: if (Rotating) return; // Rotation already in progress Rotating = 1; SendTrigger(-1, 500000 + doorID, door, 1, Time, 0); return; arrived: if (!Rotating) return; // Rotation already finished SetWallCel(switch, 0); PlaySoundPos(on_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0); Time = -Time; // Negate time for invers rotation Rotating = 0; if (AutoCloseDelay > 0.0 && Time < 0) SetTimer(AutoCloseDelay); // Prepare delayed automatic closing return; timer: call delayed; // Delayed closing return; end
trouble is the door still opens when you press on the door itself. I dont really understand the GetSender ID reference. Any help would be great. Thanks.