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
MisaAmane

Добавление торговца

Как сделать чтобы торговец "мог торговать" только, если у человека -10000 хуманити? Или как изменить стандартное значение у обычных торговцев.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

1. http://s-platoon.ru/index.php?/topic/3443-dobavlenie-novogo-torgovtca/?hl=%2B%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C+%2B%D1%82%D0%BE%D1%80%D0%B3%D0%BE%D0%B2%D1%86%D0%B0

2. fn_selfAction.sqf

if (_isMan && !_isPZombie && _traderType in serverTraders) then 
	{
		
		if (s_player_parts_crtl < 0) then 
		{
			_humanity = 		player getVariable ["humanity",0];
			_traderMenu = 		call compile format["menu_%1;",_traderType];
			_low_high = 		"low";
			_humanity_logic = 	false;
			if ((_traderMenu select 2) == "friendly") then 
			{
				_humanity_logic = (_humanity < -5000);
			};
			if ((_traderMenu select 2) == "hostile") then 
			{
				_low_high = "high";
				_humanity_logic = (_humanity > -5000);
			};
			if ((_traderMenu select 2) == "hero") then 
			{
				_humanity_logic = (_humanity < 5000);
			};
			if(_humanity_logic) then 
			{
				_cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
				s_player_parts set [count s_player_parts,_cancel];
			} else 
			{
				{
					_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
					s_player_parts set [count s_player_parts,_buy];
				} count (_traderMenu select 1);
				_buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
				s_player_parts set [count s_player_parts,_buy];
			};
			s_player_parts_crtl = 1;
		};
	} else 
	{
		{player removeAction _x} count s_player_parts;s_player_parts = [];
		s_player_parts_crtl = -1;
	};

Share this post


Link to post
Share on other sites



  • 0

 

1. http://s-platoon.ru/index.php?/topic/3443-dobavlenie-novogo-torgovtca/?hl=%2B%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C+%2B%D1%82%D0%BE%D1%80%D0%B3%D0%BE%D0%B2%D1%86%D0%B0

 

2. fn_selfAction.sqf

if (_isMan && !_isPZombie && _traderType in serverTraders) then 
	{
		
		if (s_player_parts_crtl < 0) then 
		{
			_humanity = 		player getVariable ["humanity",0];
			_traderMenu = 		call compile format["menu_%1;",_traderType];
			_low_high = 		"low";
			_humanity_logic = 	false;
			if ((_traderMenu select 2) == "friendly") then 
			{
				_humanity_logic = (_humanity < -5000);
			};
			if ((_traderMenu select 2) == "hostile") then 
			{
				_low_high = "high";
				_humanity_logic = (_humanity > -5000);
			};
			if ((_traderMenu select 2) == "hero") then 
			{
				_humanity_logic = (_humanity < 5000);
			};
			if(_humanity_logic) then 
			{
				_cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
				s_player_parts set [count s_player_parts,_cancel];
			} else 
			{
				{
					_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
					s_player_parts set [count s_player_parts,_buy];
				} count (_traderMenu select 1);
				_buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
				s_player_parts set [count s_player_parts,_buy];
			};
			s_player_parts_crtl = 1;
		};
	} else 
	{
		{player removeAction _x} count s_player_parts;s_player_parts = [];
		s_player_parts_crtl = -1;
	};

Крайне признателен)

 

 

1. http://s-platoon.ru/index.php?/topic/3443-dobavlenie-novogo-torgovtca/?hl=%2B%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C+%2B%D1%82%D0%BE%D1%80%D0%B3%D0%BE%D0%B2%D1%86%D0%B0

 

2. fn_selfAction.sqf

