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
Yahweh

[Fix] Повреждение колес транспорта и повреждение деталей

Recommended Posts

Данная статья расскажет,как это можно убрать 8 колес из автомобиля/квадроцикла и т.д....
Эта вещь должна решить эту проблему. 
 
Что нужно:
 
custom fn_selfaction.sqf
fixed salvage_vehicles.sqf
 
Как установить:
 
fn_selfaction:
найти эту часть:
 
_menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];

и изменить путь к salvage_vehicles.sqf:

 

_menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "path_to\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];

fixed salvage_vehicles.sqf

 

//Hitpoint and Damage fix by SchwEde
private ["_part","_cancel","_color","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"];

_vehicle = _this select 3;

{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
// dayz_myCursorTarget = _vehicle;

if (((typeof _vehicle) isKindOf  "Car") and !((typeof _vehicle) isKindOf  "Truck")) then {
    _hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitFuel","HitRGlass","HitLGlass","HitEngine"]
    };

if ((typeof _vehicle) isKindOf  "Truck") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitLMWheel","HitRMWheel","HitFuel","HitRGlass","HitLGlass","HitEngine"]
};

// _allFixed = true;
//_hitpoints = _vehicle call vehicle_getHitpoints; // old Hitpoints

// diag_log format["DEBUG SALVAGE: %1", _hitpoints];
{         
    _damage = [_vehicle,_x] call object_getHit;
    _part = "PartGeneric";

    //change "HitPart" to " - Part" rather than complicated string replace
    _cmpt = toArray (_x);
    _cmpt set [0,20];
    _cmpt set [1,toArray ("-") select 0];
    _cmpt set [2,20];
    _cmpt = toString _cmpt;
 
    if(["Engine",_x,false] call fnc_inString) then {
        _part = "PartEngine";
    };
     
    if(["HRotor",_x,false] call fnc_inString) then {
        _part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
    };

    if(["Fuel",_x,false] call fnc_inString) then {
        _part = "PartFueltank";
    };

    if(["Wheel",_x,false] call fnc_inString) then {
        _part = "PartWheel";
    }; 
     
    if(["Glass",_x,false] call fnc_inString) then {
        _part = "PartGlass";
    };

    // allow removal of any lightly damaged parts
    if (_damage <= 0.95 and _damage >= 0) then {
     
        // Do not allow removal of engine || fueltanks
        if( _part == "PartGlass" || _part == "PartWheel" ) then {

            _color = "color='#ffff00'"; //yellow
            if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
            if (_damage >= 0.75) then {_color = "color='#ff0000'";}; //red

            _percent = round(_damage*100);
            _string = format["<t %2>Remove%1 (%3 %4)</t>",_cmpt,_color,_percent,"%"]; //Remove - Part
            _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
            s_player_repairActions set [count s_player_repairActions,_handle];
         
        };
    };

} count _hitpoints;

if(count _hitpoints > 0 ) then {
 
    _cancel = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_CANCEL", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""];
    s_player_repairActions set [count s_player_repairActions,_cancel];
    s_player_repair_crtl = 1;
};

Если вы хотите изменить максимальный урон просто измените эту строку:

 

if (_damage <= 0.95 [<<max damage] and _damage >= 0 [<< min damage]) then {

Если вам был полезен гайд, то поставьте мне + в репу

 

Share this post


Link to post
Share on other sites



Если это тупо копипаст с epochmod.com, то дюп есть, там фикс прикладывали в комментариях. Поищу, скину.

Share this post


Link to post
Share on other sites

Если это тупо копипаст с epochmod.com, то дюп есть, там фикс прикладывали в комментариях. Поищу, скину.

Я решил форум наполнить, просто репу подниму, да и вам мб меньше работ будет)

Share this post


Link to post
Share on other sites

Я решил форум наполнить, просто репу подниму, да и вам мб меньше работ будет)

Не, про это не говорю ничего, мы только за, просто тут правда косяк есть, фикс поискать в комментах надо на epochmod.com

Share this post


Link to post
Share on other sites

