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
How to make a make a door that need two keys to unlock it?
Raymond Offline
Member

Posts: 126
Threads: 24
Joined: Feb 2011
Reputation: 0
#16
RE: How to make a make a door that need two keys to unlock it?

void OnStart()
{
AddUseItemCallback("UseKey1", "prisonkeylight_1", "mansion_3", "KeyCounter", true);
SetLocalVarInt("KeysUsed", 0);
AddUseItemCallback("UseKey2", "prisonkeydark_1", "mansion_3", "KeyCounter", true);
}

void KeyCounter(string &in asItem, string &in asEntity)
{
SetLocalVarInt("KeysUsed", GetLocalVarInt("KeysUsed")+1);
if(GetLocalVarInt("KeysUsed")==2)
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
}

The error changed, now it says "a function with a same name and parameters already exist", did i put something wrong?

One World To Another [DEMO] coming soon.
(This post was last modified: 03-14-2011, 06:13 AM by Raymond.)
03-14-2011, 04:05 AM
Find


Messages In This Thread
RE: How to make a make a door that need two keys to unlock it? - by Raymond - 03-14-2011, 04:05 AM



Users browsing this thread: 1 Guest(s)