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
Key On a Cabinet
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#1
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
Find Reply
SilentHideButFine Offline
Member

Posts: 156
Threads: 38
Joined: May 2012
Reputation: 6
#2
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!

[url= http://www.moddb.com/mods/jessehmusic [/url] ,HOSPITAL OF HORROR MOD
07-21-2012, 02:57 AM
Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
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
Find Reply
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#4
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
Find Reply
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#5
RE: Key On a Cabinet

ah thank you andy, always helpful!
07-21-2012, 07:01 AM
Find Reply




Users browsing this thread: 1 Guest(s)