Hello guys i needs some help on unlocking an elevator door
Heres the code i put in
in void onstart:
Code:
AddUseItemCallback("", "hollow_needle_1", "elevator_door", "unlock_elevator_door", true);
Below void onstart:
Code:
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
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);
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.
double check needle and door name twice before you try the code out.
I had the same problem but with a dagger.
(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, 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