Files
DayZ-Epoch/SQF/dayz_code/system/mission/chernarus/infectiousWaterholes/init.sqf
worldwidesorrow 41207ce861 Update init.sqf
Update to use KK's Array Shuffle Plus function. Shuffle the array 5 times.
2020-01-09 15:57:29 -06:00

56 lines
1.1 KiB
Plaintext

//Start server selection for infectedWaterHoles.
private ["_WaterHoleArray","_ShuffleArray"];
_WaterHoleArray = [
"BlackLake",
"Gvozdno",
"Kabanino",
"Kopyto",
"Mogilevka",
"Nadezdinho",
"NorthNadezdinho",
"NorthPusta",
"NorthTopolka",
"Novy",
"PobedaDam",
"Pogorevka",
"Polana",
"Prud",
"Sosnovy",
"Stary",
"Topolka",
"Vysota",
"WillowLake"
];
_infectedWaterHoles = [_WaterHoleArray,5] call fn_shuffleArray;
infectedWaterHoles = [];
{
if ((random 1) < 0.5) then {
infectedWaterHoles set [count infectedWaterHoles, _x]; // set
};
} count _infectedWaterHoles;
//Send the random array to everyone.
publicVariable "infectedWaterHoles";
diag_log format["INFO: Chosen waterholes to be infectious - %1",infectedWaterHoles];
/*
//Setup on each client witch water holes have been chosen by the server to be infected
if (!isServer) then {
waitUntil { sleep 0.1; !isNil "infectedWaterHoles" };
{
call compile preprocessFileLineNumbers ("\z\addons\dayz_code\system\mission\chernarus\infectiousWaterholes\"+_x+".sqf");
} count infectedWaterHoles;
diag_log (infectedWaterHoles);
};
*/