(02-01-2011, 12:06 AM)Vradcly Wrote: Ill let you know if i do anything similar, but right now I cant help you...
I just figured it out how to do it. I copied it somewhere else. Here's the script:
void InteractBridgeLever1(string &in asEntity, int alState)
{
if(alState == 0) return;
string sBridge = asEntity=="" ? "" : "bridge_metal_vert_1";
if(alState == -1)
{
if(GetLocalVarInt(asEntity) == -1) return; //Fix behaviour error if pulling lever double direction.
SetMoveObjectState(sBridge, 2.66);
PlaySoundAtEntity("soundclank_"+sBridge, "14_elevator_clank", "Player", 0.5f, false);
StartScreenShake(0.05f, 0.5f, 0.2f, 0.6f);
}
SetLeverStuckState(asEntity, alState, true);
AddDebugMessage(asEntity + " State: "+alState, true);
}
void OnStart()
{
You have to fill InteractBridgeLever1 in the levers ConnectStateChangeCallback