Не, про это не говорю ничего, мы только за, просто тут правда косяк есть, фикс поискать в комментах надо на epochmod.com

я поищу, если что добавлю)

Share this post


Link to post
Share on other sites

я поищу, если что добавлю)

Нашел эту тему на epochmod.com, собственно вопрос, фикс добавлен тут или лучше оттуда ставить?

 

И еще вопрос, если я правильно понял, в этот код можно добавить и другой транспорт, скажем, BAF_Merlin_DZE (с его 20 стеклами) и поправить количество запчастей у него. Это возможно?

 

Для сравнения, Hitpoints в БД:

 

BAF_Merlin_DZE

[["NEtrup",0.296],["motor",0.294],["elektronika",0.696],["mala vrtule",0.45],["velka vrtule",0.526],["glass1",0.652],["glass2",0.531],["glass3",0.528],["glass4",0.674],["glass5",0.71],["glass6",0.251],["glass7",0.503],["glass8",0.689],["glass9",0.738],["glass10",0.608],["glass11",0.422],["glass12",0.596],["glass13",0.294],["glass14",0.586],["glass15",0.387],["glass16",0.572],["glass17",0.321],["glass18",0.582],["glass19",0.271],["glass20",0.352],["munice",0.498],["sklo predni P",0.408],["sklo predni L",0.46]]

 

Mi17_Civilian_DZ
[["glass1",1],["glass2",1],["glass3",1],["glass4",1],["glass5",1],["glass6",1],["NEtrup",0.703],["motor",0.8],["elektronika",1],["mala vrtule",0.567],["velka vrtule",1],["munice",0.736],["sklo predni P",0.27],["sklo predni L",0.527]] 

 

В коде salvage_vehicle.sqf следует добавить:

if ((typeof _vehicle) isKindOf  "BAF_Merlin_DZE") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6", .?.?.?. ,"HitRGlass","HitLGlass","HitEngine"]

 

Но не понятно как обозначить HRotor, VRotor и прочие детали. В Hitpoints так понимаю это - NEtrup, elektronika, mala vrtule, ,velka vrtule, munice. Где можно глянуть правильные обозначения для них?
 
 
(ОБНОВЛЕНО)
 
Похоже нашел. Оригинал тут.
if ((typeof _vehicle) isKindOf  "Helicopter") then {
    _hitpoints = ["HitRGlass","HitLGlass","HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitHull","HitMissiles","HitAvionics","HitHRotor","PartVRotor","HitEngine"];
};
Edited by Ramond (see edit history)

Share this post


Link to post
Share on other sites

Всем доброго времени суток!

 

Данное решение дополняет фикс, опубликованный в первом сообщении этой темы.

Для чего это? Ответ прост: многие сталкивались с проблемой большого количества деталей для 100% ремонта транспортных средств. Яркий пример, это вертолет Merlin, который из-за 20 стекол не пользуется спросом, при весьма неплохих характеристиках.

 

Чтобы исправить этот недостаток, потребуется кастомный файл fn_selfActions.sqf. Как сделать файлы кастомными, смотрите в этой теме.

 

1. Необходимо создать файл repair_vehicle.sqf (кодировка UTF-8 w/o BOM)

2. Скопировать и вставить код:

repair_vehicle.sqf

private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"];

_vehicle = _this select 3;

{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
// dayz_myCursorTarget = _vehicle;

if ((typeof _vehicle) isKindOf "Car") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitBody","HitFuel","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Truck") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitLMWheel","HitRMWheel","HitBoby","HitFuel","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Motorcycle") then {
_hitpoints = ["HitGlass1","HitGlass2","HitFWheel","HitBWheel","HitBody","HitFuel","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Bike") then {
_hitpoints = ["HitBody","HitLFWheel","HitLBWheel"]
};

if (((typeof _vehicle) isKindOf "ATV_US_EP1") or ((typeof _vehicle) isKindOf "ATV_CZ_EP1")) then {
_hitpoints = ["HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitBody","HitFuel","HitEngine"]
};

if ((typeof _vehicle) isKindOf "Helicopter") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Plane") then {
_hitpoints = ["HitHull"];
};

