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
Sign in to follow this  
nikolya200

Торговцы DayZ

Здравствуйте!

Подскажите пожалуйста как отключить выдачу ключа при покупке техники у торговца. В dayz_code и в dayz_server ищу второй день и не могу никак найти.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

И для чего это? Не нужны машины с ключом - юзай обычный дейз.

Share this post


Link to post
Share on other sites



  • 0

В базе данных у нужной единицы техники меняем Afile с trade_any_vehicle на trade_any_bicycle

Share this post


Link to post
Share on other sites
  • 0

И для чего это? Не нужны машины с ключом - юзай обычный дейз.

Машины с ключом нужны, просто для этого есть  еще один скрипт который позволяет ставить замок на машины. Для моего сервера это слишком просто покупаешь машину и сразу ключ в подарок.

 

В базе данных у нужной единицы техники меняем Afile с trade_any_vehicle на trade_any_bicycle

Спасибо большое за подсказку только вот у меня стоит на сервере "Единая система банков" , подскажи пожалуйста что менять?

Share this post


Link to post
Share on other sites
  • 0

Все разобрался. Спасибо большое "Venom"  за подсказку.  

Рассказываю как это сделать кто хочет сделать тоже самое.

Заходим в папку миссии далее в CfgServerTrader\Category и в файлах где прописывается цена техники (которую вы хотите оставить без ключа) меняем в type = " trade_any_vehicle"; на trade_any_bicycle. 

И все. Всем большое спасибо!

Share this post


Link to post
Share on other sites
  • 0

 

скрипт который позволяет ставить замок на машины

 
Сделай гайд по скрипту на фоуме плиз. Гляну что за тема такая.

Share this post


Link to post
Share on other sites
  • 0

 

Сделай гайд по скрипту на фоуме плиз. Гляну что за тема такая.

Cкрипт этот я  сегодня поставил на свой сервер. Он не работает на технике которая покупается таким способом. Пишет "на этой технике уже стоит замок".

 

Вот сам скрипт.

 

Скрипт  прописывается в верху fn_selfActions.sqf после этих строк 

 

 

_nearLight =     nearestObject [player,"LitObject"];
_canPickLight = false;
if (!isNull _nearLight) then {
    if (_nearLight distance player < 4) then {
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};

 
вставляются эти строки 
 
if ( (!isNull cursorTarget) && (!_inVehicle) && (!_isPZombie) && (player distance cursorTarget < 4) && (cursorTarget isKindOf "AllVehicles") && (!locked cursorTarget) && (alive cursorTarget) && (_canDo) ) then 
{
    _itemsPlayer = items player;
    _magazinesPlayer = magazines player;
    if ( ("ItemKeyKit" in _itemsPlayer) && ("ItemToolbox" in _itemsPlayer) && ("ItemComboLock" in _magazinesPlayer) ) then
    {
        if (s_player_makeVehKey < 0) then 
        {
            s_player_makeVehKey = player addaction[format["<t color='#ff0000'>%1</t>","Установить замок"],"custom\player_makeVehKey.sqf",cursorTarget,6,false,true,"", ""];
        };
    }
    else
    {
        player removeAction s_player_makeVehKey;
        s_player_makeVehKey = -1;
    };
}
else
{
    player removeAction s_player_makeVehKey;
    s_player_makeVehKey = -1;
};
 

 

в папке custom есть такой файл player_makeVehKey.sqf с таким содержимым  

 

private ["_vehicle","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_isOk","_isConfirm","_isDamaged","_hitpoints"]; 
_vehicle = _this select 3; 
_isConfirm = true; 
_isDamaged = false; 
_hitpoints = _vehicle call vehicle_getHitpoints; 

{     
     if ( ([_vehicle,_x] call object_getHit) > 0) then      
     {         
        _isDamaged = true;     
     }; 
} forEach _hitpoints; 

     if (_vehicle getVariable ["CharacterID","0"] != "0") then 
     {     
        _isConfirm = false;
        cutText [format["На %1 уже установлен замок",typeOf _vehicle], "PLAIN DOWN"];
     }; 

     if (_isDamaged) then 
     {     
        _isConfirm = false;     
        cutText [format["Вы должны отремонтировать %1 перед установкой замка",typeOf _vehicle], "PLAIN DOWN"]; 
     }; 

     if (_isConfirm) then
     {    
        player removeAction s_player_makeVehKey;     
        player playActionNow "Medic";     
        sleep 4;     

        _keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;     
        _keyNumber = (floor(random 2500)) + 1;     
        _keySelected = format[("ItemKey%1%2"),_keyColor,_keyNumber];     
        _isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);     
        _config = _keySelected;     
        _isOk = [player,_config] call BIS_fnc_invAdd;     
        waitUntil {!isNil "_isOk"}; 
    
        if (_isOk and _isKeyOK) then     
        {         
             MakeVehicleKey = [_vehicle, _keySelected, player];         
             publicVariableServer  "MakeVehicleKey";         
             player removeMagazine "ItemComboLock";                  
             cutText [format["Вы установили замок на %1",typeOf _vehicle], "PLAIN DOWN"];     
        }      
        else      
        {         
             cutText [format["Вам не удалось установить замок на %1",typeOf _vehicle], "PLAIN DOWN"];     
        }; 
     };  
 

 

 

