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
Machine Lever Problem...
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: Machine Lever Problem...

Do this:

void OnStart
{
SetLocalVarInt("Var1", 0);
SetEntityConnectionStateChangeCallback("L1", "lever_func1");
SetEntityConnectionStateChangeCallback("L2", "lever_func2");
SetEntityConnectionStateChangeCallback("L3", "lever_func3");
SetEntityConnectionStateChangeCallback("L4", "lever_func4");

SetEntityConnectionStateChangeCallback("L5", "lever_func5");
SetEntityConnectionStateChangeCallback("L6", "lever_func6");
}


void lever_func1(string &in asEntity, int alState)
{
if (alState == 1) //up
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void lever_func2(string &in asEntity, int alState)
{
if (alState == 1) //up
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void lever_func3(string &in asEntity, int alState)
{
if (alState == 1) //up
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void lever_func4(string &in asEntity, int alState)
{
if (alState == 1) //up
{
AddLocalVarInt("Var1", 1);
func01();
}
}


void lever_func5(string &in asEntity, int alState)
{
if (alState == 1) //up
{
AddLocalVarInt("Var1", 1);
func01();
}
}



void lever_func6(string &in asEntity, int alState)
{
if (alState == 1) //up
{
AddLocalVarInt("Var1", 1);
func01();
}
}

void func01()
{
if(GetLocalVarInt("Var1") == 6)
{
what you want to happen here
}
}

I'm not sure whether -1= drag up and 1 = drag down so test this before :3

12-06-2011, 03:49 AM
Find


Messages In This Thread
Machine Lever Problem... - by sasukeroxxx - 11-29-2011, 11:57 PM
RE: Machine Lever Problem... - by flamez3 - 11-30-2011, 01:56 AM
RE: Machine Lever Problem... - by GreyFox - 11-30-2011, 03:55 AM
RE: Machine Lever Problem... - by flamez3 - 11-30-2011, 04:44 AM
RE: Machine Lever Problem... - by sasukeroxxx - 12-05-2011, 08:48 PM
RE: Machine Lever Problem... - by flamez3 - 12-06-2011, 03:49 AM
RE: Machine Lever Problem... - by Your Computer - 12-06-2011, 04:29 AM
RE: Machine Lever Problem... - by sasukeroxxx - 12-07-2011, 04:42 AM



Users browsing this thread: 1 Guest(s)