| 
		
	
		| TheDavenia   Member
 
 Posts: 223
 Threads: 38
 Joined: Jun 2011
 Reputation: 
0
 | 
			| Unlocking an elevator door 
 
				Hello guys i needs some help on unlocking an elevator door 
Heres the code i put in
 
in void onstart:
 AddUseItemCallback("", "hollow_needle_1", "elevator_door", "unlock_elevator_door", true);
Below void onstart:
 void unlock_elevator_door(string &in asItem, string &in asEntity){
 SetSwingDoorLocked("elevator_door", false, true);
 PlaySoundAtEntity("", "unlock_door", "elevator_door", 0, false);
 }
And when i use my hollow needle on the elevator door ingame it says cant use this item this way!
 
Please help! 
Thanks, 
TheDavenia 
			
 Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
 
				
(This post was last modified: 07-18-2011, 03:36 PM by TheDavenia.)
 |  |  
	| 07-18-2011, 03:36 PM |  |  
	
		| Kyle   Posting Freak
 
 Posts: 911
 Threads: 36
 Joined: Sep 2010
 Reputation: 
7
 | 
			| RE: Unlocking an elevator door 
 
				Are you sure that you are using "hollow_needle_1" to unlock the elevator door? If you have a different one, then that's why.
 You are also forgetting the .snt on the unlock_door sound file.
 
 PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);
 
 |  |  
	| 07-18-2011, 03:49 PM |  |  
	
		| rojkish   Junior Member
 
 Posts: 45
 Threads: 0
 Joined: Jun 2011
 Reputation: 
0
 | 
			| RE: Unlocking an elevator door 
 
				Does it really work unlocking the elevator doors? I've never really tried.. ^_^  (07-18-2011, 03:49 PM)Kyle Wrote:  You are also forgetting the .snt on the unlock_door sound file.PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);
 
PlaySoundAtEntity doesnt require you to write the extension (snt in this case), it works either way.
			 |  |  
	| 07-18-2011, 04:13 PM |  |  
	
		| xtron   Senior Member
 
 Posts: 402
 Threads: 37
 Joined: May 2011
 Reputation: 
2
 | 
			| RE: Unlocking an elevator door 
 
				double check needle and door name twice before you try the code out.I had the same problem but with a dagger.
 
 ![[Image: 44917299.jpg]](http://img204.imageshack.us/img204/520/44917299.jpg) Dubstep <3 |  |  
	| 07-18-2011, 04:51 PM |  |  
	
		| Kyle   Posting Freak
 
 Posts: 911
 Threads: 36
 Joined: Sep 2010
 Reputation: 
7
 | 
			| RE: Unlocking an elevator door 
 
				 (07-18-2011, 04:13 PM)rojkish Wrote:  Does it really work unlocking the elevator doors? I've never really tried.. ^_^
 
  (07-18-2011, 03:49 PM)Kyle Wrote:  You are also forgetting the .snt on the unlock_door sound file.PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);
 PlaySoundAtEntity doesnt require you to write the extension (snt in this case), it works either way.
 
Wow, I didn't know that. Thanks for telling me.    
 |  |  
	| 07-18-2011, 05:08 PM |  |  
	
		| TheDavenia   Member
 
 Posts: 223
 Threads: 38
 Joined: Jun 2011
 Reputation: 
0
 | 
			| RE: Unlocking an elevator door 
 
				 (07-18-2011, 03:49 PM)Kyle Wrote:  Are you sure that you are using "hollow_needle_1" to unlock the elevator door? If you have a different one, then that's why.
 You are also forgetting the .snt on the unlock_door sound file.
 
 PlaySoundAtEntity("", "unlock_door.snt", "elevator_door", 0, false);
 
I'm sure since i copy and pasted the code of the cabinet and changed the name into the elevator door's name and its the same needle that you keep
			 
 Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
 |  |  
	| 07-18-2011, 05:22 PM |  |  |