Этот скрипт прописывается у меня только в этих двух файлах "fn_selfActions.sqf" и "player_makeVehKey.sqf" больше этот скрипт нигде не прописан.

Возможно для работоспособности скрипта его нужно переписать. Можно использовать для этого эту часть антихаха 

 

 

admin_generatekey =
    {
        private ["_ct","_id","_result","_inventory","_backpack"];
        _ct = cursorTarget;
        if (!isNull _ct) then {
            if (_ct distance player > 12) exitWith {cutText [format["%1 is to far away.",typeOF _ct], "PLAIN"];};
            if !((_ct isKindOf "LandVehicle") || (_ct isKindOf "Air") || (_ct isKindOf "Ship")) exitWith {cutText [format["%1 is not a vehicle..",typeOF _ct], "PLAIN"];};
            
            _id = _ct getVariable ["CharacterID","0"];
            _id = parsenumber _id;
            if (_id == 0) exitWith {cutText [format["%1 has ID 0 - No Key possible.",typeOF _ct], "PLAIN"];};
            if ((_id > 0) && (_id <= 2500)) then {_result = format["ItemKeyGreen%1",_id];};
            if ((_id > 2500) && (_id <= 5000)) then {_result = format["ItemKeyRed%1",_id-2500];};
            if ((_id > 5000) && (_id <= 7500)) then {_result = format["ItemKeyBlue%1",_id-5000];};
            if ((_id > 7500) && (_id <= 10000)) then {_result = format["ItemKeyYellow%1",_id-7500];};
            if ((_id > 10000) && (_id <= 12500)) then {_result = format["ItemKeyBlack%1",_id-10000];};
            
            _inventory = (weapons player);
            _backpack = ((getWeaponCargo unitbackpack player) select 0);
            if (_result in (_inventory+_backpack)) then
            {
                if (_result in _inventory) then {cutText [format["Key [%1] already in your inventory!",_result], "PLAIN"];};
                if (_result in _backpack) then {cutText [format["Key [%1] already in your backpack!",_result], "PLAIN"];};
            }
            else
            {
                player addweapon _result;
                cutText [format["Key [%1] added to your inventory!",_result], "PLAIN"];
                
                _pos = getPos _ct;
                _sl = format["%1 generated Key %2 for %3 (CharID %4) @%5",name player,_result,typeOF _ct,_id,mapGridPosition _pos];
                PVAH_WriteLogReq = [player,_sl];
                publicVariableServer "PVAH_WriteLogReq";
            };
        };
    };
 

 

Edited by TheFirstNoob
Оформление (Пользуйтесь кодом!!!) (see edit history)

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
Sign in to follow this  

×
×
  • 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.