| 
		
	
		| TheIcyPickle   Member
 
 Posts: 80
 Threads: 16
 Joined: Feb 2011
 Reputation: 
0
 | 
			| Key On a Cabinet 
 
				Ok, so quick question
 what would I use to make a key on a closet door unlock it
 
 
 Like
 
 would this work
 
 void OnStart()
 
 {
 AddUseItemCallback("", "key1", "door1", "KeyOnDoor", true);
 
 }
 
 
 void KeyOnDoor(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("door1", false, true);
 PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
 RemoveItem("key1");
 }
 
 
 but for a closet door? I dont know what function you would use..
 |  |  
	| 07-21-2012, 02:19 AM |  |  
	
		| SilentHideButFine   Member
 
 Posts: 156
 Threads: 38
 Joined: May 2012
 Reputation: 
6
 | 
			| RE: Key On a Cabinet 
 
				void OnStart()
 {
 AddUseItemCallback("", "Thekey", "TheDoor", "Thefunc", true);
 }
 
 
 void Thefunc(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("TheDoor", false, true);
 PlaySoundAtEntity("", "unlock_door", "TheDoor", 0, false);
 RemoveItem("Thekey");
 }
 
 try that!
 
 |  |  
	| 07-21-2012, 02:57 AM |  |  
	
		| Adny   Posting Freak
 
 Posts: 1,766
 Threads: 6
 Joined: Mar 2012
 Reputation: 
173
 | 
			| RE: Key On a Cabinet 
 
				Doors, closets, and that desk with the swing door on the right hand side all use the same functions. Setswingdoorlocked will work properly on all of them.
			 
 I rate it 3 memes. |  |  
	| 07-21-2012, 03:08 AM |  |  
	
		| TheIcyPickle   Member
 
 Posts: 80
 Threads: 16
 Joined: Feb 2011
 Reputation: 
0
 | 
			| RE: Key On a Cabinet 
 
				right, but what function would that be? 
 hmm. I see what you mean, I've done level doors and regular doors no problem, but a closet door... Im not sure on.
 |  |  
	| 07-21-2012, 03:11 AM |  |  
	
		| TheIcyPickle   Member
 
 Posts: 80
 Threads: 16
 Joined: Feb 2011
 Reputation: 
0
 | 
			| RE: Key On a Cabinet 
 
				ah thank you andy, always helpful!
			 |  |  
	| 07-21-2012, 07:01 AM |  |  |