Steve
Member
Posts: 178
Threads: 17
Joined: Jun 2012
Reputation:
7
|
RE: Still one problem to solve
I finaly did it with this script I made;
Spoiler below!
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_1", "CheckIngredients");
}
////////////LEVER CHECK/////////////////
void CheckIngredients(string &in asEntity, int alState)
{
if(alState == 1)
{
if (GetLocalVarInt("oven_1_correct") == 1
&& GetLocalVarInt("oven_2_correct") == 1
&& GetLocalVarInt("oven_3_correct") == 1
&& GetLocalVarInt("oven_4_correct") == 1)
{
AddDebugMessage("OvenPuzzle: Correct!", false);
AddTimer("ovencomplete", 1, "CompleteOvenPuzzle");
}
else
{
AddDebugMessage("OvenPuzzle: Wrong!", false);
SetMessage("Messages", "IncorrectCombination", 0);
}
}
}
void PutObjectOven_1(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_1_correct", 1);
}
void DetachObjectOven_1(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_1_correct", 0);
}
void PutObjectOven_2(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_2_correct", 1);
}
void DetachObjectOven_2(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_2_correct", 0);
}
void PutObjectOven_3(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_3_correct", 1);
}
void DetachObjectOven_3(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_3_correct", 0);
}
void PutObjectOven_4(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_4_correct", 1);
}
void DetachObjectOven_4(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt("oven_4_correct", 0);
}
void CompleteOvenPuzzle(string &in asTimer)
{
SetSwingDoorLocked("extaction_oven_6", false, true);
SetMessage("Messages", "correctcombinationchemicals", 0);
}
CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
(This post was last modified: 10-24-2012, 09:23 PM by Steve.)
|
|
10-24-2012, 09:23 PM |
|