Re: Origin Lite SP 0.1

Posted by Klaycus5555 on
URL: http://kodabar-dayz-daizy-single-player-forum.163.s1.nabble.com/Origins-Lite-SP-0-1-tp19101p19578.html

private ["_dzv","_name1","_tmp","_tmpb","_pos","_baseclass","_baseclassmin","_item","_isok","_bci","_bc",
"_lootpos","_ba","_tmpblg","_tmp1","_handle"];

0 cutText [localize "SPP_pleasewait", "BLACK FADED",60];

// load string functions
null=[] execVM "KRON_Strings.sqf";  
null=[] execVM "u_progs.sqf";
null=[] execvm "tpwcas\tpwcas.sqf";
null=[] execVM "DMZ_delete.sqf";

R3F_TIRED_Accumulator = 0;
R3F_TIRED_BLACKOUT_LEVEL = 10000;

WEST setFriend [RESISTANCE, 0];
RESISTANCE setFriend [WEST, 0];
EAST setFriend [RESISTANCE, 1];
RESISTANCE setFriend [EAST, 1];
EAST setFriend [WEST, 1];
WEST setFriend [EAST, 1];

// DayZ mod not installed, so we can't do anything
if !(isClass (configFile >> "CfgMods" >> "DayZ")) exitWith {
    hintc "DayZ mod must be installed and activated, for this mission to run!";
};

dayz_versionNo = getText (configFile >> "CfgMods" >> "DayZ" >> "version");
_dzv = parseNumber (dayz_versionNo);
if (_dzv < 1.7) exitWith {
    hintc "This mission requires at least version 1.7.0 of the DayZ mod!";
};

_name1 = name player;
enableTeamSwitch false;

// regular initializations
isServer = false;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
isServer = true;

myGroupMax = 60;
myNoLoot = 0;
sparamOk = false;
myAmmoSelect = 0;
myEquip = 0;
myLootKoef = 0.75;
myDamageKoef = 1.0;
myDayNight = 0;
myLootClrTime = 12;
myLootCount = 0; //
myMapPath = 0;
myFriendKoef = 0.2;
myTired = 2;

diag_log "*** start selectparam.sqf";
_timepb = time;
while {!(sparamOk)} do {
    [] call compile preprocessFile "selectparam.sqf";
};

if(myMapPath > 0) then {
    [] call compile preprocessFile  "spawnbuildings.sqf";
};

// overrides of functions and global vars
//Cooking
meatraw = [
    "FoodSteakRaw",
    "FoodmeatRaw",
    "FoodbeefRaw",
    "FoodmuttonRaw",
    "FoodchickenRaw",
    "FoodrabbitRaw",
    "FoodbaconRaw",
    "FoodhumanRaw"
];
meatcooked = [
    "FoodSteakCooked",
    "FoodmeatCooked",
    "FoodbeefCooked",
    "FoodmuttonCooked",
    "FoodchickenCooked",
    "FoodrabbitCooked",
    "FoodbaconCooked",
    "FoodhumanCooked"
];
//Eating
no_output_food = ["FoodMRE", "FoodPistachio", "FoodNutmix"]+meatcooked+meatraw;

//Simulation Server DayZ
diag_log "[SPP]: Start Simulation Server DayZ";
allowConnection = true;
dayz_preloadFinished = true;
myPlayerSpawn = false;
isSever = false;
isLoops = true;
enableRadio true;

server_gutObject = {};
server_onPlayerConnect = {};
server_onPlayerDisconnect = {};
server_playerDied = {};

server_playerLogin = {
        _playerObj = player;
        _clientID = owner _playerObj;
    PVCDZ_plr_Login = ["42",[],[],[0,0,0],true,dayz_versionNo,typeOf player,true,false];
        _clientID publicVariableClient "PVCDZ_plr_Login";
    diag_log "[SPP]: server_playerLogin ok";
};  

server_playerSetup = {
                _playerObj = player;  
                _spawnSelection = _this select 3;
                _clientID = owner _playerObj;
                _position = getPosATL _playerObj;

        waitUntil {
                //Spawn player on map
                if (dayz_selectRegion == 6) then {
                        //Random spawn player on map
                        _position = [] call mySpawnPlayerSPP;
                } else {  
                    //Select spawn player on map
                    _mkr = getMarkerPos ("spawn" + str(_spawnSelection));
                    _position = ([_mkr,0,1500,10,0,2,1] call BIS_fnc_findSafePos);  
                };
                _validPos = ((_position select 0) != 0);
                _validPos
        };

        _position set [2,0];  
        _playerObj setPosATL _position;  
               
        PVCDZ_plr_Login2 = [[0,_position],[],true];
        _clientID publicVariableClient "PVCDZ_plr_Login2";
        myPlayerSpawn = true;
    diag_log "[SPP]: server_playerSetup ok";  
};

