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
Unlocking an elevator door
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#1
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
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
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
Find
rojkish Offline
Junior Member

Posts: 45
Threads: 0
Joined: Jun 2011
Reputation: 0
#3
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
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#4
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]Dubstep <3
07-18-2011, 04:51 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#5
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. Big Grin

07-18-2011, 05:08 PM
Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#6
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
Find




Users browsing this thread: 1 Guest(s)