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
[SOLVED] Restore sanity
naseem142 Offline
Member

Posts: 153
Threads: 19
Joined: Oct 2012
Reputation: 0
#9
RE: [Not solved , yet] Restore sanity

(10-12-2012, 12:57 PM)The chaser Wrote: You have three buttons, and every one adds 1 to the local variable. So, you have three, and you need 4. I suggest you to put:

void OnStart()

{

AddUseItemCallback("", "Key_3", "Prison_11", "KeyOnDoor11", true);

SetLocalVarInt("Var1", 0);

SetEntityPlayerInteractCallback("button1", "func1", true);

SetEntityPlayerInteractCallback("button2", "func2", true);

SetEntityPlayerInteractCallback("button3", "func3", true);

}



void KeyOnDoor11(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("Prison_11", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "Prison_11", 0.0f, true);

}



void func1(string &in asEntity)

{

AddLocalVarInt("Var1", 1);

func5();

}



void func2(string &in asEntity)

{

AddLocalVarInt("Var1", 1);

func5();

}



void func3(string &in asEntity)

{

AddLocalVarInt("Var1", 1);

func5();

}



void func4(string &in asEntity)

{

AddLocalVarInt("Var1", 1);

func5();

}



void func5()

{

if(GetLocalVarInt("Var1") == 3)

{

/////Here what happens when all buttons are clicked vvvvvvvvvvvvv

SetSwingDoorLocked("doorman", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "doorman", 0.5f, false);

AddPlayerSanity(5);

}

}
Lol , i took the tutorial from the wiki and i decided to make it only 3 buttons and forgot to set the if var to 3
*face palm*
Thanks for helping Rolleyes
10-12-2012, 01:10 PM
Website Find


Messages In This Thread
[SOLVED] Restore sanity - by naseem142 - 10-12-2012, 07:27 AM
RE: Restore sanity - by FlawlessHappiness - 10-12-2012, 08:01 AM
RE: Restore sanity - by Ongka - 10-12-2012, 09:05 AM
RE: Restore sanity - by FlawlessHappiness - 10-12-2012, 09:41 AM
RE: Restore sanity - by naseem142 - 10-12-2012, 10:23 AM
RE: Restore sanity - by FlawlessHappiness - 10-12-2012, 10:28 AM
RE: Restore sanity - by naseem142 - 10-12-2012, 10:29 AM
RE: [Not solved , yet] Restore sanity - by naseem142 - 10-12-2012, 01:10 PM
RE: [SOLVED] Restore sanity - by The chaser - 10-12-2012, 02:36 PM



Users browsing this thread: 2 Guest(s)