Neo
Junior Member
Posts: 10
Threads: 3
Joined: Nov 2013
Reputation:
0
RE: Do something when wheel is on its limit
Ahh, it works! Thank you very much! I just needed to find out how to execute code when the wheel is at maximum
My code:
Spoiler below!
//////////////////WATER PIPES AND PUMPS
//BEGIN
//////////////////If this won't work so well use the if and else statement
void Valve_01(string &in asEntity, int alState)
{
if(alState == 1)
{
SetWheelStuckState("water_valve01", 1, true);
PlaySoundAtEntity("", "Stream_pipe", "water_valve01", 0, false);
SetMessage("Message", "Sound_Water", 5);
SetEntityActive("red", false);
SetEntityActive("green", true);
SetEntityActive("high", true);
SetEntityActive("low", false);
}
}
void Watervalve01(string &in asEntity)
{
if (GetGlobalVarString("Pipe01") == "PumpActivated")
{
SetWheelStuckState("water_valve01", 0, true);
}
else
{
SetMessage("Message", "Pipe", 3);
}
}
void Waterpump01(string &in asEntity)
{
PlaySoundAtEntity("", "Steam_pipe", "water_pump01", 0, false);
SetGlobalVarString("Pipe01", "PumpActivated");
SetEntityInteractionDisabled("water_pump01", true);
SetWheelInteractionDisablesStuck("water_valve01", true);
}
//////////////////WATER PIPES AND PUMPS
//END
//////////////////
I created a string variable. When you touch the wheel before the pump was activated, it displays a message and does nothing else. If you activate the pump the variable changes. Now the wheel isn't stuck anymore and you can spin it.
Thanks!
11-30-2013, 08:57 PM