thx all.
I now found a way for ma problems.
But it doesnt work...
Maybe you can find a mistake.
I hope you understand the skripts.
I dont know if you have to understand what im looking for and how i built the map...
Here they are:
void OnStart()
{
for (int i = 0; i < 10; i++)
{
AddEntityCollideCallback("Player" , "ScriptArea_" + 0 + i , "InArea" , true , 1);
}
for (int i = 11; i < 20; i++)
{
AddEntityCollideCallback("Player" , "ScriptArea_" + i , "FadeOut1" , true , 1);
}
SetSanityDrainDisabled(true);
AddEntityCollideCallback("Player" , "activeslendy_1" , "Slender1" , true , 1);
}
bool IsInArea = false;
bool Slender_1active = false;
string LastArea = "00";
void Slender1 (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Slender_1", true);
Slender_1active = (alState == 1);
}
void InArea(string &in asParent, string &in asChild, int alState)
{
string areanumber1 = StringSub(asChild, 11, 2);
if (Slender_1active)
{
IsInArea = true;
LastArea = areanumber1;
AddTimer("Dead", 3, "Dead");
}
}
void Dead(string &in asParent, string &in asChild, int alState)
{
if(IsInArea == true)
{
FadeOut(0.5);
SetPlayerHealth(0);
}
}
void FadeOut1(string &in asParent, string &in asChild, int alState)
{
string areanumber2 = StringSub(asChild, 11, 2);
int i1, i2;
i2 = areanumber2[0] *10 + areanumber2[1]; //LastArea 2 als int
i1 = LastArea[0] *10 + LastArea[1]; //LastArea 1 als int
if(i1 == i2 - 10)
{
//FadeOut
IsInArea = false;
LastArea = areanumber2;
}
}
No one knows, how "I" goes.