server_playerStat = {};
server_playerSync = {};
server_publishObject = {};
server_routinePlayerCheck = {};
server_townDeZombify = {};
server_townZombify = {};
server_updateObject = {};
server_updatePlayer = {};
zombie_findOwner = {};
dayz_clientPreload = true;
diag_log "[SPP]: End Simulation Server DayZ";

allowConnection = true;
dayz_preloadFinished = true;
server_hiveWrite = {};
server_updatePlayer = {};
server_playerDied = {};
server_updatePlayer = {};
server_publishObj = {};
server_updateObject = {};

server_playerLogin = {
    // 1.7.5.1
    // [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer];
    dayzPlayerLogin = ["42",[],[],[0,0,0],true,dayz_versionNo,typeOf player,true,false];
    //dayzPlayerLogin = ["42",[],[],[0,0,0],true,dayz_versionNo];
    diag_log "*** server_playerLogin ok";
};

server_playerSetup = {
    private ["_position","_marker","_validPos"];
    _position = getPosATL player;
    waitUntil {
        _marker = format["spawn%1",round(random 4)];
        //_marker = "spawn2";
        _position = [(getMarkerPos _marker),0,1500,10,0,2000,1] call BIS_fnc_findSafePos;
        _validPos = ((_position select 0) != 0);
        _validPos
    };
   
    //_position = getMarkerPos "testspawn";
   
    _position set [2,0];
    player setPosATL _position;
   
    //player setVariable["worldspace",[0,_position],true];
    _worldspace = [0,_position];
    _state = [];
    dayzPlayerLogin2 = [_worldspace,_state];
    //dayzLogin = null;
    //dayzLogin2 = null;
    diag_log "*** server_playerSetup ok";
};

server_playerMorph = {};
server_switchPlayer = {};
dayz_recordLogin = {};

//_code
dayzLogin_code = compile "[] call server_playerLogin;";
dayzLogin2_code = compile "[] call server_playerSetup;";
dayzLoginRecord_code = compile "[] call dayz_recordLogin;";
//dayzUpdateVehicle_code = compile "(_this select 1) call server_updateObject;";

my_player_spawn_2 = false;
building_spawnLoot = compile preprocessFileLineNumbers "dayz\building_spawnLoot.sqf";
local_gutObject = compile preprocessFileLineNumbers "dayz\local_gutObject.sqf";
player_chopWood = compile preprocessFileLineNumbers "dayz\player_chopWood.sqf";
check_AI_magazines = compile preprocessFileLineNumbers "check_AI_magazines.sqf";
player_eat = compile preprocessFileLineNumbers "dayz\player_eat.sqf";
player_convertBloodBag = compile preprocessFileLineNumbers "dayz\player_convertBloodBag.sqf";
player_selfTransfuse = compile preprocessFileLineNumbers "dayz\player_selfTransfuse.sqf";

