Hi there, it's been a while since I've been here. I think my last post was somewhere in.. 2004. Good to see my account is still active
In any case, I'm having some trouble with this code.
while {true} do
{
"start" setmarkerpos (getpos me);
if (testvar == true) then
{
"testmark" setmarkerpos (getpos me);
};
sleep 5;
};
An infinite while loop, sets the "start" marker to "me" location. It reaches the if statement, which is supposed to set a new marker at my location if testvar equals true.
Wait 5 seconds, do it all over again.
Without the if statement, this works fine. The "start" marker updates every 5 seconds on my position. With the if statement, however, it will execute the "start" marker setmarkerpos once, and then die.
I am clueless as what can go wrong here. Just to be sure, I defined "testvar" as false first (at the very start of the init.sqf), then set testvar = true, then called the script.
Surely I'm doing something wrong and this isn't a sqf limitation? I'd hate to make a second script just to get a second marker on my position (that requires a condition).