Jump to content
Sign in to follow this  
citazenman

Trying to loop a something. need help

Recommended Posts

Hello, this is a bit of beginner question. How would I make this script repeat every 10 seconds. I know it is something like "while true do" and then "sleep 10". I can't seem to get the ordering right. This script applies a revive script to all Blu units. With mods like ALiVE and MCC constantly spawning new troops in my missions I'd like this script to be continuously running.

//

{

if ((side _x) == West) then

{

_x call btc_qr_fnc_unit_init

};

} forEach allUnits;

//

http://pastebin.com/1yxidMfS

couldn't get forum to keep spacing.

Thanks,

CM

Edited by CitazenMan

Share this post


Link to post
Share on other sites
Hello, this is a bit of beginner question. How would I make this script repeat every 10 seconds. I know it is something like "while true do" and then "sleep 10". I can't seem to get the ordering right. This script applies a revive script to all Blu units. With mods like ALiVE and MCC constantly spawning new troops in my missions I'd like this script to be continuously running.

//

{

if ((side _x) == West) then

{

_x call btc_qr_fnc_unit_init

};

} forEach allUnits;

//

http://pastebin.com/1yxidMfS

couldn't get forum to keep spacing.

Thanks,

CM

[color="#FF8040"][color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] 
[color="#8B3E2F"][b]{[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
   [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]side[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]=[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#000000"]west[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color]
   [color="#8B3E2F"][b]{[/b][/color]
	  [color="#000000"]_x[/color] [color="#191970"][b]call[/b][/color] btc_qr_fnc_unit_init
   [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#191970"][b]allUnits[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#191970"][b]sleep[/b][/color] [color="#FF0000"]10[/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

There you go

Share this post


Link to post
Share on other sites

yup, I didn't expect you experienced guys to have to ponder over this one too heavily lol.

Thank you very much

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  

×