Jump to content
Sign in to follow this  
avibird 1

How can you add a sleep command inside a script for a section of code only!

Recommended Posts

Hello how would I go about to add a sleep command to this code line to to delay the deletion of the tank group after it gets destroyed . As of now when the last tank in the group gets destroyed the whole group gets deleted on the spot and the whole script can be called in again in 25 minutes. I would like to delay the destroyed units for a bit before the deletion like more minutes after the last tank gets taking out.

TankT5 setTriggerStatements ["!(alive TK1) && !(alive TK2) && !(alive TK3) && !(alive TK4) && !(alive TK5)","player sideChat ""HQ INTELL REPORTS: Tank Platoon has been destroyed""; GroupTank exec ""HQ\support\donearmor3.sqf""" , ""];

sleep 1500;

player setVariable ["TanksupportAvailable", "TanksupportAvailable"];

hint "Tank Platoon rearmed and ready for support if needed!";

Thanks Avibird

Share this post


Link to post
Share on other sites

I think you cant put sleep command in trigger statements. But why dont you use the trigger timeout command?

Share this post


Link to post
Share on other sites

I know how to use it and I do have it in the whole script but how can I add it to this one section in the script

TankT5 setTriggerStatements ["!(alive TK1) && !(alive TK2) && !(alive TK3) && !(alive TK4) && !(alive TK5)","player sideChat ""HQ INTELL REPORTS: Tank Platoon has been destroyed""; GroupTank exec ""HQ\support\donearmor3.sqf""" , ""];

Share this post


Link to post
Share on other sites

http://community.bistudio.com/wiki/spawn

Just spawn a new thread and then you can sleep in there.

So your on activation would be something like this:

"[] spawn { sleep 120;[color=#3E3E3E]player sideChat 'HQ INTELL REPORTS: Tank Platoon has been destroyed'; GroupTank exec 'HQ\support\donearmor3.sqf';[/color]};"

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  

×