Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnStart()
- {
- AddEntityCollideCallback("Player", "AreaDoor", "EventDoor", true, 1);
- }
- void EventDoor(string &in asParent, string &in asChild, int alState)
- {
- SetSwingDoorClosed("Door", false, false);
- SetSwingDoorDisableAutoClose("Door", true);
- PlaySoundAtEntity("creak", "joint_door_move_special.snt", "Door", 1, false);
- AddTimer("", 2, "TimerStopSound");
- AddTimer("Door", 0, "TimerMoveDoor");
- }
- void TimerMoveDoor(string &in asTimer)
- {
- if(GetLocalVarInt("VarDoor") == 10) return;
- AddLocalVarInt("VarDoor", 1);
- AddTimer(asTimer, 0.03, "TimerMoveDoor");
- AddPropForce(asTimer, -70, 0, 0, "world");
- }
- void TimerStopSound(string &in asTimer)
- {
- StopSound("creak", 0.4);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement