It's actually pretty easy, put this in void OnLeave():
StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
Starts the end credits screen.
asMusic - the music to play (including .ogg)
abLoopMusic - determines whether the music should loop
asTextCat - the category to be used in the .lang file (must be “Ending”)
asTextEntry - the entry in the .lang file (must be “MainCredits”)
alEndNum - Amnesia has 3 different endings and displays a code
at the bottom. Determines which code is displayed. 0-2 will display
codes, any other integer will not.
So, you can do that or this:
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
Calls a function when the player interacts with a certain entity.
Callback syntax:
void MyFunc(string &in asEntity)
asName - internal name
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity
So, it could be this:
////Stuff
void OnLeave()
{
StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
}
Or this:
///Stuff
SetEntityPlayerInteractCallback("door", "LOL", true);
void LOL (string &in asEntity)
{
StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
}
And this is it. Hope it helps.