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
Script Help Fatal Error on this script
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#3
RE: Fatal Error on this script

////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "BasementKey_1", "mansion_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "startkey", "cabinet_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("BasementKey_1");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cabinet_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cabinet_1", 0, false);
RemoveItem("startkey");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}



You put brackets around the green function but didn't use a header, this caused the error.
You can just put it in the voidOnStart().

Edit: Andy was a bit faster ^^

[Image: 18694.png]
(This post was last modified: 08-15-2012, 04:20 PM by Ongka.)
08-15-2012, 04:19 PM
Find


Messages In This Thread
Fatal Error on this script - by jtylerg - 08-15-2012, 04:07 PM
RE: Fatal Error on this script - by Adny - 08-15-2012, 04:19 PM
RE: Fatal Error on this script - by Ongka - 08-15-2012, 04:19 PM
RE: Fatal Error on this script - by jtylerg - 08-16-2012, 06:44 PM
RE: Fatal Error on this script - by Ongka - 08-16-2012, 07:00 PM
RE: Fatal Error on this script - by jtylerg - 08-16-2012, 08:44 PM
RE: Fatal Error on this script - by Adny - 08-16-2012, 07:16 PM



Users browsing this thread: 1 Guest(s)