void OnStart()
{
}
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
////////////////////////////
// Actual functions
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}
My bad, forgot the ";" after AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true).
This is also part of what you must learn to do.
Seek out the errors in your script.
Most of the the time, the error message you get, tells you where your error is, and what it's missing/wrong.
In your case, it should say something like: "Expected ";""