//_allFixed = true;
//_hitpoints = _vehicle call vehicle_getHitpoints;

{
_damage = [_vehicle,_x] call object_getHit;
_part = "PartGeneric";

//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;

if(["Engine",_x,false] call fnc_inString) then {
_part = "PartEngine";
};

if(["HRotor",_x,false] call fnc_inString) then {
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
};

if(["Fuel",_x,false] call fnc_inString) then {
_part = "PartFueltank";
};

if(["Hull",_x,false] call fnc_inString) then {
_part = "PartGeneric";
};

if(["Body",_x,false] call fnc_inString) then {
_part = "PartGeneric";
};

if(["Wheel",_x,false] call fnc_inString) then {
_part = "PartWheel";
};

if(["Glass",_x,false] call fnc_inString) then {
_part = "PartGlass";
};

    //change "HitPart" to " - Part" rather than complicated string replace
    _cmpt = toArray (_x);
    _cmpt set [0,20];
    _cmpt set [1,toArray ("-") select 0];
    _cmpt set [2,20];
    _cmpt = toString _cmpt;
    
    if(["Engine",_x,false] call fnc_inString) then {
        _part = "PartEngine";
    };
        
    if(["HRotor",_x,false] call fnc_inString) then {
        _part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
    };

    if(["Fuel",_x,false] call fnc_inString) then {
        _part = "PartFueltank";
    };

    if(["Wheel",_x,false] call fnc_inString) then {
        _part = "PartWheel";
    };    
        
    if(["Glass",_x,false] call fnc_inString) then {
        _part = "PartGlass";
    };

    // get every damaged part no matter how tiny damage is!
    if (_damage > 0) then {
    
        _allFixed = false;
        _color = "color='#ffff00'"; //yellow
        if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
        if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red

        _percent = round(_damage*100);
        _string = format["<t %2>Repair%1 (%3 %4)</t>",_cmpt,_color,_percent,"%"]; //Repair - Part
        _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
        s_player_repairActions set [count s_player_repairActions,_handle];
    };

} count _hitpoints;
if (_allFixed) then {
    _vehicle setDamage 0;
};

if(count _hitpoints > 0 ) then {

    _cancel = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_CANCEL", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""];
    s_player_repairActions set [count s_player_repairActions,_cancel];

    s_player_repair_crtl = 1;
}; 

 

3. Создать файл salvage_vehicle.sqf (кодировка UTF-8 w/o BOM)

4. Скопировать и вставить код:

salvage_vehicle.sqf

private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"];

_vehicle = _this select 3;

{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
// dayz_myCursorTarget = _vehicle;

if (((typeof _vehicle) isKindOf "Car") and !((typeof _vehicle) isKindOf "Truck")) then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitBody","HitFuel","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Truck") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitLMWheel","HitRMWheel","HitBoby","HitFuel","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Motorcycle") then {
_hitpoints = ["HitGlass1","HitGlass2","HitFWheel","HitBWheel","HitBody","HitFuel","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Bike") then {
_hitpoints = ["HitLFWheel","HitLBWheel"]
};

if (((typeof _vehicle) isKindOf "ATV_US_EP1") or ((typeof _vehicle) isKindOf "ATV_CZ_EP1")) then {
_hitpoints = ["HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitBody","HitFuel","HitEngine"]
};

if ((typeof _vehicle) isKindOf "Helicopter") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"];
};

if ((typeof _vehicle) isKindOf "Plane") then {
_hitpoints = ["HitHull"];
};

//_allFixed = true;
//_hitpoints = _vehicle call vehicle_getHitpoints;

