Jump to content

godmode8

Member
  • Posts

    34
  • Joined

  • Last visited

Posts posted by godmode8

  1. 16 hours ago, Mig said:

    what exactly do you want, I did not understand your request

     

    when a player enters the server near a certain object, he must be teleported to certain coordinates. I am writing through a translator, sorry

  2.  

    Hello. I want to make a teleport from a certain object at the entrance to specific coordinates with a certain radius. 

    For example, the player enters the item "Veins", we tilt it to the coordinates [22491.3,20059.3,0.001] with a radius of 150. Tried to do through server_PlayerLogin
    Spoiler

    if (!_isNew) then {
        //RETURNING CHARACTER
        _inventory = _primary select 4;
        _backpack = _primary select 5;
        _survival = _primary select 6;
        _model = _primary select 7;
        _hiveVer = _primary select 8;
        if !(_model in AllPlayers) then {_model = "Survivor2_DZ";};
        if ((count nearestObjects [_playerObj, ["%ClassnameItem%"], 60]) > 0) then {
            _newPos = [(getPosATL _playerObj), 80, 100, 10, 0, 20, 0] call BIS_fnc_findSafePos;
            _playerObj setPosATL _newPos;
        }

    } else {
        _model = _primary select 3;
        _hiveVer = _primary select 4;
        if (isNil "_model") then {
            _model = "Survivor2_DZ";
        } else {
            if (_model == "") then {_model = "Survivor2_DZ";};
        };

        //Record initial inventory
        _config = configFile >> "CfgSurvival" >> "Inventory" >> "Default";
        _mags = getArray (_config >> "magazines");
        _wpns = getArray (_config >> "weapons");
        _bcpk = getText (_config >> "backpack");

        //Wait for HIVE to be free
        _key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
        _key call server_hiveWrite;

    };

    but failed. I ask for help.
  3. Spoiler

    private ["_timer","_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot","_loot2", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint"];
    _spawnChance     =      0.65;    
    _markerRadius     =     250;    
    _debug         =     false;     
    _time_array = [10,15,20,21,22,23,24,25,30]; 
     
    _loot_box = "USVehicleBox";    

    _loot_lists =             
    [
        [
            ["M9SD","FN_FAL","M4A3_CCO_EP1","AKS_74_kobra","Sa58V_RCO_EP1","ItemEtool","ItemCrowbar","ItemKnife","ItemSledge","ItemCompass","Binocular","Binocular_Vector","NVGoggles","ItemGPS"],
            ["150Rnd_127x107_DSHKM","20Rnd_762x51_FNFAL","20Rnd_762x51_FNFAL","20Rnd_762x51_FNFAL","30Rnd_762x39_SA58","30Rnd_762x39_SA58","30Rnd_762x39_SA58","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_545x39_AK","30Rnd_545x39_AK","30Rnd_545x39_AK","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD"]
        ],
        [
            ["M4A1_HWS_GL_SD_Camo","M16A2GL","M16A4","M16A4_GL","M16A4_ACG_GL","M16A4_ACG","M4A1","M4A1_HWS_GL","M4A1_HWS_GL_camo","M4A1_HWS_GL_SD_Camo","M4A1_RCO_GL","M4A1_Aim","M4A1_Aim_camo","M4A1_AIM_SD_camo"],
            ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor"]
        ],
        [
            ["ItemToolbox","M4A1_HWS_GL_SD_Camo","M16A2GL","M16A4","M16A4_GL","M16A4_ACG_GL","M16A4_ACG","M4A1","M4A1_HWS_GL","M4A1_HWS_GL_camo","M4A1_HWS_GL_SD_Camo","M4A1_RCO_GL","M4A1_Aim","M4A1_Aim_camo","M4A1_AIM_SD_camo"],
            ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor"]
        ],
        [
            ["ChainSaw"],
            ["ItemCorrugated","ItemCorrugated","ItemCorrugated","ItemCorrugated","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemComboLock","ItemBriefcase_Base","ItemGenerator"]
        ],
        [
            ["m240_scoped_EP1_DZE","Mk_48_DZ","M240_DZ","RPK_74"],
            ["100Rnd_762x51_M240","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_762x51_M240","100Rnd_762x51_M240","200Rnd_556x45_M249","2000Rnd_762x51_M134","2000Rnd_762x51_M134","ItemAVE","ItemLRK","ItemTNK","ItemARM","ItemORP","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked"]
        ],
        [
            ["M4A1_HWS_GL_SD_Camo","M16A2GL","M16A4","M16A4_GL","M16A4_ACG_GL","M16A4_ACG","M4A1","M4A1_HWS_GL","M4A1_HWS_GL_camo","M4A1_HWS_GL_SD_Camo","M4A1_RCO_GL","M4A1_Aim","M4A1_Aim_camo","M4A1_AIM_SD_camo"],
            ["30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","FoodCanFrankBeans","FoodCanFrankBeans","FoodCanBakedBeans","FoodMRE","HandGrenade_east","2000Rnd_762x51_M134","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks"]
        ],
        [
            ["VSS_vintorez","Saiga12K","M8_compact"],
            ["30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","HandGrenade_east","HandGrenade_east","FoodCanSardines","FoodMRE","FoodPistachio","FoodNutmix","FoodMRE","FoodPistachio","FoodNutmix","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks"]
        ]
    ];
    _loot     =     _loot_lists call BIS_fnc_selectRandom;
    _loot2     =     _loot_lists call BIS_fnc_selectRandom;

    _loot_amount     =     75;       
    _wait_time     =     900;        
    _start_time     =     time;
    _spawnRadius     =     6000;        
    _spawnMarker     =     'center';
     
    if (isNil "EPOCH_EVENT_RUNNING") then 
    {
        EPOCH_EVENT_RUNNING = false;
    };
     

    if (EPOCH_EVENT_RUNNING) exitWith 
    {
        diag_log("[Сервер] - [Ивент] - [Взрывной ящик с лутом]: Ивент уже запущен!");
    };

    EPOCH_EVENT_RUNNING = true;


    _spawnRoll = random 1;
    if (_spawnRoll > _spawnChance and !_debug) exitWith {};
     

    _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
     
    diag_log(format["[Сервер] - [Ивент] - [Взрывной ящик с лутом]: Спавним ивент на позиции: %1", _position]);

    _event_marker = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
    _event_marker setMarkerShape "ELLIPSE";
    _event_marker setMarkerType "Cricle01";
    _event_marker setMarkerColor "ColorBlack";
    _event_marker setMarkerAlpha 0.8;
    _event_marker setMarkerBrush "DiagGrid";
    _event_marker setMarkerSize [(_markerRadius + 50), (_markerRadius + 50)];
     
    _loot_pos = [_position,0,(_markerRadius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
     
    if (_debug) then 
    {
        _debug_marker = createMarker [ format ["loot_event_debug_marker_%1", _start_time], _loot_pos];
        _debug_marker setMarkerText "Взрывной ящик";
        _debug_marker setMarkerShape "ICON";
        _debug_marker setMarkerType "SupplyVehicle";
        _debug_marker setMarkerColor "ColorRed";
        _debug_marker setMarkerAlpha 1;
        _debug_marker setMarkerSize [1,1];
    };
     
    diag_log(format["[Сервер] - [Ивент] - [Взрывной ящик с лутом]: Создание ящика на позиции: %1", _loot_pos]);
     
    _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
    clearMagazineCargoGlobal _loot_box;
    clearWeaponCargoGlobal _loot_box;
    _loot_box setVariable ["permaLoot",true];
     

    _clutter = createVehicle ["ClutterCutter_small_2_EP1", _loot_pos, [], 0, "CAN_COLLIDE"];
    _clutter setPos _loot_pos;
     
    {
        _loot_box addWeaponCargoGlobal [_x,1];
    } forEach (_loot select 0);
    {
        _loot_box addMagazineCargoGlobal [_x,1];
    } forEach (_loot select 1);
    {
        _loot_box addWeaponCargoGlobal [_x,1];
    } forEach (_loot2 select 0);
    {
        _loot_box addMagazineCargoGlobal [_x,1];
    } forEach (_loot2 select 1);
     

    _hint = parseText format["<t align='center' color='#0D00FF' shadow='2' size='1.75'>Заминированный ящик</t><br/><t align='center' color='#ffffff'>Проверьте карту!</t>"];
    customRemoteMessage = ['hint', _hint];
    publicVariable "customRemoteMessage";


    //[nil,nil,rTitleText,"Ящик с лутом!, Проверьте карту!", "PLAIN",10] call RE; 

    diag_log(format["[Сервер] - [Ивент] - [Взрывной ящик с лутом]: Ивент установлен! Ожидаем %1 секунд", _wait_time]);

    waitUntil {{isPlayer _x && _x distance _loot_box < 5} count playableunits > 0};

    _count = floor( random(count _time_array));
    _timer = _time_array select _count;

    [nil,nil,rTitleText,format ["Таймер бомбы запущен!"], "PLAIN",10] call RE; 


    bombexp = 
    {
        _bomb         =     ["HelicopterExploSmall","HelicopterExploBig","Bo_GBU12_LGB"] call BIS_fnc_selectRandom;
        _dabomb     =     objNull;

        if (true) then
        {
            _this         =     createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
            _dabomb     =     _this;
        };
    };
     

    sleep 1;

    _mark         =     "RoadFlare" createVehicle getPosATL _loot_box;
    _mark attachTo [_loot_box, [0,0,-1]];
    _positionobj     =     getPosATL _loot_box;    

    sleep _timer;
    call bombexp;

    EPOCH_EVENT_RUNNING = false;

    deleteVehicle _mark;
    deleteVehicle _loot_box;
    deleteMarker _event_marker;

    if (_debug) then 
    {
        deleteMarker _debug_marker;
    };

     

  4. 5 hours ago, Mig said:

    Use this

      Reveal hidden contents
    
    
    private ["_timer","_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot","_loot2", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint","_time_array","_count"];
     
    _spawnChance =  0.70; // Percentage chance of event happening
    _markerRadius = 250; // Radius the loot can spawn and used for the marker
    _debug = true; // Puts a marker exactly were the loot spawns
    _time_array = [20,25,27,15,10,30,40,45,32,17,41,43,22]; // random time for the crate to explode
     
    _loot_box = "USVehicleBox";
    _loot_lists = [
    [
    ["M9SD","FN_FAL","M4A3_CCO_EP1","AKS_74_kobra","Sa58V_RCO_EP1","ItemEtool","ItemCrowbar","ItemKnife","ItemSledge","ItemCompass","Binocular","Binocular_Vector","NVGoggles","ItemGPS"],
    ["ItemBriefcase100oz","150Rnd_127x107_DSHKM","20Rnd_762x51_FNFAL","20Rnd_762x51_FNFAL","20Rnd_762x51_FNFAL","30Rnd_762x39_SA58","30Rnd_762x39_SA58","30Rnd_762x39_SA58","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_545x39_AK","30Rnd_545x39_AK","30Rnd_545x39_AK","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD"]
    ],
    [
    ["M4A1_HWS_GL_SD_Camo","M16A2GL","M16A4","M16A4_GL","M16A4_ACG_GL","M16A4_ACG","M4A1","M4A1_HWS_GL","M4A1_HWS_GL_camo","M4A1_HWS_GL_SD_Camo","M4A1_RCO_GL","M4A1_Aim","M4A1_Aim_camo","M4A1_AIM_SD_camo"],
    ["ItemBriefcase100oz","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor"]
    ],
    [
    ["ItemToolbox","M4A1_HWS_GL_SD_Camo","M16A2GL","M16A4","M16A4_GL","M16A4_ACG_GL","M16A4_ACG","M4A1","M4A1_HWS_GL","M4A1_HWS_GL_camo","M4A1_HWS_GL_SD_Camo","M4A1_RCO_GL","M4A1_Aim","M4A1_Aim_camo","M4A1_AIM_SD_camo"],
    ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor"]
    ],
    [
    ["ChainSaw"],
    ["ItemBriefcase100oz","ItemBriefcase100oz","ItemCorrugated","ItemCorrugated","ItemCorrugated","ItemCorrugated","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemComboLock","ItemGenerator"]
    ],
    [
    ["m240_scoped_EP1_DZE","Mk_48_DZ","M240_DZ","RPK_74"],
    ["ItemBriefcase100oz","100Rnd_762x51_M240","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_556x45_BetaCMag","100Rnd_762x51_M240","200Rnd_556x45_M249","100Rnd_762x51_M240","100Rnd_762x51_M240","200Rnd_556x45_M249","2000Rnd_762x51_M134","2000Rnd_762x51_M134","ItemAVE","ItemLRK","ItemTNK","ItemARM","ItemORP","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked","ItemSeaBassCooked"]
    ],
    [
    ["M4A1_HWS_GL_SD_Camo","M16A2GL","M16A4","M16A4_GL","M16A4_ACG_GL","M16A4_ACG","M4A1","M4A1_HWS_GL","M4A1_HWS_GL_camo","M4A1_HWS_GL_SD_Camo","M4A1_RCO_GL","M4A1_Aim","M4A1_Aim_camo","M4A1_AIM_SD_camo"],
    ["ItemBriefcase100oz","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","FoodCanFrankBeans","FoodCanFrankBeans","FoodCanBakedBeans","FoodMRE","HandGrenade_east","2000Rnd_762x51_M134","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks"]
    ],
    [
    ["VSS_vintorez","Saiga12K","M8_compact"],
    ["ItemBriefcase100oz","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","HandGrenade_east","HandGrenade_east","FoodCanSardines","FoodMRE","FoodPistachio","FoodNutmix","FoodMRE","FoodPistachio","FoodNutmix","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks"]
    ]
    ];
    _loot = _loot_lists call BIS_fnc_selectRandom;
    _loot2 = _loot_lists call BIS_fnc_selectRandom;
    
    _loot_amount = 75;
    _wait_time = 900;
     
    // Dont mess with theses unless u know what yours doing
    _start_time = time;
    _spawnRadius = 5000;
    _spawnMarker = 'center';
     
    if (isNil "EPOCH_EVENT_RUNNING") then {
    EPOCH_EVENT_RUNNING = false;
    };
     
    // Check for another event running
    if (EPOCH_EVENT_RUNNING) exitWith {
    diag_log("Event already running");
    };
    
    EPOCH_EVENT_RUNNING = true;
    
    // Random chance of event happening
    _spawnRoll = random 1;
    if (_spawnRoll > _spawnChance and !_debug) exitWith {};
     
    // Random location
    _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
     
    diag_log(format["Spawning loot event at %1", _position]);
    
    _event_marker = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
    _event_marker setMarkerShape "ELLIPSE";
    _event_marker setMarkerType "Cricle01";
    _event_marker setMarkerColor "ColorBlack";
    _event_marker setMarkerAlpha 0.8;
    _event_marker setMarkerBrush "DiagGrid";
    _event_marker setMarkerSize [(_markerRadius + 50), (_markerRadius + 50)];
     
    _loot_pos = [_position,0,(_markerRadius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
     
    if (_debug) then {
    _debug_marker = createMarker [ format ["loot_event_debug_marker_%1", _start_time], _loot_pos];
    _debug_marker setMarkerText "BOMBCRATE";
    _debug_marker setMarkerShape "ICON";
    _debug_marker setMarkerType "SupplyVehicle";
    _debug_marker setMarkerColor "ColorRed";
    _debug_marker setMarkerAlpha 1;
    _debug_marker setMarkerSize [1,1];
    };
     
    diag_log(format["Creating ammo box at %1", _loot_pos]);
     
    // Create ammo box
    _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
    clearMagazineCargoGlobal _loot_box;
    clearWeaponCargoGlobal _loot_box;
    _loot_box setVariable ["permaLoot",true];
     
    // Cut the grass around the loot position
    _clutter = createVehicle ["ClutterCutter_small_2_EP1", _loot_pos, [], 0, "CAN_COLLIDE"];
    _clutter setPos _loot_pos;
    // cut the grass    end
     
    // Add loot
    {
    _loot_box addWeaponCargoGlobal [_x,1];
    } forEach (_loot select 0);
    {
    _loot_box addMagazineCargoGlobal [_x,1];
    } forEach (_loot select 1);
    {
    _loot_box addWeaponCargoGlobal [_x,1];
    } forEach (_loot2 select 0);
    {
    _loot_box addMagazineCargoGlobal [_x,1];
    } forEach (_loot2 select 1);
     
    // Send Top Right message to users , requires Remote message script
    //_hint = parseText format["<t align='center' color='#0D00FF' shadow='2' size='1.75'>Supply Crate</t><br/><t align='center' color='#ffffff'>THERS A BOMB CRATE!, Check your Map for the Location!</t>"];
    //customRemoteMessage = ['hint', _hint];
    //publicVariable "customRemoteMessage";
    
    // Send center message to users
    [nil,nil,rTitleText,"THERS A BOMB CRATE!, Check your Map for the Location!", "PLAIN",10] call RE;
    diag_log(format["Loot event setup, waiting for %1 seconds", _wait_time]);
    
    waitUntil{{isPlayer _x && _x distance _loot_box < 3  } count playableunits > 0};
    
    _count = floor( random(count _time_array));
    _timer = _time_array select _count;   
    
    [nil,nil,rTitleText,format ["BOMBCRATE IS ACTIVE NOW %1 SECONDS BEFORE EXPLODE!",_timer], "PLAIN",10] call RE;
    
    //#############################CREATE THE BOMB FUNCTION TO EXPLODE############################//
    bombexp = {
    _bomb = ["HelicopterExploSmall","HelicopterExploBig","Bo_GBU12_LGB"] call BIS_fnc_selectRandom;
    _dabomb = objNull;
    if (true) then
    {
    _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
    _dabomb = _this;
    };
    };
    //############################EXIT FROM HERE#################################################//
    
    sleep 1;
    
    _mark = "RoadFlare" createVehicle getPosATL _loot_box;
    _mark attachTo [_loot_box, [0,0,-1]];
    _positionobj = getPosATL _loot_box;    
    
    sleep _timer;
    call bombexp;
    
    // Clean up
    EPOCH_EVENT_RUNNING = false;
    deleteVehicle _mark;
    deleteVehicle _loot_box;
    deleteMarker _event_marker;
    if (_debug) then {
    deleteMarker _debug_marker;
    };

     

     

    Spoiler

    16:11:12   Error Missing ;
    16:11:12 File z\addons\dayz_server\modules\BombBox.sqf, line 131
    16:11:12 Error in expression <unt _time_array));
    _timer = _time_array select _count;

    [nil,nil,rTitleText,f>
     

     

  5. 40 minutes ago, Cherdenko said:

    could you post your mission.sqm in here?

    or did you do any changes to it?

     

    The standard file is unchanged. I'm trying to run a pirated server on BetaPath 112555, I think the whole thing is in it. 
    On another resource, I read that it's impossible to run 1.0.6.x on an old beta.
    Spoiler

    version=11;
    class Mission
    {
        addOns[]=
        {
            "chernarus",
            "map_eu",
            "ca_modules_animals",
            "dayz_anim",
            "dayz_code",
            "dayz_communityassets",
            "dayz_weapons",
            "dayz_equip",
            "cacharacters_pmc",
            "ca_modules_functions",
            "zero_buildings",
            "dayz_epoch",
            "glt_m300t",
            "pook_h13",
            "csj_gyroac",
            "jetskiyanahuiaddon",
            "redryder",
            "Anzio_20"
        };
        addOnsAuto[]=
        {
            "dayz_weapons",
            "ca_modules_functions",
            "chernarus"
        };
        randomSeed=11171215;
        class Intel
        {
            briefingName="DayZ Epoch Chernarus";
            briefingDescription="Version 1.0.6.2";
            startWeather=0;
            forecastWeather=0;
            year=2008;
            month=10;
            day=1;
            hour=12;
        };
        class Groups
        {
            items=2;
            class Item0
            {
                side="WEST";
                class Vehicles
                {
                    items=100;
    #define PLRDEF position[]={-18700,0,25800};azimut=0;side="WEST";vehicle="Survivor1_DZ";skill=0.6;init="this enableSimulation false;this allowDamage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";player="PLAY CDG";
                    class Item0{id=0;PLRDEF};
                    class Item1
                    {
                        position[]={-18700,0,25800};
                        azimut=0;
                        id=0;
                        side="WEST";
                        vehicle="Survivor1_DZ";
                        player="PLAYER COMMANDER";
                        leader=1;
                        rank="SERGEANT";
                        skill=0.6;
                        init="this enableSimulation false;this allowDamage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";
                    };
                    class Item2{id=2;PLRDEF};
                    class Item3{id=3;PLRDEF};
                    class Item4{id=4;PLRDEF};
                    class Item5{id=5;PLRDEF};
                    class Item6{id=6;PLRDEF};
                    class Item7{id=7;PLRDEF};
                    class Item8{id=8;PLRDEF};
                    class Item9{id=9;PLRDEF};
                    class Item10{id=10;PLRDEF};
                    class Item11{id=11;PLRDEF};
                    class Item12{id=12;PLRDEF};
                    class Item13{id=13;PLRDEF};
                    class Item14{id=14;PLRDEF};
                    class Item15{id=15;PLRDEF};
                    class Item16{id=16;PLRDEF};
                    class Item17{id=17;PLRDEF};
                    class Item18{id=18;PLRDEF};
                    class Item19{id=19;PLRDEF};
                    class Item20{id=20;PLRDEF};
                    class Item21{id=21;PLRDEF};
                    class Item22{id=22;PLRDEF};
                    class Item23{id=23;PLRDEF};
                    class Item24{id=24;PLRDEF};
                    class Item25{id=25;PLRDEF};
                    class Item26{id=26;PLRDEF};
                    class Item27{id=27;PLRDEF};
                    class Item28{id=28;PLRDEF};
                    class Item29{id=29;PLRDEF};
                    class Item30{id=30;PLRDEF};
                    class Item31{id=31;PLRDEF};
                    class Item32{id=32;PLRDEF};
                    class Item33{id=33;PLRDEF};
                    class Item34{id=34;PLRDEF};
                    class Item35{id=35;PLRDEF};
                    class Item36{id=36;PLRDEF};
                    class Item37{id=37;PLRDEF};
                    class Item38{id=38;PLRDEF};
                    class Item39{id=39;PLRDEF};
                    class Item40{id=40;PLRDEF};
                    class Item41{id=41;PLRDEF};
                    class Item42{id=42;PLRDEF};
                    class Item43{id=43;PLRDEF};
                    class Item44{id=44;PLRDEF};
                    class Item45{id=45;PLRDEF};
                    class Item46{id=46;PLRDEF};
                    class Item47{id=47;PLRDEF};
                    class Item48{id=48;PLRDEF};
                    class Item49{id=49;PLRDEF};
                    class Item50{id=50;PLRDEF};
                    class Item51{id=51;PLRDEF};
                    class Item52{id=52;PLRDEF};
                    class Item53{id=53;PLRDEF};
                    class Item54{id=54;PLRDEF};
                    class Item55{id=55;PLRDEF};
                    class Item56{id=56;PLRDEF};
                    class Item57{id=57;PLRDEF};
                    class Item58{id=58;PLRDEF};
                    class Item59{id=59;PLRDEF};
                    class Item60{id=60;PLRDEF};
                    class Item61{id=61;PLRDEF};
                    class Item62{id=62;PLRDEF};
                    class Item63{id=63;PLRDEF};
                    class Item64{id=64;PLRDEF};
                    class Item65{id=65;PLRDEF};
                    class Item66{id=66;PLRDEF};
                    class Item67{id=67;PLRDEF};
                    class Item68{id=68;PLRDEF};
                    class Item69{id=69;PLRDEF};
                    class Item70{id=70;PLRDEF};
                    class Item71{id=71;PLRDEF};
                    class Item72{id=72;PLRDEF};
                    class Item73{id=73;PLRDEF};
                    class Item74{id=74;PLRDEF};
                    class Item75{id=75;PLRDEF};
                    class Item76{id=76;PLRDEF};
                    class Item77{id=77;PLRDEF};
                    class Item78{id=78;PLRDEF};
                    class Item79{id=79;PLRDEF};
                    class Item80{id=80;PLRDEF};
                    class Item81{id=81;PLRDEF};
                    class Item82{id=82;PLRDEF};
                    class Item83{id=83;PLRDEF};
                    class Item84{id=84;PLRDEF};
                    class Item85{id=85;PLRDEF};
                    class Item86{id=86;PLRDEF};
                    class Item87{id=87;PLRDEF};
                    class Item88{id=88;PLRDEF};
                    class Item89{id=89;PLRDEF};
                    class Item90{id=90;PLRDEF};
                    class Item91{id=91;PLRDEF};
                    class Item92{id=92;PLRDEF};
                    class Item93{id=93;PLRDEF};
                    class Item94{id=94;PLRDEF};
                    class Item95{id=95;PLRDEF};
                    class Item96{id=96;PLRDEF};
                    class Item97{id=97;PLRDEF};
                    class Item98{id=98;PLRDEF};
                    class Item99{id=99;PLRDEF};
                };
            };
            class Item1
            {
                side="LOGIC";
                class Vehicles
                {
                    items=1;
                    class Item0
                    {
                        position[]={708,35,3533};
                        id=50;
                        side="LOGIC";
                        vehicle="FunctionsManager";
                        leader=1;
                        lock="UNLOCKED";
                        skill=0.6;
                    };
                };
            };
        };
        class Markers
        {
            items=20;
            class Item0
            {
                position[]={7839,0,8414};
                name="center";
                type="Empty";
                a=7500;b=7000;
            };
            class Item1
            {
                position[]={-18700,0,25800};
                name="respawn_west";
                type="Empty";
            };
            class Item2
            {
                position[]={4932,0,1989};
                name="spawn0"; //spawn_balota
                type="Empty";
            };
            class Item3
            {
                position[]={2236,0,1923};
                name="spawn1"; //spawn_kamenka
                type="Empty";
            };
            class Item4
            {
                position[]={6901,0,2509}; //8738,0,2122
                name="spawn2"; //spawn_cherno
                type="Empty";
            };
            class Item5
            {
                position[]={10294,0,2191}; // OLD 10909,0,2422
                name="spawn3"; //spawn_elektro
                type="Empty";
            };
            class Item6
            {
                position[]={13510,0,5249};
                name="spawn4"; //spawn_sol
                type="Empty";
            };
            class Item7
            {
                position[]={12048,0,8352};
                name="spawn5"; //spawn_berezino
                type="Empty";
            };
            class Item8
            {
                position[]={7049,0,9241};
                name="crashsites";
                type="Empty";
                a=4880;b=7000;
            };
            class Item9
            {
                position[]={7542,0,7134};
                name="carepackages";
                type="Empty";
                a=6150;b=0;
            };
            class Item10
            {
                position[]={6326,304,7809};
                name="Tradercitystary";
                text="Trader City Stary";
                type="mil_circle";
                colorName="ColorBlack";
            };
            class Item11
            {
                position[]={4361,3,2259};
                name="wholesaleSouth";
                text="Wholesaler";
                type="mil_dot";
                colorName="ColorBlack";
            };
            class Item12
            {
                position[]={13532,3,6355};
                name="boatTraderEast";
                text="Wholesaler";
                type="mil_dot";
                colorName="ColorBlack";
            };
            class Item13
            {
                position[]={7989,0,2900};
                name="BoatDealerSouth";
                text="Boat Dealer";
                type="mil_dot";
                colorName="ColorBlack";
            };
            class Item14
            {
                position[]={12060,158,12638};
                name="AirVehicles";
                text="Aircraft Dealer";
                type="mil_dot";
                colorName="ColorGreen";
            };
            class Item15
            {
                position[]={1606,289,7803};
                name="BanditDen";
                text="Bandit Camp";
                type="mil_dot";
                colorName="ColorRed";
            };
            class Item16
            {
                position[]={11447,317,11364};
                name="Klen";
                text="Trader City Klen";
                type="mil_circle";
                colorName="ColorGreen";
            };
            class Item17
            {
                position[]={13441,1,5429};
                name="BoatDealerEast";
                text="Boat Dealer";
                type="mil_dot";
                colorName="ColorBlack";
            };
            class Item18
            {
                position[]={4064,365,11665};
                name="TradercityBash";
                text="Trader City Bash";
                type="mil_circle";
                colorName="ColorBlack";
            };
            class Item19
            {
                position[]={12944,210,12766};
                name="HeroTrader";
                text="Hero Camp";
                type="mil_dot";
                colorName="ColorBlue";
            };
        };
        class Sensors
        {
            items=6;
    #define TRGDEF a=100;b=100;activationBy="WEST";repeating=1;interruptable=1;age="UNKNOWN";class Effects{};
            class Item0
            {
                position[]={6325,304,7807};
                TRGDEF
                name="zonestary";
                expCond="(player distance zonestary) < 100;";
                expActiv="[""trader city Stary"",true,""enter""] call player_traderCity;";
                expDesactiv="[""trader city Stary"",true,""leave""] call player_traderCity;";
            };
            class Item1
            {
                position[]={4063,365,11664};
                TRGDEF
                name="zonebash";
                expCond="(player distance zonebash) < 100;";
                expActiv="[""trader city Bash"",true,""enter""] call player_traderCity;";
                expDesactiv="[""trader city Bash"",true,""leave""] call player_traderCity;";
            };
            class Item2
            {
                position[]={11447,317,11364};
                TRGDEF
                name="zoneklen";
                expCond="(player distance zoneklen) < 100;";
                expActiv="[""trader city Klen"",true,""enter""] call player_traderCity;";
                expDesactiv="[""trader city Klen"",true,""leave""] call player_traderCity;";
            };
            class Item3
            {
                position[]={1606,289,7803};
                TRGDEF
                name="zonebandit";
                expCond="(player distance zonebandit) < 100;";
                expActiv="[""Bandit Trader"",false,""enter""] call player_traderCity;";
                expDesactiv="[""Bandit Trader"",false,""leave""] call player_traderCity;";
            };
            class Item4
            {
                position[]={12944,210,12766};
                TRGDEF
                name="zonehero";
                expCond="(player distance zonehero) < 100;";
                expActiv="[""Hero Trader"",false,""enter""] call player_traderCity;";
                expDesactiv="[""Hero Trader"",false,""leave""] call player_traderCity;";
            };
            class Item5
            {
                position[]={12060,158,12638}; 
                TRGDEF
                name="zoneaircraft";
                expCond="(player distance zoneaircraft) < 100;";
                expActiv="[""Aircraft Trader"",false,""enter""] call player_traderCity;";
                expDesactiv="[""Aircraft Trader"",false,""leave""] call player_traderCity;";
            };
        };
    };
    class Intro
    {
        addOns[]=
        {
            "chernarus"
        };
        addOnsAuto[]=
        {
            "chernarus"
        };
        randomSeed=6913869;
        class Intel
        {
            startWeather=0;
            forecastWeather=0;
            year=2008;
            month=10;
            day=11;
            hour=9;
            minute=20;
        };
    };
    class OutroWin
    {
        addOns[]=
        {
            "chernarus"
        };
        addOnsAuto[]=
        {
            "chernarus"
        };
        randomSeed=4081731;
        class Intel
        {
            startWeather=0;
            forecastWeather=0;
            year=2008;
            month=10;
            day=11;
            hour=9;
            minute=20;
        };
    };
    class OutroLoose
    {
        addOns[]=
        {
            "chernarus"
        };
        addOnsAuto[]=
        {
            "chernarus"
        };
        randomSeed=4975929;
        class Intel
        {
            startWeather=0;
            forecastWeather=0;
            year=2008;
            month=10;
            day=11;
            hour=9;
            minute=20;
        };
    };
     

     

  6. On 28.03.2014 at 3:11 PM, grafzahl said:

     

    Insert this to the client-only part of your init.sqf or put it in an external sqf-file and execute it via execVM-Call:

     

    
    "dayzEpochRmvWreck" addPublicVariableEventHandler {
    	private["_list","_iPos","_iType"];
    	_iType = (_this select 1) select 1;
    	_iPos = (_this select 1) select 0;
    	_list = nearestObjects [_iPos, [_iType], 3];
    	{deleteVehicle _x;} foreach _list;
    };

    I gues you already use a customized remove.sqf? Then here are my changes...

     

    Find the line that says "sleep 0.1;", BEFORE this line you add the following:

    
    private["_notNearestPlayer"];
    _notNearestPlayer = _obj call dze_isnearest_player;
    if (_notNearestPlayer) then {
    	cutText ["Another player is to close - Canceled deconstruction", "PLAIN DOWN"];
    	r_doLoop = false;
    };

    Now search for the line that says

    
    if (_isMine) then {

    and after it you insert:

    
    dayzEpochRmvWreck = [getPos _obj,_objType];
    publicVariable "dayzEpochRmvWreck";

    I hope i havent forgot anything, ah... you need to adjust your publicvariable.txt of battleye... just add !="dayzEpochRmvWreck" to the first kick-line.

    Works on an epoch, but does not work on overpoch :(
  7. Hello. I found 2 bugs in version 1.0.5.1 and I do not know how to fix it.

    Bug # 1: When removing a 30m plot, you can open inventory and move tools and a crowbar into the backpack. You can not be afraid that they will break.

     

    Bug # 2: I use a custom script that forbids the opening of the inventory of closed transport. fn_gearMenuChecks.sqf

    Spoiler
    
    private ["_display","_typeoftech"];
    disableSerialization;
    _display = (_this select 0);
    GearStorags = ["WeaponHolder","WoodCrate_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","VaultStorage","LockboxStorage"]; 
     
    if (isNil "counterattemptsbuguse") then {counterattemptsbuguse = 0};
     
    {
        if ( (locked _x) && !((typeOF cursorTarget) in GearStorags) ) exitWith
            {
                cutText [(localize "str_epoch_player_7") , "PLAIN DOWN"];
                counterattemptsbuguse = counterattemptsbuguse + 1;
                _typeoftech = typeOF _x;
                _display closeDisplay 1;
            };
    } count (player nearEntities [["LandVehicle", "Air", "Ship"], 12]);
     
    if (counterattemptsbuguse > 2) then {
        PVDZE_atp = format["Игрок %1(%2) пытается открыть инвентарь закрытой техники %3. Координаты: %4",name player,getPlayerUID player,_typeoftech,mapGridPosition(getPosATL player)];
        publicVariableServer "PVDZE_atp";
        counterattemptsbuguse = 0;
    };

     

    The problem is that if there is one weapon in the transport, you can take it through the menu, turning the mouse wheel (Link to Menu) . Players learned to duping this way.

    Is there a solution to these problems? I will be grateful for any help.

    Sorry for mistakes, I'm writing through a translator.

  8. Fix:

    create custom player_lockVault

    add

    if ({isPlayer _x} count (player nearEntities ["Man", 10]) > 1) exitWith { cutText [format["Anti-Dupe: You text"], "PLAIN DOWN"]; }; 

    under

    if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_10") , "PLAIN DOWN"]; };

     

  9.  

    Hello. I found dupe on server.

    We need 2 players, 1 safe.

    1 player opens the safe and departs from it by 5 meters

    2 player starts to pack safe

    1 player runs up and closes the safe.

    Get 2 safes with the same loot.

    Fix: Cancel pack safe when within a radius of 10 meters there is a player or cancellation 5 second delay before packaging. Code poorly understand, need your help. I am writing through an interpreter, sorry.

  10. 2 hours ago, juandayz said:

    well i found the call for this sqf @godmode8 .. is into compiles.sqf (but you will need make a custom compiles.sqf)

    If you dont have a custom compiles.sqf  open your @Epoch\dayz_code\init\  copy and paste compiles.sqf to Mpmissions\your instance\   then open your init.sqf  find this line:

    call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

    Change by:

    call compile preprocessFileLineNumbers "compiles.sqf";

     

     

    Once you have it.. open your custom compiles.sqf and find:

    epoch_returnChange =            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
     

    change this line by:

    epoch_returnChange =            compile preprocessFileLineNumbers "epoch_returnChange.sqf";

    Now copy and paste "epoch_returnChange.sqf" to Mpmissions\yourinstance\

    Then open "epoch_returnChange.sqf" and make the change to test:

      Hide contents

    if (_briefcase_100oz > 0) then {
                for "_x" from 1 to _briefcase_100oz do {
                    player addMagazine "ItemBriefcase100oz";
                     if( !isNull (FindDisplay 106) ) then {
            
                (FindDisplay 106) closeDisplay 1;

               sleep 1;
                systemChat format["Inventory was closed to prevent any dupe"];//put your own text
            };

                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
                };
            };


      


    Friend, I know how to make a custom compiles the file and know how to make changes . This code is not running. If you doubt this , here are screenshots and videos .

    Spoiler

     

    c6S8mpI.png

     

    lgBGMcR.png

     

     


     

     

  11. 1 hour ago, juandayz said:

    do you wanna close inventory once you extract the gold from briefcase right?

    yes! 
    or cancel the animation "Medic"

    1 hour ago, juandayz said:

    why you not try using the seleenaparat way in your old post?

    I understand very bad scripts

    1 hour ago, juandayz said:

      if (_briefcase_100oz > 0) then {
                for "_x" from 1 to _briefcase_100oz do {
                    player addMagazine "ItemBriefcase100oz";
                     if( !isNull (FindDisplay 106) ) then {
            
                (FindDisplay 106) closeDisplay 1;

               sleep 1;
                systemChat format["Inventory was closed to prevent any dupe"];//put your own text
            };
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
                };
            };

    not worked again

  12. 18 hours ago, juandayz said:

    you can try add a close display in each case (bellow each "addMagazine" )

    for example

      Hide contents

    if (_briefcase_100oz > 0) then {
                for "_x" from 1 to _briefcase_100oz do {
                    player addMagazine "ItemBriefcase100oz";
                    (FindDisplay 106) closeDisplay 1;
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
                };
            };

     

    unfortunately it does not work :sad:

  13.  

    Tell me, how can this script to cancel the animation? It is necessary that the analysis of the case was immediate.

    epoch_returnChange.sqf

    Spoiler

    // Made for DayZ Epoch by vbawol 

    private ["_trade_total","_part_inWorth","_part_in_configClass","_total_currency","_part","_worth","_return_change","_total","_briefcase_100oz","_gold_10oz_a","_gold_10oz_b","_gold_10oz","_gold_1oz_a","_gold_1oz_b","_gold_1oz","_silver_10oz_a","_silver_10oz_b","_silver_10oz","_silver_1oz_a","_silver_1oz_b","_silver_1oz","_successful","_buyOrSell","_total_items"];
    _successful = false;
    _canAfford = false;

    _buyOrSell = (_this select 1);

    //diag_log format["DEBUG TRADER INPUT: %1", (_this select 0)];

    // buying in currency
    _trade_total = (_this select 0) call epoch_itemCost;

    //diag_log format["DEBUG TRADER INPUT TOTAL: %1", _trade_total];

    _total_currency_dry = call epoch_totalCurrency;

    _return_change_dry = 0;
    if (_buyOrSell == 0) then {
        //buy
        _return_change_dry = _total_currency_dry - _trade_total; 
    } else {
        //sell
        _return_change_dry = _total_currency_dry + _trade_total; 
    };

    //diag_log format["DEBUG TRADER DRY: %1", _return_change_dry];

    if (_return_change_dry >= 0) then {
        _canAfford = true;
    };

    if (_canAfford) then {

        // total currency
        _total_currency = 0;
        {
            _part =  (configFile >> "CfgMagazines" >> _x);
            _worth =  (_part >> "worth");
            if isNumber (_worth) then {
                if (([player,_part,1] call BIS_fnc_invRemove) == 1) then {
                    _total_currency = _total_currency + getNumber(_worth);
                };
            };

        } count (magazines player);

        //diag_log format["DEBUG TRADER INPUT CURRENCY TOTAL: %1", _total_currency];

        _return_change = 0;
        if (_buyOrSell == 0) then {
            //buy
            _return_change = _total_currency - _trade_total; 
        } else {
            //sell
            _return_change = _total_currency + _trade_total; 
        };

        //diag_log format["DEBUG TRADER CHANGE: %1", _return_change];

        if (_return_change >= 0) then {
            
            // total currency
            _total = _return_change;

            _briefcase_100oz = floor(_total / 10000);

            _gold_10oz_a = floor(_total / 1000);
            _gold_10oz_b = _briefcase_100oz * 10;
            _gold_10oz = (_gold_10oz_a - _gold_10oz_b);

            _gold_1oz_a = floor(_total / 100);
            _gold_1oz_b = _gold_10oz_a * 10;
            _gold_1oz = (_gold_1oz_a - _gold_1oz_b);

            _silver_10oz_a = floor(_total / 10);
            _silver_10oz_b = _gold_1oz_a * 10;
            _silver_10oz = (_silver_10oz_a - _silver_10oz_b);

            _silver_1oz_a = floor(_total);
            _silver_1oz_b = _silver_10oz_a * 10;
            _silver_1oz = (_silver_1oz_a - _silver_1oz_b);


            if (_briefcase_100oz > 0) then {
                for "_x" from 1 to _briefcase_100oz do {
                    player addMagazine "ItemBriefcase100oz";
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
                };
            };
            if (_gold_10oz > 0) then {
                if (_gold_10oz == 1) then {
                    player addMagazine "ItemGoldBar10oz";
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _gold_10oz, "ItemGoldBar10z"];
                } else {
                    player addMagazine format["ItemBriefcase%1oz",floor(_gold_10oz*10)];
                    //diag_log format["DEBUG TRADER CHANG MADE: ItemBriefcase%1oz", floor(_gold_10oz*10)];
                };
            };
            if (_gold_1oz > 0) then {
                if (_gold_1oz == 1) then {
                    player addMagazine "ItemGoldBar";
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _gold_1oz, "ItemGoldBar"];
                } else {
                    player addMagazine format["ItemGoldBar%1oz",_gold_1oz];
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _gold_1oz, "ItemGoldBar"];
                };
            };
            if (_silver_10oz > 0) then {
                if (_silver_10oz == 1) then {
                    player addMagazine "ItemSilverBar10oz";
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _silver_10oz, "ItemSilverBar10oz"];
                } else {
                    player addMagazine format["ItemBriefcaseS%1oz",floor(_silver_10oz*10)];
                    //diag_log format["DEBUG TRADER CHANG MADE: ItemBriefcaseS%1oz", floor(_silver_10oz*10)];
                };
            };
            if (_silver_1oz > 0) then {
                if (_silver_1oz == 1) then {
                    player addMagazine "ItemSilverBar";
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _silver_1oz, "ItemSilverBar"];
                } else {
                    player addMagazine format["ItemSilverBar%1oz",_silver_1oz];
                    //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _silver_1oz, "ItemSilverBar"];
                };
            };
            _successful = true;
        };
    };
    _successful

     

×
×
  • Create New...