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 Door Error
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#14
RE: [Help!]Key On Door Error

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Prisonkey_1", "prison_1", "keyondoor", true);
}
void keyondoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door", "prison_1", 0, false);
RemoveItem("Prisonkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

That should work for you. The errors were caused by
1) Inaccurate function names.

Example:
Setswingdoorlocked won't be read by the engine, as your capitalization was incorrect
SetSwingDoorLocked is the proper way of writing it.

2) Incorrect Callback

You had usedkeyondoor as your target callback, as definted by the AddUseItemCallback, but your function was named keyondoor. Therefore, the engine won't be able to find the function you called for, and what you want to happen simply won't.

10-05-2011, 07:41 PM
Find


Messages In This Thread
Key On Door Error - by jmayo - 10-05-2011, 06:43 PM
RE: [Help!]Key On Door Error - by Khyrpa - 10-05-2011, 06:48 PM
RE: [Help!]Key On Door Error - by Elven - 10-05-2011, 06:50 PM
RE: [Help!]Key On Door Error - by jmayo - 10-05-2011, 06:52 PM
RE: [Help!]Key On Door Error - by Your Computer - 10-05-2011, 07:03 PM
RE: [Help!]Key On Door Error - by jmayo - 10-05-2011, 07:20 PM
RE: [Help!]Key On Door Error - by Your Computer - 10-05-2011, 07:24 PM
RE: [Help!]Key On Door Error - by Elven - 10-05-2011, 07:01 PM
RE: [Help!]Key On Door Error - by Elven - 10-05-2011, 07:09 PM
RE: [Help!]Key On Door Error - by jmayo - 10-05-2011, 07:24 PM
RE: [Help!]Key On Door Error - by Elven - 10-05-2011, 07:28 PM
RE: [Help!]Key On Door Error - by jmayo - 10-05-2011, 07:30 PM
RE: [Help!]Key On Door Error - by Your Computer - 10-05-2011, 07:38 PM
RE: [Help!]Key On Door Error - by Obliviator27 - 10-05-2011, 07:41 PM
RE: [Help!]Key On Door Error - by jmayo - 10-05-2011, 07:47 PM
RE: Key On Door Error - by schmupper - 10-05-2011, 09:16 PM



Users browsing this thread: 1 Guest(s)