{
_damage = [_vehicle,_x] call object_getHit;
_part = "PartGeneric";

//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;

if(["Engine",_x,false] call fnc_inString) then {
_part = "PartEngine";
};

if(["HRotor",_x,false] call fnc_inString) then {
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
};

if(["Fuel",_x,false] call fnc_inString) then {
_part = "PartFueltank";
};

if(["Hull",_x,false] call fnc_inString) then {
_part = "PartGeneric";
};

if(["Body",_x,false] call fnc_inString) then {
_part = "PartGeneric";
};

if(["Wheel",_x,false] call fnc_inString) then {
_part = "PartWheel";
};

if(["Glass",_x,false] call fnc_inString) then {
_part = "PartGlass";
};

    // allow removal of any lightly damaged parts
    if (_damage <= 0.95 and _damage >= 0) then {
    
        // Do not allow removal of engine || fueltanks
        if( _part == "PartGlass" || _part == "PartWheel" ) then {

            _color = "color='#ffff00'"; //yellow
            if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
            if (_damage >= 0.75) then {_color = "color='#ff0000'";}; //red

            _percent = round(_damage*100);
            _string = format["<t %2>Remove%1 (%3 %4)</t>",_cmpt,_color,_percent,"%"]; //Remove - Part
            _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
            s_player_repairActions set [count s_player_repairActions,_handle];
        
        };
    };

} count _hitpoints;

if (_allFixed) then {
_vehicle setDamage 0;
};

if(count _hitpoints > 0 ) then {

_cancel = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_CANCEL", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""];
s_player_repairActions set [count s_player_repairActions,_cancel];

s_player_repair_crtl = 1;
};

 

5. Открыть кастомный файл fn_selfActions.sqf

6. Найти в следующий участок кода:

    //Repairing Vehicles
    if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then {
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repairActions set [count s_player_repairActions,_menu1];
            s_player_repair_crtl = 1;
        } else {
            {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    }; 

 

8. Изменить путь к файлам repair_vehicle.sqf и salvage_vehicle.sqf на свой. Должно получиться примерно так:

fn_selfActions.sqf

    //Repairing Vehicles
    if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then {
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "custom\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "custom\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repairActions set [count s_player_repairActions,_menu1];
            s_player_repair_crtl = 1;
        } else {
            {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };

В данном примере файлы repair_vehicle.sqf и salvage_vehicle.sqf расположены в директории custom.

 

9. Сохраните изменения в файле fn_selfActions.sqf.

 

Установка фикса завершена. Теперь для ремонта всех вертолетов потребуется 6шт. PartGlass, 4шт. PartGeneric, 1шт. PartEngine и 1шт. PartVRotor.

 

 

ДОПОЛНИТЕЛЬНО

 

Можно изменить количество стекол на 8, но это изменение необходимо сделать в обоих файлах (repair_vehicle.sqf и salvage_vehicle.sqf)

Необходимо найти строку:

if ((typeof _vehicle) isKindOf "Helicopter") then {

И ниже заменить строку на эту:

_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"]; 

 

Также можно указать разное количество для определенных классов. Необходимо добавить после: 
if ((typeof _vehicle) isKindOf "Helicopter") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"];
}; 

Свой класс транспорта:

if (((typeof _vehicle) isKindOf "AH6X_DZ") or ((typeof _vehicle) isKindOf "MH6J_DZ")) then {_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"];
}; 

* Все изменения и добавления необходимо делать в обоих файлах!

Edited by Ramond (see edit history)

Share this post


Link to post
Share on other sites

В чем различия? Где скрины? Это не гайд. Оформи нормально, а то зелёные не поймут.

Share this post


Link to post
Share on other sites

 

В чем различия? Где скрины? Это не гайд. Оформи нормально, а то зелёные не поймут.

 

Даже не представляю, какие скрины можно здесь добавить... Фикс не привносит ничего графического, только свойства. Меню демонтажа и ремонта транспортных средств, полагаю, видели все.

Дублировать тему не самая удачная идея, дополнил свое сообщение инструкциями.

 

Если кому есть что добавить, с удовольствием выслушаю и внесу необходимые правки.

Share this post


Link to post
Share on other sites

По моему пост от RAMOND должен быть гайдом, а не первый пост.

Share this post


Link to post
Share on other sites

 

Всем доброго времени суток!

 

Данное решение дополняет фикс, опубликованный в первом сообщении этой темы.

Для чего это? Ответ прост: многие сталкивались с проблемой большого количества деталей для 100% ремонта транспортных средств. Яркий пример, это вертолет Merlin, который из-за 20 стекол не пользуется спросом, при весьма неплохих характеристиках.

 

Чтобы исправить этот недостаток, потребуется кастомный файл fn_selfActions.sqf. Как сделать файлы кастомными, смотрите в этой теме.

 

1. Необходимо создать файл repair_vehicle.sqf (кодировка UTF-8 w/o BOM)

2. Скопировать и вставить код:

repair_vehicle.sqf

В данном примере файлы repair_vehicle.sqf и salvage_vehicle.sqf расположены в директории custom.

 

9. Сохраните изменения в файле fn_selfActions.sqf.

 

Установка фикса завершена. Теперь для ремонта всех вертолетов потребуется 6шт. PartGlass, 4шт. PartGeneric, 1шт. PartEngine и 1шт. PartVRotor.

 

 

ДОПОЛНИТЕЛЬНО

 

Можно изменить количество стекол на 8, но это изменение необходимо сделать в обоих файлах (repair_vehicle.sqf и salvage_vehicle.sqf)

Необходимо найти строку:

if ((typeof _vehicle) isKindOf "Helicopter") then {

И ниже заменить строку на эту:

_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"]; 

 

Также можно указать разное количество для определенных классов. Необходимо добавить после: 
if ((typeof _vehicle) isKindOf "Helicopter") then {
_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"];
}; 

Свой класс транспорта:

if (((typeof _vehicle) isKindOf "AH6X_DZ") or ((typeof _vehicle) isKindOf "MH6J_DZ")) then {_hitpoints = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitHull","HitVRotor","HitHRotor","HitAvionics","HitMissiles","HitEngine"];
}; 

* Все изменения и добавления необходимо делать в обоих файлах!

 

подскажите как убрать ошибки :

 

Error position: <_allFixed) then {

_vehicle setDamage 0;

>

  Error Undefined variable in expression: _allfixed

File mpmissions\__CUR_MP.Tavi\custom\fixes\repair_vehicle.sqf, line 120

Error in expression <ndle];

 

};

};

 

} count _hitpoints;

 