[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
diag_log "*** start player_monitor.sqf";

waitUntil {my_player_spawn_2};
// end 1.7.5.1
//
diag_log "*** start init.sqf";

myC1 = 0;
myC2 = 0;
myStat = 0;
myISleep = 0;
myTrace = 0;
//mySleepAction = -1;
myStatTime = time - 1;
myStatShowTime = time - 1;
mycourse = 0;
myHUD = false;
myVeh = [];
myBoat = [];
myHelyVeh = [];
myNewHely = objNull;
myMap = [];
// за кого играют боты
center_0 = createCenter resistance;
center_1 = createCenter west;
// инициализация групп
myHely = objNull;
myHelyGrp = grpNull;
myHelyTime = time + ((60*60*0.5) + ((5*60) * (random 8)));
myFriendGroup = creategroup center_1; //grpNull;
myFriendGroup setVariable ["keepalive", 1];
myFriend = leader myFriendGroup;
myFriendshiptime = time - 1;
myFriendshiptrg = false;
myHuntOpen = time + (60*1);
myHunterCount = 0;
myHunterKills = 0;
myBanditKills = 0;
myHumanKills = 0;
spawnGroup = grpNull;
myTents = [];
myFlies = [];
// цель
myTargetGroup = grpNull;
myTargetQuery = 0;
myTargetCount = 2;
// gameplay param
myTargetKills = 0;
//

mySkinHero = ["Survivor3_DZ","SectorB_def","SectorB_defA","SectorB_defN","SectorB_defS","SectorB_defM","SectorB_defGM","SectorB_defGSp","SectorB_defSp","SectorB_defGen","SectorB_defGenG","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Survivor3_DZ","Survivor3_DZ","Survivor2_DZ","SurvivorW2_DZ"];
mySkinBandit = ["Bandit1_DZ","SectorB_def","SectorB_defA","SectorB_defN","SectorB_defS","SectorB_defM","SectorB_defGM","SectorB_defGSp","SectorB_defSp","SectorB_defGen","SectorB_defGenG","Bandit1_DZ","BanditW1_DZ","Survivor2_DZ","SurvivorW2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ"];

myWpn1 = [
    ["Makarov",8],
        ["MakarovSD",8],
    ["Colt1911",8],
    ["revolver_EP1",8],
        ["revolver_gold_EP1",8],
    ["glock17_EP1",8],
    ["M9",8],
    ["M9SD",8],
        ["Ori_APS",8],
        ["Ori_APS_SD",8],
        ["Ori_CZ75",8],
        ["Ori_CZ83",8],
        ["ori_autocrossbowH",8],
        ["Ori_Tt33",8],
        ["Sa61_EP1",8],
    ["UZI_SD_EP1",8],
    ["UZI_EP1",8]
];
myWpn2 = [    
    ["M1014",8],
    ["Saiga12K",8],
    ["MP5A5",8],
    ["MP5SD",8],
    ["AK_74",8],
    ["G36C_camo",8],
    ["G36A_camo",8],
    ["G36K_camo",8],
    ["G36_C_SD_camo",8],
        ["G36a",8],
        ["G36K",8],
        ["G36C",8],
        ["G36_C_SD_eotech",8],
        ["M110_NVG_EP1",8],
    ["Sa58V_RCO_EP1",8],
    ["AKS_74_kobra",8],
    ["AKS_74_U",8],
    ["AK_47_S",8],
    ["AKS_GOLD",8],
    ["AK_74_GL",8],
    ["AK_74_GL_kobra",8],
    ["AKS_74_pso",8],
    ["AKS_74_UN_kobra",8],
    ["AK_47_M",8],
    ["m8_compact",8],
    ["m8_compact_pmc",8],
        ["ori_autocrossbow",8],
        ["ori_ak_camo",8],
    ["ori_vil_uzimini",8],
    ["ori_vil_uzimini_SD",8],
    ["Ori_mosin",8],
    ["Ori_PPS43",8],
    ["Ori_Sa48SMG",8],
    ["ori_shotgun2",8],
    ["Ori_SKS",8],
    ["ori_vil_uzi_rozkl",8],
    ["ori_vil_uzi_sd",8],
    ["M16A4_ACG_GL",8],
        ["M16A4_ACG",8],
    ["M4A3_CCO_EP1",8],
    ["M4A3_RCO_GL_EP1",8],
    ["Sa58V_CCO_EP1",8],
    ["M249_DZ",5],
    ["M249_m145_EP1_DZ",5],
    ["RPK_74",5],
    ["m8_SAW",5],
    ["MG36",5],
    ["MG36_camo",5],
    ["m240_scoped_EP1_DZ",5],
    ["M240_DZ",5],
    ["M60A4_EP1_DZ",5],
    ["Pecheneg_DZ",5],
    ["PK_DZ",5],
    ["AA12_PMC",8],
        ["nsw_er7s",8],
        ["nsw_er7a",8],
    ["gms_mp40",8],
        ["gms_k98",8],
    ["gms_k98zf39",8],
        ["Remington870",8],
        ["M16A2",8],
        ["M16A2GL",8],
        ["m16a4",8],
        ["M16A4_GL",8],
        ["M40A3",8],
        ["M4A1",8],
        ["M4A1_Aim",8],
        ["M4SPR",8],
        ["SVD_CAMO",8],
        ["AK_107_kobra",8],
        ["AK_107_GL_kobra",8],
        ["AK_107_GL_pso",8],
        ["AK_107_pso",8],
        ["Sa58P_EP1",8],
        ["Sa58V_EP1",8],
        ["M4A1_RCO_GL",8],
        ["Remington870_lamp",8],
        ["M4A3_ACOG_EP1",8],
        ["M4A3_EP1",8],
    ["KPFS_MG56",6],
    ["FN_FAL_ANPVS4",8],
        ["RH_M40A1",8],
        ["RH_M40A5",8],
    ["Winchester1866",8],
    ["LeeEnfield",8],
    ["huntingrifle",8],
        ["WX_IJA_Type099_LMG",8],
        ["WX_IJA_Type099_LMG_Scoped",8],
        ["wx_ija_type099_rifle",8],
        ["wx_ija_type099_rifle_sniper",8],
        ["EB_DP28_DZ",6],
        ["ots_14_03_PO",8],
        ["ots_14_03",8],
        ["type89",8],
        ["gQ_minigun_DZ",8],
        ["SCAR_H_CQC_CCO",8],
        ["SCAR_H_CQC_CCO_SD",8],
        ["SCAR_H_STD_EGLM_Spect",8],
        ["SCAR_H_LNG_Sniper",8],
        ["SCAR_H_LNG_Sniper_SD",8],
        ["Anzio_20_DZ",8],
    ["SLTS_L128A1",8],
    ["Mk_48_DZ",5],
    ["FN_FAL",8],
        ["HKG3T",8],
        ["bizon",8],
    ["bizon_silenced",8],
    ["M4A1_HWS_GL_SD_Camo",8],
    ["M4A1_HWS_GL",8],
    ["M4A1_HWS_GL_camo",8],
        ["BAF_L85A2_RIS_Holo",8],
    ["BAF_L85A2_RIS_SUSAT",8],
        ["BAF_L85A2_RIS_ACOG",8],
    ["BAF_L86A2_ACOG",8],
    ["BAF_AS50_scoped",8],
    ["DMR",8],
    ["M24",8],
    ["M4A1_Aim_camo",8],
    ["M4A1_AIM_SD_camo",8],
    ["SVD",8],
    ["BAF_LRR_scoped",8],
    ["BAF_LRR_scoped_W",8],
    ["VSS_vintorez",8],
    ["M14_EP1",8],
    ["ksvk_DZ",8],
        ["USSR_cheytacM200_DZ",8],
        ["USSR_cheytacM200_sd_DZ",8],
    ["M107_DZ",8]
];
myWpn3 = [
    ["M1014",8],
    ["Saiga12K",8],
    ["MP5A5",8],
    ["MP5SD",8],
    ["AK_74",8],
    ["G36C_camo",8],
    ["G36A_camo",8],
    ["G36K_camo",8],
    ["G36_C_SD_camo",8],
        ["G36a",8],
        ["G36K",8],
        ["G36C",8],
        ["G36_C_SD_eotech",8],
        ["M110_NVG_EP1",8],
    ["Sa58V_RCO_EP1",8],
    ["AKS_74_kobra",8],
    ["AKS_74_U",8],
    ["AK_47_S",8],
    ["AKS_GOLD",8],
    ["AK_74_GL",8],
    ["AK_74_GL_kobra",8],
    ["AKS_74_pso",8],
    ["AKS_74_UN_kobra",8],
    ["AK_47_M",8],
    ["m8_compact",8],
    ["m8_compact_pmc",8],
        ["ori_autocrossbow",8],
        ["ori_ak_camo",8],
    ["ori_vil_uzimini",8],
    ["ori_vil_uzimini_SD",8],
    ["Ori_mosin",8],
    ["Ori_PPS43",8],
    ["Ori_Sa48SMG",8],
    ["ori_shotgun2",8],
    ["Ori_SKS",8],
    ["ori_vil_uzi_rozkl",8],
    ["ori_vil_uzi_sd",8],
    ["M16A4_ACG_GL",8],
        ["M16A4_ACG",8],
    ["M4A3_CCO_EP1",8],
    ["M4A3_RCO_GL_EP1",8],
    ["Sa58V_CCO_EP1",8],
    ["M249_DZ",5],
    ["M249_m145_EP1_DZ",5],
    ["RPK_74",5],
    ["m8_SAW",5],
    ["MG36",5],
    ["MG36_camo",5],
    ["m240_scoped_EP1_DZ",5],
    ["M240_DZ",5],
    ["M60A4_EP1_DZ",5],
    ["Pecheneg_DZ",5],
    ["PK_DZ",5],
    ["AA12_PMC",8],
        ["nsw_er7s",8],
        ["nsw_er7a",8],
    ["gms_mp40",8],
        ["gms_k98",8],
    ["gms_k98zf39",8],
        ["Remington870",8],
        ["M16A2",8],
        ["M16A2GL",8],
        ["m16a4",8],
        ["M16A4_GL",8],
        ["M40A3",8],
        ["M4A1",8],
        ["M4A1_Aim",8],
        ["M4SPR",8],
        ["SVD_CAMO",8],
        ["AK_107_kobra",8],
        ["AK_107_GL_kobra",8],
        ["AK_107_GL_pso",8],
        ["AK_107_pso",8],
        ["Sa58P_EP1",8],
        ["Sa58V_EP1",8],
        ["M4A1_RCO_GL",8],
        ["Remington870_lamp",8],
        ["M4A3_ACOG_EP1",8],
        ["M4A3_EP1",8],
    ["KPFS_MG56",6],
    ["FN_FAL_ANPVS4",8],
        ["RH_M40A1",8],
        ["RH_M40A5",8],
    ["Winchester1866",8],
    ["LeeEnfield",8],
    ["huntingrifle",8],
        ["WX_IJA_Type099_LMG",8],
        ["WX_IJA_Type099_LMG_Scoped",8],
        ["wx_ija_type099_rifle",8],
        ["wx_ija_type099_rifle_sniper",8],
        ["EB_DP28_DZ",6],
        ["ots_14_03_PO",8],
        ["ots_14_03",8],
        ["type89",8],
        ["gQ_minigun_DZ",8],
        ["SCAR_H_CQC_CCO",8],
        ["SCAR_H_CQC_CCO_SD",8],
        ["SCAR_H_STD_EGLM_Spect",8],
        ["SCAR_H_LNG_Sniper",8],
        ["SCAR_H_LNG_Sniper_SD",8],
        ["Anzio_20_DZ",8],
    ["SLTS_L128A1",8],
    ["Mk_48_DZ",5],
    ["FN_FAL",8],
        ["HKG3T",8],
        ["bizon",8],
    ["bizon_silenced",8],
    ["M4A1_HWS_GL_SD_Camo",8],
    ["M4A1_HWS_GL",8],
    ["M4A1_HWS_GL_camo",8],
        ["BAF_L85A2_RIS_Holo",8],
    ["BAF_L85A2_RIS_SUSAT",8],
        ["BAF_L85A2_RIS_ACOG",8],
    ["BAF_L86A2_ACOG",8],
    ["BAF_AS50_scoped",8],
    ["DMR",8],
    ["M24",8],
    ["M4A1_Aim_camo",8],
    ["M4A1_AIM_SD_camo",8],
    ["SVD",8],
    ["BAF_LRR_scoped",8],
    ["BAF_LRR_scoped_W",8],
    ["VSS_vintorez",8],
    ["M14_EP1",8],
    ["ksvk_DZ",8],
        ["USSR_cheytacM200_DZ",8],
        ["USSR_cheytacM200_sd_DZ",8],
    ["M107_DZ",8]
];
myWpn4 = [
    ["M1014",8],
    ["Saiga12K",8],
    ["MP5A5",8],
    ["MP5SD",8],
    ["AK_74",8],
    ["G36C_camo",8],
    ["G36A_camo",8],
    ["G36K_camo",8],
    ["G36_C_SD_camo",8],
        ["G36a",8],
        ["G36K",8],
        ["G36C",8],
        ["G36_C_SD_eotech",8],
        ["M110_NVG_EP1",8],
    ["Sa58V_RCO_EP1",8],
    ["AKS_74_kobra",8],
    ["AKS_74_U",8],
    ["AK_47_S",8],
    ["AKS_GOLD",8],
    ["AK_74_GL",8],
    ["AK_74_GL_kobra",8],
    ["AKS_74_pso",8],
    ["AKS_74_UN_kobra",8],
    ["AK_47_M",8],
    ["m8_compact",8],
    ["m8_compact_pmc",8],
        ["ori_autocrossbow",8],
        ["ori_ak_camo",8],
    ["ori_vil_uzimini",8],
    ["ori_vil_uzimini_SD",8],
    ["Ori_mosin",8],
    ["Ori_PPS43",8],
    ["Ori_Sa48SMG",8],
    ["ori_shotgun2",8],
    ["Ori_SKS",8],
    ["ori_vil_uzi_rozkl",8],
    ["ori_vil_uzi_sd",8],
    ["M16A4_ACG_GL",8],
        ["M16A4_ACG",8],
    ["M4A3_CCO_EP1",8],
    ["M4A3_RCO_GL_EP1",8],
    ["Sa58V_CCO_EP1",8],
    ["M249_DZ",5],
    ["M249_m145_EP1_DZ",5],
    ["RPK_74",5],
    ["m8_SAW",5],
    ["MG36",5],
    ["MG36_camo",5],
    ["m240_scoped_EP1_DZ",5],
    ["M240_DZ",5],
    ["M60A4_EP1_DZ",5],
    ["Pecheneg_DZ",5],
    ["PK_DZ",5],
    ["AA12_PMC",8],
        ["nsw_er7s",8],
        ["nsw_er7a",8],
    ["gms_mp40",8],
        ["gms_k98",8],
    ["gms_k98zf39",8],
        ["Remington870",8],
        ["M16A2",8],
        ["M16A2GL",8],
        ["m16a4",8],
        ["M16A4_GL",8],
        ["M40A3",8],
        ["M4A1",8],
        ["M4A1_Aim",8],
        ["M4SPR",8],
        ["SVD_CAMO",8],
        ["AK_107_kobra",8],
        ["AK_107_GL_kobra",8],
        ["AK_107_GL_pso",8],
        ["AK_107_pso",8],
        ["Sa58P_EP1",8],
        ["Sa58V_EP1",8],
        ["M4A1_RCO_GL",8],
        ["Remington870_lamp",8],
        ["M4A3_ACOG_EP1",8],
        ["M4A3_EP1",8],
    ["KPFS_MG56",6],
    ["FN_FAL_ANPVS4",8],
        ["RH_M40A1",8],
        ["RH_M40A5",8],
    ["Winchester1866",8],
    ["LeeEnfield",8],
    ["huntingrifle",8],
        ["WX_IJA_Type099_LMG",8],
        ["WX_IJA_Type099_LMG_Scoped",8],
        ["wx_ija_type099_rifle",8],
        ["wx_ija_type099_rifle_sniper",8],
        ["EB_DP28_DZ",6],
        ["ots_14_03_PO",8],
        ["ots_14_03",8],
        ["type89",8],
        ["gQ_minigun_DZ",8],
        ["SCAR_H_CQC_CCO",8],
        ["SCAR_H_CQC_CCO_SD",8],
        ["SCAR_H_STD_EGLM_Spect",8],
        ["SCAR_H_LNG_Sniper",8],
        ["SCAR_H_LNG_Sniper_SD",8],
        ["Anzio_20_DZ",8],
    ["SLTS_L128A1",8],
    ["Mk_48_DZ",5],
    ["FN_FAL",8],
        ["HKG3T",8],
        ["bizon",8],
    ["bizon_silenced",8],
    ["M4A1_HWS_GL_SD_Camo",8],
    ["M4A1_HWS_GL",8],
    ["M4A1_HWS_GL_camo",8],
        ["BAF_L85A2_RIS_Holo",8],
    ["BAF_L85A2_RIS_SUSAT",8],
        ["BAF_L85A2_RIS_ACOG",8],
    ["BAF_L86A2_ACOG",8],
    ["BAF_AS50_scoped",8],
    ["DMR",8],
    ["M24",8],
    ["M4A1_Aim_camo",8],
    ["M4A1_AIM_SD_camo",8],
    ["SVD",8],
    ["BAF_LRR_scoped",8],
    ["BAF_LRR_scoped_W",8],
    ["VSS_vintorez",8],
    ["M14_EP1",8],
    ["ksvk_DZ",8],
        ["USSR_cheytacM200_DZ",8],
        ["USSR_cheytacM200_sd_DZ",8],
    ["M107_DZ",8]
];

//
myTvehicles = [
    "GAZ_Vodnik",
    "UralOpen_CDF",
    "UAZ_INS",
    "Pickup_PK_GUE",
    "Pickup_PK_INS",
    "BRDM2_HQ_Gue",
    "BRDM2_HQ_TK_GUE_EP1",
    "LAV25_HQ",
    "BTR90_HQ",
    "HMMWV_Armored",
    "Kamaz",
    "KamazOpen",
    "MTVR",
    "V3S_Gue",
    "Ural_UN_EP1",
    "Pickup_PK_TK_GUE_EP1",
    "HMMWV_DES_EP1",
    "MTVR_DES_EP1",
    "BTR40_TK_GUE_EP1",
    "BTR40_TK_INS_EP1",
    "HMMWV_M1035_DES_EP1",
    "SUV_UN_EP1",
    "V3S_Open_TK_EP1",
    "V3S_TK_EP1",
    "V3S_Open_TK_CIV_EP1",
    "V3S_TK_GUE_EP1",
    "UralCivil",
    "Ural_TK_CIV_EP1",
    "Ural_CDF",
    "UAZ_CDF",
    "HMMWV_DZ",
    "LandRover_TK_CIV_EP1",
    "UAZ_Unarmed_TK_CIV_EP1",
    "UAZ_Unarmed_UN_EP1",
    "UAZ_RU",
    "BAF_Offroad_D",
    "BAF_Offroad_W",
        "Zil_screwdrive_troop",
    "FgS_ZIL131_3",
    "FgS_ZIL131_4",
    "FgS_ZIL131_5",
    "kpfs_uaz451_light_blue",
    "kpfs_uaz451_blue",
    "kpfs_uaz451_black",
    "kpfs_uaz451_gue",
    "kpfs_uaz451_un",
    "StollyREME",
    "Jeep"
];

myTboats = [
        "ori_submarine"
];

myTcopters = ["ORI_gunship_helicopter","ori_pragaCopter_green","ori_pragaCopter_yellow","UH1H_DZ","AH6X_DZ","Mi17_DZ","MH6J_DZ","MH60S","MV22","Mi17_UN_CDF_EP1","Mi171Sh_CZ_EP1","UH1H_TK_GUE_EP1","C130J","An2_TK_EP1","OWP_MI26ps","OWP_MI26cg","OWP_MI26cg","OWP_MI26hk","int73_mi6a","int73_mi6rus","LynxM","usec_bell206_2","Scout2","Gazelle1","USEC_ch53_E"];

myVehOffRoad = [
    "GAZ_Vodnik",
    "UralOpen_CDF",
    "UAZ_INS",
    "Pickup_PK_GUE",
    "Pickup_PK_INS",
    "BRDM2_HQ_Gue",
    "BRDM2_HQ_TK_GUE_EP1",
    "LAV25_HQ",
    "BTR90_HQ",
    "HMMWV_Armored",
    "Kamaz",
    "KamazOpen",
    "MTVR",
    "V3S_Gue",
    "Ural_UN_EP1",
    "Pickup_PK_TK_GUE_EP1",
    "HMMWV_DES_EP1",
    "MTVR_DES_EP1",
    "BTR40_TK_GUE_EP1",
    "BTR40_TK_INS_EP1",
    "HMMWV_M1035_DES_EP1",
    "SUV_UN_EP1",
    "V3S_Open_TK_EP1",
    "V3S_TK_EP1",
    "V3S_Open_TK_CIV_EP1",
    "V3S_TK_GUE_EP1",
    "UralCivil",
    "Ural_TK_CIV_EP1",
    "Ural_CDF",
    "UAZ_CDF",
    "HMMWV_DZ",
    "LandRover_TK_CIV_EP1",
    "UAZ_Unarmed_TK_CIV_EP1",
    "UAZ_Unarmed_UN_EP1",
    "UAZ_RU",
    "BAF_Offroad_D",
    "BAF_Offroad_W",
        "Zil_screwdrive_troop",
    "FgS_ZIL131_3",
    "FgS_ZIL131_4",
    "FgS_ZIL131_5",
    "kpfs_uaz451_light_blue",
    "kpfs_uaz451_blue",
    "kpfs_uaz451_black",
    "kpfs_uaz451_gue",
    "kpfs_uaz451_un",
    "StollyREME",
    "Jeep",
        "ORI_gunship_helicopter",
    "ori_pragaCopter_green",
    "ori_pragaCopter_yellow",
    "UH1H_DZ",
    "AH6X_DZ",
    "Mi17_DZ",
    "MH6J_DZ",
    "MH60S",
    "MV22",
    "Mi17_UN_CDF_EP1",
    "Mi171Sh_CZ_EP1",
    "UH1H_TK_GUE_EP1",
    "C130J",
    "An2_TK_EP1",
    "int73_mi6a",
    "int73_mi6rus",
    "OWP_MI26ps",
    "OWP_MI26cg",
    "OWP_MI26hk",
        "LynxM",
        "usec_bell206_2",
        "Scout2",
        "Gazelle1",
        "USEC_ch53_E"
];
// точки запроса цели
myAntenna = ["Land_Vysilac_FM", "Land_telek1","Land_vys_antena","land_antena_vetsi"];

// места вечеринок
//createLocation ["NameCityCapital", getMarkerPos "party1", 500, 500];

// точки спавна
mySpawnGroup = nearestLocations [getMarkerPos "center", ["VegetationFir","VegetationBroadleaf","VegetationPalm","VegetationVineyard","Hill","NameLocal","NameCityCapital"], 50000];
mySpawnFriend = nearestLocations [getMarkerPos "center", ["VegetationFir","VegetationBroadleaf","VegetationPalm","VegetationVineyard","Hill","NameLocal"], 50000];
mySpawnTent = nearestLocations [getMarkerPos "center", ["VegetationFir","VegetationBroadleaf","VegetationPalm","VegetationVineyard"], 50000];
//позиции спавна

// для авто и байков
_tmp = ["FlatAreaCitySmall"];
//_ign = [];
//_ign3 = _ign1 + _ign2;
//{_ign = _ign + nearestLocations [getMarkerPos _x, _tmp, 500];}forEach _ign3;
_tmpb = nearestLocations [getMarkerPos "center", _tmp, 50000];
//_tmpb = _tmpb - _ign;
myPbike = [];
{myPbike set [count myPbike, position _x];} forEach _tmpb;

// для вертолетов
_tmp = ["FlatArea"];
//_ign = [];
//{_ign = _ign + nearestLocations [getMarkerPos _x, _tmp, 500];}forEach _ign3;
_tmpb = nearestLocations [getMarkerPos "center", _tmp, 50000];
//_tmpb = _tmpb - _ign;
//_ignc = nearestLocations [getMarkerPos "center", ["NameCity","NameVillage","NameCityCapital"], 50000];
//_ign = [];
//{_ign = _ign + nearestLocations [position _x, _tmp, 500];}forEach _ignc;
//_tmpb = _tmpb - _ign;
myPhely = [];
{myPhely set [count myPhely, position _x];} forEach _tmpb;

//для сломанных вертолетов +
_tmp = nearestLocations [getMarkerPos "center", ["FlatArea","VegetationFir","VegetationBroadleaf","VegetationPalm","VegetationVineyard","Hill"], 50000];
myPcrashhely = [];
{myPcrashhely set [count myPcrashhely, position _x];} forEach _tmp;

// для лодок
myPboat = [];
for "_x" from 0 to 20 do {
    _tmp = getMarkerPos format["boat_%1", _x];
    if ((_tmp select 0) > 0) then {myPboat set [count myPboat, _tmp];};
};

// для палаток
myPtent = [];
{
    _pos = position _x;
    _pos set [2,0];
    myPtent set [count myPtent, _pos];
} forEach mySpawnTent;

//
// формируем списки зданий
//
_baseclass = [
    "Default",//0
    "Residential",//1
    "Office",//2
    "Church",//3
    "Industrial",//4
    "Farm",//5
    "Supermarket",//6
    "Hospital",//8
    "Military",//9
    "MilitarySpecial"//10
];
_baseclassmin = [4,4,4,4,4,4,4,1,1,3,3];
myBuildings = [[],[],[],[],[],[],[],[],[],[],[]];
for "_i" from 0 to (count (configFile>>"CfgBuildingLoot"))-1 do {
    _item = (configFile>>"CfgBuildingLoot") select _i;
    if(isClass(_item)) then {
        _isok = false;
        _bci = -1;
        while {!_isok} do {
            _bc = configName(inheritsFrom(_item));
            if(_bc != "") then {
                _bci = _baseclass find _bc;
                if(_bci >= 0) then {
                    _isok = true;
                }else{
                    _item = inheritsFrom(_item);
                };
            }else{
                _isok = true;
            };
        };
        _item = (configFile>>"CfgBuildingLoot") select _i;
        if(_bci >= 0) then {
            _lootpos = [] + getArray (_item >> "lootPos");
            if((_baseclassmin select _bci) <= count _lootpos) then {
                _ba = myBuildings select _bci;
                _ba = _ba + [format["%1", configName(_item)]];
                myBuildings set [_bci, _ba];
            };
        }else{
            //player globalChat format["%1>>%2", configName(inheritsFrom(_item)), configName(_item)];
        };
    };
};

myGetBuildings = {
    private ["_res"];
    _res = [];
    {_res = _res + (myBuildings select _x);}forEach _this;
    _res;
};

// режим 0 +
// города
//_hospital + _industrial + _church + _supermarket + _office + _residential + _farm + _military;
myBregim0 = [0,8,4,3,6,2,1,9,10] call myGetBuildings;
// режим 1 +
// деревни
//_hospital + _industrial + _church + _farm + _office + _residential;
myBregim1 = [4,3,5,2,1,0] call myGetBuildings;
// режим 2 +
// одинокие строения
//_farm + _industrial + _residential;
myBregim2 = [5,4,1,0] call myGetBuildings;
// режим 3 +
// милитари
myBregim3 = [7,9,10] call myGetBuildings;
// режим 4 +
// лес
myLregim4 = ["VegetationFir","VegetationBroadleaf","VegetationPalm","VegetationVineyard"];
myBregim4 = ["Land_Misc_deerstand"];
// режим 5 +
// тусовка в черно
myBregim5 = [0,1,2,3,4,6,8,9,10] call myGetBuildings;
// режим 101 +
// цель
_tmpblg = [
    "Land_A_Castle_Gate",
    "Land_A_Castle_Bergfrit",
    "Land_A_Castle_Stairs_A",
    "Land_ruin_01",
    "Land_Church_02",
    "Land_Church_02a",
    "Land_Church_05R"
];
_tmp1 = nearestObjects [getMarkerPos "center", _tmpblg, 50000];
//_tmp_ign = nearestObjects [getMarkerPos "ignore1", _tmpblg, 1000];
//_tmp = _tmp1 - _tmp_ign;
myBregim101 = [];
{myBregim101 set [count myBregim101, position _x];} forEach _tmp1;
/*
0    "Default",
1    "Residential",
2    "Office",
3    "Church",
4    "Industrial",
5    "Farm",
6    "Supermarket",
8    "Hospital",
9    "Military",
10   "MilitarySpecial"
*/

myHelyTest = 0;

// просмотор конфига армы
//_Actionid = Player addAction ["Cfg-Explorer", "CfgExplorer\CfgEStart.sqf"];

diag_log "*** waiting change player name";
waitUntil {_name1 != name player};
diag_log "*** kill dummy";

dummy1 setDamage 1;
dummy2 setDamage 1;
//player globalChat format["kill %1", _name1];
//
0 cutText ["", "PLAIN",60];
/*
myGroupMax = 60;
myNoLoot = 0;
sparamOk = false;
myAmmoSelect = 0;
myEquip = 0;
myLootKoef = 0.75;
myDamageKoef = 1.0;
myDayNight = 0;
myLootClrTime = 12;
myLootCount = 0; //


diag_log "*** start selectparam.sqf";
_tmpb = time;
while {!(sparamOk)} do {
    [] call compile preprocessFile "selectparam.sqf";
};
*/

_tmpb = time - _timepb;
_tmp1 = (_tmpb - floor( _tmpb )) * 100;
for "_i" from 0 to _tmp1 do { _tmp = random 1; };

[] call compile preprocessFile "playerequip.sqf";
player setVariable ["unitype", 0];
player setRank "CAPTAIN";
//
myMinCars = 0;
myMaxCars = 20;
myBanditCar = 10;
myMinHely = 0;
myMaxHely = 10;
myMinBoat = 0;
myMaxBoat = 1;
myMinTent = 0;
myMaxTent = 1;

myVeh = [];
myCars = [];
myBCars = [];
myHelyVeh = [];
myBoat = [];
myTents = [];
myCheckBCarsTime = time + 120;

[myTired] call compile preprocessFile "R3F_Realism\R3F_SetMode.sqf";
[] execVM "R3F_Realism\R3F_Realism_Init.sqf";

[] call compile preprocessFile  "respawnvehicles.sqf";
[] execVM "mymonitor.sqf";
[] execVM "spawnpatrols.sqf";

[] call compile preprocessFileLineNumbers "DZAI\init\dzai_initserver.sqf";
[] execVM "DZMS\DZMSInit.sqf";

allowConnection = true;

[] ExecVM "WAI\init.sqf";

//Tow and lift
execVM "R3F_ARTY_AND_LOG\init.sqf";
[] execVM "Scripts\kh_actions.sqf";

myEquipSost = 1;
myLastSavePos = getMarkerPos "hely1";
if(myEquip > 0) then {
    myEquipSost = 0;
    enableSaving [false, true];
};
//
//[] execvm "getall.sqf";
diag_log "*** end init.sqf";