if (_isMan && !_isPZombie && _traderType in serverTraders) then 
	{
		
		if (s_player_parts_crtl < 0) then 
		{
			_humanity = 		player getVariable ["humanity",0];
			_traderMenu = 		call compile format["menu_%1;",_traderType];
			_low_high = 		"low";
			_humanity_logic = 	false;
			if ((_traderMenu select 2) == "friendly") then 
			{
				_humanity_logic = (_humanity < -5000);
			};
			if ((_traderMenu select 2) == "hostile") then 
			{
				_low_high = "high";
				_humanity_logic = (_humanity > -5000);
			};
			if ((_traderMenu select 2) == "hero") then 
			{
				_humanity_logic = (_humanity < 5000);
			};
			if(_humanity_logic) then 
			{
				_cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
				s_player_parts set [count s_player_parts,_cancel];
			} else 
			{
				{
					_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
					s_player_parts set [count s_player_parts,_buy];
				} count (_traderMenu select 1);
				_buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""];
				s_player_parts set [count s_player_parts,_buy];
			};
			s_player_parts_crtl = 1;
		};
	} else 
	{
		{player removeAction _x} count s_player_parts;s_player_parts = [];
		s_player_parts_crtl = -1;
	};

А где тут моделька трейдера прописывается?

Share this post


Link to post
Share on other sites
  • 0

_this = createAgent ["Soldier_MG_PKM_PMC", [8264.5371, 15495.855, 3.7374172], [], 0, "CAN_COLLIDE"];

Share this post


Link to post
Share on other sites
  • 0

_this = createAgent ["Soldier_MG_PKM_PMC", [8264.5371, 15495.855, 3.7374172], [], 0, "CAN_COLLIDE"];

Нету меню торговца. Т.е. оно открывается, но категорий нету. Использую SC 3.0. Всё прописал, но категории так и не появилось.

 

Крайне признателен)

 

А где тут моделька трейдера прописывается?

Забыл дописать menu_ 

