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
#7
RE: Restore sanity

(10-12-2012, 10:28 AM)beecake Wrote: Did the sound play? Because if it didn't then there is something wrong with the script not with AddPlayerSanity(5); Show the whole script

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") == 4)
{
/////Here what happens when all buttons are clicked vvvvvvvvvvvvv
SetSwingDoorLocked("doorman", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "doorman", 0.5f, false);
AddPlayerSanity(5);
}
}

Help? :S
(This post was last modified: 10-12-2012, 11:06 AM by naseem142.)
10-12-2012, 10:29 AM
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: [SOLVED] Restore sanity - by The chaser - 10-12-2012, 02:36 PM



Users browsing this thread: 1 Guest(s)