Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prison section door close?
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#4
RE: Prison section door close?

Okay, I actually solved the problem in a really easy way, so never mind!

PHP Code: (Select All)
void OnStart()
{
AddUseItemCallback("", "padlock1", "prison_section_1", "UsePadlock1", false);
}

void UsePadlock1(string &in asItem, string &in asEntity)
{
    
SetSwingDoorClosed("prison_section_1", true, true);
    
SetEntityInteractionDisabled("prison_section_1", true);
    
RemoveItem(asItem);
    
AddTimer("1lock1", 0.25f, "TimerLock1");
    
AddTimer("1lock2", 1.0f, "TimerLock1");
}

void TimerLock1(string &in asTimer)
{
    if(
asTimer == "1lock1")
    {
        
AddPropForce("prison_section_1", 1000, 0, 0, "world");
    }
    if(
asTimer == "1lock2")
    {
        
SetSwingDoorLocked("prison_section_1", true, true);
        
PlaySoundAtEntity("", "lock_door", "prison_section_1", 0, false);
        
SetEntityInteractionDisabled("prison_section_1", false);
        
SetEntityActive("padlock_1", true);
    }
} 

Now when I use the padlock, the door will close, then the latch will close, and it locks with the padlock on it!

10-18-2012, 08:01 AM
Find


Messages In This Thread
Prison section door close? - by Damascus - 10-18-2012, 06:22 AM
RE: Prison section door close? - by The chaser - 10-18-2012, 06:44 AM
RE: Prison section door close? - by Damascus - 10-18-2012, 06:53 AM
RE: Prison section door close? - by Damascus - 10-18-2012, 08:01 AM



Users browsing this thread: 1 Guest(s)