Jump to content
Sign in to follow this  
CaptainBravo

How to stop script ?

Recommended Posts

Hey everyone,

I have a script in loop and I want it to stop once ceertain conditions are met.

Question: how (sorry NooB question)

Script line: [] exec "Scripts\Stormy.sqs";

How do you stop it from runningvia trigger?

Share this post


Link to post
Share on other sites

Not sure with sqs / exec, but with sqf / execVM it is:

my_stormy_handle = [] execVM "Scripts\Stormy.sqf";

and in the trigger: terminate my_stormy_handle;

Share this post


Link to post
Share on other sites

thanks sickboy, I will try when back.

---------- Post added at 06:03 PM ---------- Previous post was at 05:45 PM ----------

Unfortunatly the sqs does not like the sqf command as it CTD when I add: my_stormy_handle = [] execVM "Scripts\Stormy.sqf";

I am not sure how sqs different from sqf.

I have a simple loop script in sqs:

#loop

playsound "Stormy"

~32

goto "loop"

How can I change/convert it to sqf to avoid sqs?

Share this post


Link to post
Share on other sites

You should just use conditions for that loop.

SQF:

while {CAPT_stormy_sound} do
{
    playSound "Stormy";
    sleep 32;
};

SQS:

#loop
playsound "Stormy"
~32
?!CAPT_stormy_sound : goto "end"
goto "loop"

#end
exit

Both will loop as long as CAPT_stormy_sound is true.

Share this post


Link to post
Share on other sites

Sickboy and Deadfast: Thank you very much for your help. Now I got script converted to sqf and works like a charm.

Thanks again.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×