2015-08-29 01:48:18 +00:00
|
|
|
/*
|
2015-09-05 03:40:00 +00:00
|
|
|
DMS_fnc_selectMission
|
2015-08-29 01:48:18 +00:00
|
|
|
Influenced by WAI
|
|
|
|
Created by eraser1
|
|
|
|
|
|
|
|
Selects/Spawns missions. Takes no arguments, returns nothing.
|
|
|
|
*/
|
|
|
|
private "_time";
|
|
|
|
|
|
|
|
_time = diag_tickTime;
|
|
|
|
|
|
|
|
if (DMS_RunningBMissionCount isEqualTo DMS_MaxBanditMissions) then
|
|
|
|
{
|
|
|
|
DMS_BMissionLastStart = _time;
|
|
|
|
};
|
|
|
|
|
2015-08-31 03:22:15 +00:00
|
|
|
if ((_time - DMS_BMissionLastStart > DMS_BMissionDelay) && {diag_fps >= DMS_MinServerFPS && {(count allPlayers) >= DMS_MinPlayerCount}}) then
|
2015-08-29 01:48:18 +00:00
|
|
|
{
|
|
|
|
private "_mission";
|
|
|
|
|
|
|
|
DMS_MissionCount = DMS_MissionCount + 1;
|
|
|
|
DMS_RunningBMissionCount = DMS_RunningBMissionCount + 1;
|
|
|
|
|
|
|
|
DMS_BMissionLastStart = _time;
|
|
|
|
_mission = DMS_MissionTypesArray call BIS_fnc_selectRandom;
|
|
|
|
|
|
|
|
DMS_BMissionDelay = (DMS_TimeBetweenMissions select 0) + random((DMS_TimeBetweenMissions select 1) - (DMS_TimeBetweenMissions select 0));
|
|
|
|
|
|
|
|
if (DMS_DEBUG) then
|
|
|
|
{
|
2015-08-31 07:52:46 +00:00
|
|
|
diag_log format ["DMS_DEBUG SelectMission :: Spawning mission: %1 | DMS_BMissionDelay set to %2",_mission,DMS_BMissionDelay];
|
2015-08-29 01:48:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
call compile preprocessFileLineNumbers (format ["\x\addons\DMS\missions\%1.sqf",_mission]);
|
|
|
|
};
|