Jump to content

Recommended Posts

I have a side mission that I would like to have come up at a random time , then once complete start again with at a random time

Any idea how i can do that ?

Thanks

Share this post


Link to post
Share on other sites

ExecVM a script with this in init.sqf?

if (! isServer) exitWith{};
_sleepTimeMax = 2000;
_sleepTimeMin = 1000;

while { true } do
{
   waitUntil {Global_Side_Mission == 0};
   sleep ((floor random _sleepTimeMax) + _sleepTimeMin);
   Global_Side_Mission = 1; 
};

Then have your side mission sqf do the reverse:

if (! isServer) exitWith{};
while { true } do
{
   waitUntil {Global_Side_Mission == 1};

   ....execute side mission code...

   waitUntil {Global_Side_Mission == 0};

};

Somewhere, when the side mission is complete, set Global_Side_Mission back to 0.

Edited by Jacmac

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

×