Всё ок :3 Спасибо.

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

      Подготовка
      Для начала нам понадобится подключить кастомный player_death.sqf в compiles.sqf
      Делается это следующим образом:
      В compiles.sqf заменить строку 
      player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf"; на
      player_death = compile preprocessFileLineNumbers "*ВАШ ПУТЬ*\player_death.sqf";  
      Если у вас стоит инфистар,то необходимо заменить строку в AH.sqf
      _death = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_death.sqf'; на
      _death = compile preprocessFileLineNumbers '*ВАШ ПУТЬ*\player_death.sqf';  
      В вашем кастомном player_death.sqf необходимо заменить 
      _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; if ((!isNull _source) && (_source != player)) then { _canHitFree = player getVariable ["freeTarget",false]; _isBandit = (player getVariable["humanity",0]) <= -2000; _punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop _humanityHit = 0; if (!_punishment) then { //i'm "not guilty" - kill me && be punished _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000; _humanityHit = -(2000 - _myKills); _kills = _source getVariable ["humanKills",0]; _source setVariable ["humanKills",(_kills + 1),true]; PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]]; publicVariableServer "PVDZE_send"; } else { //i'm "guilty" - kill me as bandit _killsV = _source getVariable ["banditKills",0]; _source setVariable ["banditKills",(_killsV + 1),true]; }; }; _body setVariable ["deathType",_method,true]; }; на
      _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; if ((!isNull _source) && (_source != player)) then { [player,_source]execVM "*ВАШ ПУТЬ*\humanityChange.sqf"; [player,_source]execVM "*ВАШ ПУТЬ*\kill_msg_send.sqf"; }; _body setVariable ["deathType",_method,true]; }; Отображение ника убийцы(Kill message)
       
      Создаем файл и закидываем в миссию файл kill_msg_send.sqf
      С содержанием
      private ["_victim","_killer","_vehicle","_weapon","_pic"]; _victim = _this select 0; _killer = _this select 1; _killerName = name _killer; _victimName = name _victim; _vehicle = typeOf (vehicle _killer); _weapon = currentWeapon _killer; if ((getText (configFile >> "CfgVehicles" >> _vehicle >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR","AllVehicles"]) then { _pic = gettext(configFile >> 'CfgVehicles' >> _vehicle >> 'picture'); } else { _pic = gettext(configFile >> 'cfgWeapons' >> _weapon >> 'picture'); }; _kill_txt = format ["<t align='left' size='0.5'>%1 </t>",_victimName]; _kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%1'/>",_pic]; _kill_txt = _kill_txt + format ["<t align='left' size='0.5'> %1 </t>",_killerName]; PVDZE_send = [player,"kill_message",[_kill_txt]]; publicVariableServer "PVDZE_send";  
      Далее,нам необходимо отредактировать файл server_sendToClient.sqf ,которой находится в директории сервера
      И добавить после
      case "tagFriendly": { PVDZE_plr_FriendRQ = _arraytosend; _owner publicVariableClient "PVDZE_plr_FriendRQ"; }; Это
      case "kill_message": { custom_kill_message_show = _arraytosend; publicVariable "custom_kill_message_show"; }; Теперь необходимо создать файл kill_msg_show.sqf в папке с вашей миссией
      с содержимым
      private ["_pos","_i"]; arr_kill = ["","","","","",""]; fnc_kill_message = { private ["_finaltxt"]; _finaltxt = _this select 0; for[{_i = 0},{(_i<6)},{_i = _i +1}] do { if((arr_kill select _i) == "") then { arr_kill set [_i,_finaltxt]; [_i] execVM "*ВАШ ПУТЬ*\kill_msg_delete.sqf"; _i = count(arr_kill); }; }; }; "custom_kill_message_show" addPublicVariableEventHandler {(_this select 1) call fnc_kill_message;}; while {true} do { _pos = 0.01; _layout = 1001; { [_x,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + _pos * safezoneH,0.3],5,0.5,0,_layout] spawn BIS_fnc_dynamicText; _pos = _pos + 0.021; _layout = _layout + 1; } ForEach arr_kill; sleep 1; }; Создать файл kill_msg_delete.sqf с 
      private["_pos"]; _pos = _this select 0; sleep 10; arr_kill set [_pos,""];  
      И вставить в init.sqf после строки
      _playerMonitor = [] execVM "custom\player_monitor.sqf"; строку
      execVM "*ВАШ ПУТЬ*\kill_msg_show.sqf"; Осталось только добавить
      custom_kill_message_show В первую строку файла publicvariable.txt
       
      Все,отображение ника убийцы готово!
       
       
      Изменение человечности за убийство Бандита\Героя
      создать файл humanityChange.sqf с содержимым
      private ["_victim","_killer","_myKills","_humanity","_killerHumanity","_isKillerBandit","_isBandit","_humanityHit","_kills","_killerGunner"]; _victim = _this select 0; _killer = _this select 1; _humanity = _victim getVariable["humanity",0]; _killerHumanity = _killer getVariable["humanity",0]; _isKillerBandit = (_killerHumanity) < 0 ; _isBandit = (_humanity) < 0; _humanityHit = 0; _myKills = 0; _killerVehicle = vehicle _killer; if(((!_isBandit) && _isKillerBandit) || (_isBandit && (!_isKillerBandit))) then { _myKills = round((_humanity) / 10); }; if(!_isBandit) then { _myKills = (_myKills + 200); _kills = _killer getVariable ["humanKills",0]; _killer setVariable ["humanKills",(_kills + 1),true]; } else { _myKills = (_myKills - 200); _kills = _killer getVariable ["banditKills",0]; _killer setVariable ["banditKills",(_kills + 1),true]; }; _killerGunner = gunner _killerVehicle; if(!isNil"_sourceGunner") then { _killer = _killerGunner; }; _humanityHit = _myKills * (-1); PVDZE_send = [_killer,"Humanity",[_killer,_humanityHit,300]]; publicVariableServer "PVDZE_send"; Изменение Человечности готово!
       
      Плюсы Всего этого:
      Отображение ника убийцы теперь работает всегда и корректно.(Если убивают с техники или с одного выстрела).
    • By virus160381
      Помогите пожалуйста добавить торговца на 1.0.6.2, искал гайды они все старые, на хх51. 
    • By Slonik
      Помогите пожалуйста. На сервере установлен скрипт R3F_Logistics. Помогите сделать так что бы можно  было продавать ящики на трейде не доставая их из машины или продать машину сразу с ящиком. Что то у меня не получается.
    • By misha123
      Здравствуйте хотел добавить крафты на сервер. Но не знаю как это сделать. Кто знает как добавить крафты подскажите пожалуйста скрипт. Хочется разнообразить сервер.
      Спасибо за внимание
    • By etojeflexx
      Доброго времени суток, хотел узнать, как можно подключать дополнительные постройки (допустим построенный город) к основной карте, чтобы не захламлять объектами основной файл миссии? 
  • 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.