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
Help with script for "3 levers to unlock a door"
FlaW Offline
Junior Member

Posts: 48
Threads: 9
Joined: Nov 2011
Reputation: 0
#2
RE: Help with script for "3 levers to unlock a door"

Try this:
{
SetLocalVarInt("Var1", 0);


SetEntityConnectionStateChangeCallback("lever1", "func_lever_1");
SetEntityConnectionStateChangeCallback("lever2", "func_lever_2");
SetEntityConnectionStateChangeCallback("lever3", "func_lever_3");
}


void func_lever_1(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func01();
SetLeverStuckState("lever1", 1, true);
}
}

void func_lever_2(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func01();
SetLeverStuckState("lever2", 1, true);
}
}

void func_lever_3(string &in asEntity, int alState)
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func01();
SetLeverStuckState("lever3", 1, true);
}

void func01()
{
if(GetLocalVarInt("Var1") == 3)
{
your functions
}
}
(This post was last modified: 01-29-2012, 03:38 PM by FlaW.)
01-29-2012, 03:37 PM
Find


Messages In This Thread
RE: Help with script for "3 levers to unlock a door" - by FlaW - 01-29-2012, 03:37 PM



Users browsing this thread: 1 Guest(s)