if (_allFixed) then {

_vehicle setDamage 0;

>

  Error position: <_allFixed) then {

_vehicle setDamage 0;

>

  Error Undefined variable in expression: _allfixed

File mpmissions\__CUR_MP.Tavi\custom\fixes\salvage_vehicle.sqf, line 98

 

 

и почему закоментированы строки :

//_allFixed = true;
//_hitpoints = _vehicle call vehicle_getHitpoints;
Edited by shturman (see edit history)

Share this post


Link to post
Share on other sites

 

подскажите как убрать ошибки :

 

Error position: <_allFixed) then {

_vehicle setDamage 0;

>

  Error Undefined variable in expression: _allfixed

File mpmissions\__CUR_MP.Tavi\custom\fixes\repair_vehicle.sqf, line 120

Error in expression <ndle];

 

};

};

 

} count _hitpoints;

 

if (_allFixed) then {

_vehicle setDamage 0;

>

  Error position: <_allFixed) then {

_vehicle setDamage 0;

>

  Error Undefined variable in expression: _allfixed

File mpmissions\__CUR_MP.Tavi\custom\fixes\salvage_vehicle.sqf, line 98

 

 

и почему закоментированы строки :

//_allFixed = true;
//_hitpoints = _vehicle call vehicle_getHitpoints;

У тебя не объявлена переменная _allFixed

Перепроверь в private прописана ли _allFixed в repair_vehicle.sqf и salvage_vehicle.sqf

По поводу закомментированых строк, стоит спросить у знающих людей. Надеюсь ответят. Либо если я разберусь отвечу на вопрос.

Share this post


Link to post
Share on other sites

У тебя не объявлена переменная _allFixed

Перепроверь в private прописана ли _allFixed в repair_vehicle.sqf и salvage_vehicle.sqf

По поводу закомментированых строк, стоит спросить у знающих людей. Надеюсь ответят. Либо если я разберусь отвечу на вопрос.

думаешь я копирнул скрипт и удалил переменную?  - нет, ничего не трогал.

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 BorizzK
      В эксперементалке 1.08 если сбросить предмет находясь на машине (крыше, багажнике, капоте в кузове) предмет проваливается сквозь машину на землю или оказывается в ее текстурах
       
      Тикет
      https://feedback.bistudio.com/T152071
       
      ответ богемии поразителен - сейчас нет простого решения
       
      А ниже что? Проще не бывает...
       
      Собственно код фикса (Автор Я)
       
      Code ``` modded class ItemBase extends InventoryItem { override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc) { super.EEItemLocationChanged(oldLoc,newLoc); if (newLoc.GetType() == InventoryLocationType.GROUND) { if (oldLoc.GetParent()) { PlayerBase player = PlayerBase.Cast(oldLoc.GetParent()); if (player) { FixPositionIfDropOnCar(player); } } } } void FixPositionIfDropOnCar(PlayerBase player) { vector m_RayStart; vector m_RayEnd; m_RayStart = player.GetPosition(); m_RayStart[1] = m_RayStart[1] + 0.5; m_RayEnd = m_RayStart; m_RayEnd[1] = m_RayEnd[1] - 1; RaycastRVParams m_RayCastInput = new RaycastRVParams(m_RayStart, m_RayEnd, this, 0.05); array<ref RaycastRVResult> m_RayCastResults = new array<ref RaycastRVResult>; m_RayCastInput.with = player; m_RayCastInput.flags = CollisionFlags.FIRSTCONTACT; if (DayZPhysics.RaycastRVProxy(m_RayCastInput, m_RayCastResults)) { if (m_RayCastResults.Count() > 0) { Car car; if (Class.CastTo(car, m_RayCastResults[0].obj) || Class.CastTo(car, m_RayCastResults[0].parent)) { this.SetPosition(m_RayCastResults[0].pos + (player.GetDirection() * 0.1)); } } } } } ``` Наверное имеет смысл чуть приподнять предмет над поверхностью, но необходимость этого зависит от типа предмета, потому не стал этого делать
       
      чуть откорректировал код
    • By BorizzK
      Собственно речь про расширения VPPAdmintools
      1 Автор собирает IP серверов где работает админка
      2 Если надо он заносит ip в некий черный список, сервер при обращении к его "сайту" получит инфу, что сервер в блоке и скрипт не даст подключаться игрокам

      Само расширение - код - спасибо комраду @Selleti
       
      modded class MissionServer { private string vppatlockmessage = "Server is Currently Locked!"; private string serverIP; private bool violatedRules = false; void MissionServer() { GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(this.vppapi, 5000.0, false); serverIP = GetServerIP(); } private void vppapi() { VPPATapiCB cb = new VPPATapiCB( this ); CURLContext ctx = GetCURLCore().GetCURLContext("http://54.39.130.144:5600"); ctx.GET( cb, string.Format( "/Validate?address=%1", serverIP ) ); } void setStatus(bool state) { violatedRules = state; if ( state ) vppatlockmessage = "Server Locked. Please contact the developer of the following mod [ VPPAdminTools ]\nEmail: vanillaplusplusdayz@gmail.com\nDiscord: discord.gg/GWXN2bB"; } void ForceKickPlayers() { GetRPCManager().SendRPC( "RPC_MissionGameplay", "KickClientHandle", new Param1<string>( vppatlockmessage ), true, NULL); array<PlayerIdentity> identities = new array<PlayerIdentity>; GetGame().GetPlayerIndentities( identities ); foreach(ref PlayerIdentity iden: identities) { GetGame().ChatPlayer("#kick " + iden.GetName()); Print(vppatlockmessage); } GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(this.ForceKickPlayers); } override void OnEvent(EventType eventTypeId, Param params) { if ( violatedRules ) GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(this.ForceKickPlayers, 3500, false); else super.OnEvent(eventTypeId,params); } string GetServerIP() { string ip; if (GetCLIParam("ip", ip)) { return ip; } return "0.0.0.0"; } }; class VPPATapiCB: CURLCallback { private string response; private MissionServer serverMission; void VPPATapiCB(MissionServer ms) { serverMission = ms; } override void OnSuccess( string data, int dataSize ) { response = data; if ( response == "true" ) serverMission.setStatus(true); } }; И собственно 2 фикса для серверного мода

      1 Удаляет расширение из загруженных модов вообще - автор Selleti
      выполнено в виде конфига мода
       
      class CfgPatches { class VPPATExtensions_FIX { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"DZM_VPPATExtensions"}; }; }; class CfgMods { delete VPPATExtensions; }; 2 Удаляет из очереди вызов функицию которая ставится в очередь в конструкторе класса MissionServer  в моде VPPAdmintools в скрипте из обфусцированного VPPExtensions.pbo - автор - ну в общем пофигу - просто все
      выполнено в виде скрипта
      modded class MissionServer extends MissionBase { void MissionServer() { GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(this.vppapi); } }
      За сим раскланиваюсь
      Всегда Ваш

       
    • By Serdce
      Ссылка на первоисточник - https://github.com/BrettNordin/Exile
      Я всего лишь перевёл
      Собственно переходим по ссылке, и скачиваем архив.
      Для тех, кто не знает как качать с хаба скрин 
      И так, едем дальше
      Скачанный архив распаковываем в удобное место для работы,
      Идём в ваш @ExileServer, там нас интересуют файлы - extDB2.dll , extDB2.so , extDB2-conf.ini , XM8.dll , XM8.so Удаляем эти файлы
      Далее идём в @ExileServer которую мы скачали, всё её содержимое копируем в аналогичную папку на сервере.
      Теперь идём в вашу MPmissions и там распаковываем вашу миссию "Exile.название карты",
      Туда мы копируем содержимое папки Exile.MapName из архива,
      Далее открываем ваш config.cpp и ищем там class CfgExileCustomCode 
      В него мы добавляем - #include "CfgExileCustomCode.cpp"
      Должно получится так
      Запаковываем обратно)
      Ну и теперь из архива мы копируем tbbmalloc.dll, tbbmalloc_x64.dll в папку расположения вашего Arma3_server.exe
      Не забываем поменять в вашем файле запуска сервера с arma3server.exe на arma3server_x64.exe 
      Ну и финишная прямая, открываем вашу базу данных ( желательно с название exile ) и добавляем файл Exile_Database_Update_64x.sql
      Далее настройте под себя ваш extdb3-conf.ini
       
    • By Astrahrom
      Столкнулся с цикличной проблемой в лаунчере, при установке ботов A3EAI:
      Script @epochhive\A3EAI_config.sqf not found Оказалось, что все дело в том, что в открытом доступе лежат старые версии этого скрипта, и все кто пытается воткнуть в Epochhive, как я, данный скрипт - делают это по старой схеме, не актуальной для последних версий.
       
      Решение
       
      Скачиваем - https://yadi.sk/d/HfXeB1pEAGoRtw
       
      Устанавливаем:
      1. Взять из папки архива "1. Installation Package" папку "@A3EAI" и вложить её в папку с вашим сервером;
      2. Прописать скрипт в вашем запускаторе, примерно так:
      -servermod=@EpochHive;@A3EAI; Пример моего запускатора:
      @echo off start "arma3" "arma3server.exe" -servermod=@EpochHive;@A3EAI; -mod=@Epoch; -config=C:\Arma3Server\sc\server.cfg -port=2307 -profiles=sc -cfg=C:\Arma3Server\sc\basic.cfg -name=sc -autoINIT Варианты настройки, которые хранятся в самой папке @A3EAI\addons\a3eai_config в файле config.cpp.
    • By BorizzK
      Палатки пофикшены
      Ну разве что не ставятся на крест на церкви, ставятся чуть ниже
      Все чисто серверное
       
      Выложу завтра днем после небольшой доработки - что бы красиво было
       
      Вот резалт
       
       

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

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

      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
  • 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.