Frictional Games Forum (read-only)

Full Version: Variable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello peoples Big Grin ,
Would:
Code:
GetLocalVarInt(string& asName);
Get the value of the variable so I could use it like this:
Code:
void Wake(string &in asTimer)
{
    if(GetLocalVarInt(Breath)==3) Something
    else PlayGuiSound("react_breath_slow.snt", 1);
        AddLocalVarInt("Breath", 1);
        AddTimer("return", 2.45, "Wake");
}
And so it repeats until "Breath" has got to three. I have already set up "Breath" to 0

Thanks
Yes it would, but your code has some errors.
Firstly, you missed a pair of quotation marks. Secondly your function would loop endlessly; What you are currently doing:
Code:
void Wake(string &in asTimer)
{
    if(GetLocalVarInt("Breath")==3)
     {
       //Something
      }
    else
       {
          PlayGuiSound("react_breath_slow.snt", 1);
        }
        AddLocalVarInt("Breath", 1);
        AddTimer("return", 2.45, "Wake");
}
What you want (i assume):
Code:
void Wake(string &in asTimer)
{
  if(GetLocalVarInt("Breath")==3)
   {
     //Something
    }
   else
     {
       PlayGuiSound("react_breath_slow.snt", 1);
       AddLocalVarInt("Breath", 1);
       AddTimer("return", 2.45, "Wake");
     }
}
Hope that helps Wink
Thank-you Big Grin Big Grin Big Grin Big Grin