Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
torekss

Помогите сделать добычу авто

Подскажите пожалуйста как сделать автодобычу ресурсов до полного рюкзака! версия 3.1. 4. 8

Edited by torekss (see edit history)

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Подскажите пожалуйста как сделать автодобычу ресурсов до полного рюкзака! версия 3.1. 4. 8

Можно ваш файл fn_gather.sqf

Share this post


Link to post
Share on other sites





  • 0
if(isNil "life_action_gathering") then {life_action_gathering = false;};
private["_gather","_itemWeight","_diff","_itemName","_val","_resourceZones","_zone","_bool","_time","_cpUp","_profName","_data","_cP","_ui"];
_resourceZones = ["apple_1","apple_2","apple_3","apple_4","cucumber_1","cucumber_2","cucumber_3","cucumber_4","peaches_1","peaches_2","peaches_3","peaches_4","heroin_1","cocaine_1","weed_1","crystal_1"];
_zone = "";
_bool = true;
if(visiblemap) exitwith {};
if(life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming.
life_action_gathering = true;


//Find out what zone we're near
{
    if(player distance (getMarkerPos _x) < 30) exitWith {_zone = _x;};
} foreach _resourceZones;


if(_zone == "") exitWith {life_action_gathering = false;};


//Get the resource that will be gathered from the zone name...
switch(true) do {
    case (_zone in ["apple_1","apple_2","apple_3","apple_4"]): {_gather = "apple"; _val = 3;};
    case (_zone in ["peaches_1","peaches_2","peaches_3","peaches_4"]): {_gather = "peach"; _val = 3;};
    case (_zone in ["cucumber_1","cucumber_2","cucumber_3","cucumber_4"]): {_gather = "cucumber"; _val = 3;};
    case (_zone in ["heroin_1"]): {_gather = "heroinu"; _val = 1;};
    case (_zone in ["cocaine_1"]): {_gather = "cocaine"; _val = 1;};
    case (_zone in ["weed_1"]): {_gather = "cannabis"; _val = 1;};
    case (_zone in ["crystal_1"]): {_gather = "methu"; _val = 1;};
    default {""};
};
//gather check??
if(vehicle player != player) exitWith {life_action_gathering = false;};
_itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr;


_diff = [_gather,_val,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if(_diff == 0) exitWith {hint localize "STR_NOTF_InvFull";life_action_gathering = false;};
life_action_inUse = true;


_upp = format["Добываю %1",_itemName];
//Setup our progress bar.
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0;    
_time = 0.2;           
_cpUp = 0.02;
_profName = [_gather] call life_fnc_profType;
_data = missionNamespace getVariable (_profName);
if(_profName != "") then 
{
switch ( _data select 0 ) do
{
case 1: { _time = 0.2;};
case 2: { _time = 0.19;};
case 3: { _time = 0.18;};
case 4: { _time = 0.17;};
case 5: { _time = 0.16;};
case 6: { _time = 0.15;};
case 7: { _time = 0.14; };
case 8: { _time = 0.13;};
case 9: { _time = 0.12;};
case 10: { _time = 0.11;};
};
};
while{true} do
{
if(_bool) then {
                [] spawn {
                    _bool = false;
                    player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
                    sleep 2.5;
                    _bool = true;
                };
            };
sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {}; 
if(visiblemap) exitwith {};
if(life_interrupted) exitwith {};
if(!alive player) exitWith {};
};
if(!alive player) exitWith {life_action_inUse = false;life_action_gathering = false;};
if(visiblemap) exitwith {life_action_inUse = false;life_action_gathering = false;_ui = "osefStatusBar" call BIS_fnc_rscLayer;_ui cutRsc["osefStatusBar","PLAIN"];};
player playActionNow "stop";
if(life_interrupted) exitwith {life_action_inUse = false;life_interrupted= false;life_action_gathering = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"];_ui = "osefStatusBar" call BIS_fnc_rscLayer;_ui cutRsc["osefStatusBar","PLAIN"];};




if(([true,_gather,_diff] call life_fnc_handleInv)) then {
titleText[format[localize "STR_NOTF_Gather_Success",_itemName,_diff],"PLAIN"];
if( _profName != "" ) then {
[_profName,round ((random 3)+7)] call life_fnc_addExp;
};
};


life_action_gathering = false;
life_action_inUse = false;
_ui = "osefStatusBar" call BIS_fnc_rscLayer;_ui cutRsc["osefStatusBar","PLA
 

 

IN"];
Edited by TheFirstNoob
AAAAA! Пользуйтесь кодом! -_- (see edit history)

Share this post


Link to post
Share on other sites
  • 0

 

if(isNil "life_action_gathering") then {life_action_gathering = false;};
private["_gather","_itemWeight","_diff","_itemName","_val","_resourceZones","_zone","_bool","_time","_cpUp","_profName","_data","_cP","_ui"];
_resourceZones = ["apple_1","apple_2","apple_3","apple_4","cucumber_1","cucumber_2","cucumber_3","cucumber_4","peaches_1","peaches_2","peaches_3","peaches_4","heroin_1","cocaine_1","weed_1","crystal_1"];
_zone = "";
_bool = true;
if(visiblemap) exitwith {};
if(life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming.
life_action_gathering = true;


//Find out what zone we're near
{
    if(player distance (getMarkerPos _x) < 30) exitWith {_zone = _x;};
} foreach _resourceZones;


if(_zone == "") exitWith {life_action_gathering = false;};


//Get the resource that will be gathered from the zone name...
switch(true) do {
    case (_zone in ["apple_1","apple_2","apple_3","apple_4"]): {_gather = "apple"; _val = 3;};
    case (_zone in ["peaches_1","peaches_2","peaches_3","peaches_4"]): {_gather = "peach"; _val = 3;};
    case (_zone in ["cucumber_1","cucumber_2","cucumber_3","cucumber_4"]): {_gather = "cucumber"; _val = 3;};
    case (_zone in ["heroin_1"]): {_gather = "heroinu"; _val = 1;};
    case (_zone in ["cocaine_1"]): {_gather = "cocaine"; _val = 1;};
    case (_zone in ["weed_1"]): {_gather = "cannabis"; _val = 1;};
    case (_zone in ["crystal_1"]): {_gather = "methu"; _val = 1;};
    default {""};
};
//gather check??
if(vehicle player != player) exitWith {life_action_gathering = false;};
_itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr;


_diff = [_gather,_val,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if(_diff == 0) exitWith {hint localize "STR_NOTF_InvFull";life_action_gathering = false;};
life_action_inUse = true;


_upp = format["Добываю %1",_itemName];
//Setup our progress bar.
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0;    
_time = 0.2;           
_cpUp = 0.02;
_profName = [_gather] call life_fnc_profType;
_data = missionNamespace getVariable (_profName);
if(_profName != "") then 
{
switch ( _data select 0 ) do
{
case 1: { _time = 0.2;};
case 2: { _time = 0.19;};
case 3: { _time = 0.18;};
case 4: { _time = 0.17;};
case 5: { _time = 0.16;};
case 6: { _time = 0.15;};
case 7: { _time = 0.14; };
case 8: { _time = 0.13;};
case 9: { _time = 0.12;};
case 10: { _time = 0.11;};
};
};
while{true} do
{
if(_bool) then {
                [] spawn {
                    _bool = false;
                    player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
                    sleep 2.5;
                    _bool = true;
                };
            };
sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {}; 
if(visiblemap) exitwith {};
if(life_interrupted) exitwith {};
if(!alive player) exitWith {};
};
if(!alive player) exitWith {life_action_inUse = false;life_action_gathering = false;};
if(visiblemap) exitwith {life_action_inUse = false;life_action_gathering = false;_ui = "osefStatusBar" call BIS_fnc_rscLayer;_ui cutRsc["osefStatusBar","PLAIN"];};
player playActionNow "stop";
if(life_interrupted) exitwith {life_action_inUse = false;life_interrupted= false;life_action_gathering = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"];_ui = "osefStatusBar" call BIS_fnc_rscLayer;_ui cutRsc["osefStatusBar","PLAIN"];};




if(([true,_gather,_diff] call life_fnc_handleInv)) then {
titleText[format[localize "STR_NOTF_Gather_Success",_itemName,_diff],"PLAIN"];
if( _profName != "" ) then {
[_profName,round ((random 3)+7)] call life_fnc_addExp;
};
};


life_action_gathering = false;
life_action_inUse = false;
_ui = "osefStatusBar" call BIS_fnc_rscLayer;_ui cutRsc["osefStatusBar","PLA
 

 

IN"];

Попробуйте это, только резерв вашего файла сделайте. И да, в коде столько мусора что ппц.

if(isNil "life_action_gathering") then {life_action_gathering = false;};
private["_gather","_itemWeight","_diff","_itemName","_val","_resourceZones","_zone","_bool","_time","_cpUp","_profName","_data","_cP","_ui"];
_resourceZones = ["apple_1","apple_2","apple_3","apple_4","cucumber_1","cucumber_2","cucumber_3","cucumber_4","peaches_1","peaches_2","peaches_3","peaches_4","heroin_1","cocaine_1","weed_1","crystal_1"];
_zone = "";
_bool = true;
if(visiblemap) exitwith {};
if(life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming.
life_action_gathering = true;
life_interrupted = false; 
 
//Find out what zone we're near
{
    if(player distance (getMarkerPos _x) < 30) exitWith {_zone = _x;};
} foreach _resourceZones;
 
 
if(_zone == "") exitWith {life_action_gathering = false;};
 
 
//Get the resource that will be gathered from the zone name...
switch(true) do {
    case (_zone in ["apple_1","apple_2","apple_3","apple_4"]): {_gather = "apple"; _val = 3;};
    case (_zone in ["peaches_1","peaches_2","peaches_3","peaches_4"]): {_gather = "peach"; _val = 3;};
    case (_zone in ["cucumber_1","cucumber_2","cucumber_3","cucumber_4"]): {_gather = "cucumber"; _val = 3;};
    case (_zone in ["heroin_1"]): {_gather = "heroinu"; _val = 1;};
    case (_zone in ["cocaine_1"]): {_gather = "cocaine"; _val = 1;};
    case (_zone in ["weed_1"]): {_gather = "cannabis"; _val = 1;};
    case (_zone in ["crystal_1"]): {_gather = "methu"; _val = 1;};
    default {""};
};
//gather check??
if(vehicle player != player OR player getVariable "surrender") exitWith {};

_itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr; 
_upp = format["Добываю %1",_itemName];
hint "Начните движение, чтобы остановить процесс добычи";


_diff = [_gather,_val,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if(_diff == 0) exitWith {hint localize "STR_NOTF_InvFull";life_action_gathering = false;};
life_action_inUse = true;
//Setup our progress bar.
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["%2 (1%1)...","%",_upp];
_progress progressSetPosition 0.01;
_cP = 0;    
_time = 0.2;           
_cpUp = 0.02;
_profName = [_gather] call life_fnc_profType;
_data = missionNamespace getVariable (_profName);
if(_profName != "") then 
{
switch ( _data select 0 ) do
{
case 1: { _time = 0.2;};
case 2: { _time = 0.19;};
case 3: { _time = 0.18;};
case 4: { _time = 0.17;};
case 5: { _time = 0.16;};
case 6: { _time = 0.15;};
case 7: { _time = 0.14; };
case 8: { _time = 0.13;};
case 9: { _time = 0.12;};
case 10: { _time = 0.11;};
};
};
while{true} do
{
if(_bool) then {
                [] spawn {
                    _bool = false;
                    player playMoveNow "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
                    sleep 2.5;
                    _bool = true;
                };
            };
sleep _time;
_cP = _cP + _cpUp;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp];
if(_cP >= 1) exitWith {}; 
if(visiblemap) exitwith {};
if(life_interrupted) exitwith {};
if(!alive player) exitWith {};
};

	if(_error) exitWith {titleText["Добыча прервана","PLAIN"];};
	if(([true,_gather,_diff] call life_fnc_handleInv)) then
	{
		_itemName = [([_gather,0] call life_fnc_varHandle)] call life_fnc_varToStr;
		titleText[format[localize "STR_NOTF_Gather_Success",_itemName,_diff],"PLAIN"];
	};
 
5 cutText ["","PLAIN"]; 
life_action_gathering = false;
life_action_inUse = false;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Miduznya
      Люди помогите кто знает, перепробовал множество вариантов
      ехе качал с сайта ragezone который типа переделан и в нем не работает БЕ
      но если зайти на сервер и выключить БЕ на клиенте через лаунчер, с сервера кикает, так что этот вариант не рабочий
      battleye = 0; тоже ничего не дает, кикает с сервера тоже.
      если не хотите тут можно и в лс , буду рад любой помощи.
    • By 123new
      В данной теме я ничего не прошу. Эта тема исключительно для обмена информацией и файлами со Steam мастерской и инструментов Steam, преимущественно для тех. кто не может их загрузить сам по тем или иным причинам.
       
      Форма запроса:
      1. Помогите скачать: {название и ссылка на необходимое вам, можно перечислить списком}
      2. Предпочитаю скачивать через: {названия облачных хранилищ, torrent, если работает}
      3. Буду ждать результата до: {дата, время по GMT+3, до которой вы ждете что вам помогут}
       
      Обращаю внимание, что все запросы и помощь исключительно добровольные между всеми форумчанами, никто ничем никому не обязан. Если по какой-то причине вам никто не может помочь загрузить файлы ищите свои способы это сделать сами.
      Форма запроса рекоммендуемая, но не обязательная в теме.
       
      ВАЖНО!! Благодарности за помощь оставлять в виде поднятия репутации автору за сообщение с нужной вам ссылкой.
    • By Miduznya
      Как сделать стартовый лут на сервере???
    • By BorizzK
      Дружбан ваяет тягач/грузовик и тп
      Он довольно большой и фургон/кузов загораживает обзор + ему надо было разглядеть подвеску в работе поподробней
      Те камеру надо было отодвинуть
      Поскольку бегемоты, то ли по глупости, то ли по скудоумию (скорее оба варианта ), в конфиге модели не предусмотрели таких параметров как
      дистанция камеры, углы ее наклона итд итп, а сделали это тупо в скрипте, пришлось моддидь.
       
      Вариант моддинга внешней (от 3го лица) камеры автомобильчика, как обычно через класс, но моддим конструктор (без override). Я не стал изобретать велосипед и поступил по "серверному"... Вроде получилось и все работает как надо. Зил кажет нормально, остальные то же.
       
      modded class DayZPlayerCamera3rdPersonVehicle extends DayZPlayerCameraBase { void DayZPlayerCamera3rdPersonVehicle (DayZPlayer pPlayer, HumanInputController pInput) { Print("CLIENT: КАМЕРА ДЛЯ ТОЧИЛЫ: ИГРОК: " + pPlayer.ToString() + ", ТОЧИЛА: " + pPlayer.GetCommand_Vehicle().GetTransport().GetType()); if (pPlayer.GetCommand_Vehicle().GetTransport().GetType() == "ZIL130") { m_fDistance = 8.0; //дистанция m_CameraOffsetMS = "0.0 1.3 0.0"; //стартовый наклон камеры Print("CLIENT: КАМЕРА ДЛЯ ТОЧИЛЫ: МОЯ КРУТАЯ ТОЧИЛА: ДИСТАНЦИЯ КАМЕРЫ: " + m_fDistance); return; } m_fDistance = 4.0; //стандартная дистанция m_CameraOffsetMS = "0.0 1.3 0.0"; //стартовый наклон камеры Print("CLIENT: КАМЕРА ДЛЯ ТОЧИЛЫ: СТАНДАРТНАЯ ТОЧИЛА: ДИСТАНЦИЯ КАМЕРЫ: " + m_fDistance); } }  
      Понятно что это для клиента (ну те для обычного мода) и на сервере бесполезно.
       
      Фото с тестового грузовика из АРМА 3 мод. свои он пока просил не показывать

      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
    • By BorizzK
      Как бы в цикле сделать задержку 3-5 сек между выводами сообщений в чат
      вывелось 2 строки
      задержка 3 сек
      вывелось еще 2 строки
      снова задержка
       
      Нужно для скана обьектов и вывода в чат обнаруженных
      int radius = cData.ToInt(); array<Object> nearest_objects = new array<Object>; array<CargoBase> proxy_cargos = new array<CargoBase>; Object object; string className; if (radius > 0 && radius <= 120) { GetGame().GetObjectsAtPosition(AdminPosition, radius, nearest_objects, proxy_cargos); for ( int chk = 0; chk < nearest_objects.Count(); chk++ ) { object = nearest_objects.Get(chk); className = object.GetType(); if (className) { string Msg1 = "Obj:" + chk + ":" + className; } else { Msg1 = "Obj:" + chk + ":" + object.ToString(); } string Msg2 = "Pos:" + chk + ":" + object.GetPosition().ToString(); Msgparam = new Param1<string>(Msg1); Msgparam1 = new Param1<string>(Msg2); GetGame().RPCSingleParam(playerAdmin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, playerAdmin.GetIdentity()); GetGame().RPCSingleParam(playerAdmin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam1, true, playerAdmin.GetIdentity()); Print("::: AdminMod.c ::: /check ::: " + Msg1); Print("::: AdminMod.c ::: /check ::: " + Msg2); //Тут бы придумать задержку, что бы между выводом в чат инфо по каждому обьекту проходило 2-3 сек... //это не работает float wt0 = 0.00; while (wt0 < 36000 ) { wt0 = wt0 + 0.01; } } } если их много то слишком быстро выводятся (((
       
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.