05-23-2011, 04:14 PM
Hello I need help with using the "if" in my script, I just dont get it. So I have 3 pipes use them on 3 separate scripts and every time one placed right an pipe entity appears so the player sees that it's placed right. Now When all are placed right I want to swap a stuck valve with a valve that can be turned. So here's my script so far
void OnStart()
{
AddUseItemCallback("GetOil", "pipe_piece_1", "PipeArea1", "PipeQuest1", true);
AddUseItemCallback("GetOil", "pipe_piece_2", "PipeArea2", "PipeQuest2", true);
AddUseItemCallback("GetOil", "pipe_piece_3", "PipeArea3", "PipeQuest3", true);
}
///PIPEQUEST
void PipeQuest1(string &in asItem, string &in asEntity)
{
RemoveItem("pipe_piece_1");
SetEntityActive("Pipe1", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", "Player", 0, false);
}
void PipeQuest2(string &in asItem, string &in asEntity)
{
RemoveItem("pipe_piece_2");
SetEntityActive("Pipe2", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", "Player", 0, false);
}
void PipeQuest3(string &in asItem, string &in asEntity)
{
RemoveItem("pipe_piece_3");
SetEntityActive("Pipe3", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", "Player", 0, false);
}
I don't know how to script it to understand when all 3 pipes are placed right it should swap the stuck valve with the unstuck
Help appreciated!
Spoiler below!
void OnStart()
{
AddUseItemCallback("GetOil", "pipe_piece_1", "PipeArea1", "PipeQuest1", true);
AddUseItemCallback("GetOil", "pipe_piece_2", "PipeArea2", "PipeQuest2", true);
AddUseItemCallback("GetOil", "pipe_piece_3", "PipeArea3", "PipeQuest3", true);
}
///PIPEQUEST
void PipeQuest1(string &in asItem, string &in asEntity)
{
RemoveItem("pipe_piece_1");
SetEntityActive("Pipe1", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", "Player", 0, false);
}
void PipeQuest2(string &in asItem, string &in asEntity)
{
RemoveItem("pipe_piece_2");
SetEntityActive("Pipe2", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", "Player", 0, false);
}
void PipeQuest3(string &in asItem, string &in asEntity)
{
RemoveItem("pipe_piece_3");
SetEntityActive("Pipe3", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", "Player", 0, false);
}
I don't know how to script it to understand when all 3 pipes are placed right it should swap the stuck valve with the unstuck
Help appreciated!