Frictional Games Forum (read-only)
Problem with levels & localvarint - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Problem with levels & localvarint (/thread-15933.html)



Problem with levels & localvarint - Paulpolska - 06-07-2012

Where I must put "{" and "}" to this code will work ? I have SetLocalVarInt etc.
Quote: void Dinamite(string &in asEntity, int alState)
{
if(GetLocalVarInt("Button") == 1)
if (alState == 1)
SetMessage("Messages", "Run", 3);
else if(GetLocalVarInt("Button") == 0)
if (alState == 1)
SetMessage("Messages", "test", 0);
AddQuest("button", "button");

}

Ok Problem is finished. Work code are

Quote:void Dinamite(string &in asEntity, int alState)
{
if(GetLocalVarInt("Button") == 1)
{
if (alState == 1)
SetMessage("Messages", "Run", 3);
GiveSanityDamage(10,true);
SetLocalVarInt("Button", 2);
return;
}
else if(GetLocalVarInt("Button") == 0)
{
if (alState == 1)
SetMessage("Messages", "test", 0);
AddQuest("button", "button");
}

}