Well I think I know a way for how to do what I want to do. but I still need help look I have an lever I want it to open a hatch when you pull it like up and when you pull it down I want it to close again, but My code doesn't seem to work.
(I know my code is actually only for opening it)this is my code I hope you guys could help.
void OnStart()
{
InteractConnectPropWithMoveObject("wheeltodoor1", "wheelrust", "GateOpenClose", true, false, 0);
InteractConnectPropWithMoveObject("wheeltodoor1", "wheelrusttwo", "GateOpenClose", true, false, 0);
AddEntityCollideCallback("Player", "Gategoeslocked", "CloseGate", true, 1);
SetEntityPlayerInteractCallback("wheelrustthree", "rustwheel", false);
AddEntityCollideCallback("Lever", "Mount" , "LeverMount", true, 1);
SetEntityConnectionStateChangeCallback("LeverComplete", "leverfunc");
}
void CloseGate(string &in asParent, string &in asChild, int asEntity)
{
SetMoveObjectStateExt("GateOpenClose", 0, 8, 16, 0, false);
CreateParticleSystemAtEntity("", "ps_dust_elevator_crash.ps", "Dust_6", false);
SetEntityActive("wheelrusttwo", false);
SetEntityActive("wheelrustthree", true);
SetWheelInteractionDisablesStuck("wheelrusttwo", false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
GiveSanityDamage(10, true);
}
void rustwheel(string &in entity)
{
SetMessage("Messages", "DoorClosed", 0);
}
void LeverMount(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Lever" , false);
SetEntityActive("LeverComplete" , true);
SetEntityActive("Mount", false);
}
void leverfunc(string &in asEntity, int alState)
{
if (alState == 1)
SetSwingDoorLocked("hatch_drainage_1", false, true);
PlaySoundAtEntity("", "unlock_door", "hatch_drainage_1", 0, false);
}