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
color32

Подскажите с maintain_area.sqf

Подскажите как сделать в файле maintain_area.sqf подсчет объектов велся по одному а не сразу да 10, 50 или 100.

private ["_newWealth","_missing","_missingQty","_proceed","_itemIn","_countIn","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_option"];
 
if (DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_ACTIONS_2") , "PLAIN DOWN"]; };
 
DZE_ActionInProgress = true;
 
player removeAction s_player_maintain_area;
s_player_maintain_area = 1;
player removeAction s_player_maintain_area_preview;
s_player_maintain_area_preview = 1;
 
_target = cursorTarget;
_objectClasses = DZE_maintainClasses;
_range = DZE_maintainRange;
_objects = nearestObjects [_target, _objectClasses, _range];
_objects_filtered = [];
 
{
    if (damage _x >= DZE_DamageBeforeMaint) then {
        _objects_filtered set [count _objects_filtered, _x];
   };
} count _objects;
 
_objects = _objects_filtered;
_count = count _objects;
 
if (_count == 0) exitWith {
	cutText [format[(localize "STR_EPOCH_ACTIONS_22"), _count], "PLAIN DOWN"];
	DZE_ActionInProgress = false;
	s_player_maintain_area = -1;
	s_player_maintain_area_preview = -1;
};
 
_requirements = [];
switch true do {
	case (_count <= 10): {_requirements = [[CurrencyName,5000]]};
	case (_count <= 20): {_requirements = [[CurrencyName,10000]]};
	case (_count <= 35): {_requirements = [[CurrencyName,17500]]};
	case (_count <= 50): {_requirements = [[CurrencyName,25000]]};
	case (_count <= 75): {_requirements = [[CurrencyName,37500]]};
	case (_count <= 100): {_requirements = [[CurrencyName,50000]]};
	case (_count <= 175): {_requirements = [[CurrencyName,87500]]};
	case (_count <= 250): {_requirements = [[CurrencyName,125000]]};
	case (_count <= 325): {_requirements = [[CurrencyName,162500]]};
	case (_count <= 400): {_requirements = [[CurrencyName,200000]]};
	case (_count <= 475): {_requirements = [[CurrencyName,237500]]};
	case (_count <= 550): {_requirements = [[CurrencyName,275000]]};
	case (_count <= 625): {_requirements = [[CurrencyName,312500]]};
	case (_count <= 750): {_requirements = [[CurrencyName,375000]]};
	case (_count <= 875): {_requirements = [[CurrencyName,437500]]};
	case (_count <= 1000): {_requirements = [[CurrencyName,500000]]};
	case (_count <= 1500): {_requirements = [[CurrencyName,750000]]};
};
_option = _this select 3;
 
switch _option do {
 
	case "maintain": {
 
		_wealth = player getVariable["cashMoney",0];
		_missing = "";
		_missingQty = 0;
		_proceed = true;
 
		{
			_itemIn = _x select 0;
			_countIn = _x select 1;
			if (_wealth < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _wealth); _proceed = false; };
		} count _requirements;
 
		if (_proceed) then {
 
			_newWealth = (_wealth - _countIn);
 
			player playActionNow "Medic";
			[player,_range,true,(getPosATL player)] spawn player_alertZombies;
 
			player setVariable["cashMoney",_newWealth,true];
 
			PVDZE_plr_Save = [player,(magazines player),true,true];
			publicVariableServer "PVDZE_plr_Save";
 
			PVDZE_maintainArea = [player,1,_target];
			publicVariableServer "PVDZE_maintainArea";
 
			cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];	
 
		} else {
 
			cutText [format[(localize "STR_EPOCH_ACTIONS_6"), _missingQty, CurrencyName], "PLAIN DOWN"];
 
		};
	};
	
	case "preview": {
 
		_cost = "";
 
		{
			_itemIn = _x select 0;
			_countIn = _x select 1;
			if (_cost != "") then {
				_cost = _cost + " and ";
			};
			_cost = _cost + (str(_countIn) + " " + CurrencyName);
		} count _requirements;
 
		cutText [format[(localize "STR_EPOCH_ACTIONS_7"), _count, _cost], "PLAIN DOWN"];
 
	};
};
 
DZE_ActionInProgress = false;
s_player_maintain_area = -1;
s_player_maintain_area_preview = -1;

Может как то вот так?
 

case (_count = 1): {_requirements = [[CurrencyName,5000]]};

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

switch do вообще убирай

_requirements = [[CurrencyName,(5000 * _count)]]
Edited by dimquea (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

  • Similar Content

    • By lansmax
      есть ли какая то рабочая программа admin tools для dayz epoch 1.0.6.1 ?
    • By catttt61
      Подскажите в каком файле можно поменять хранимое количество валюты в трейд зонах в ящиках, начальное количество валюты 10000 , хотелось бы увеличить где можно поменять это значение?  
    • By Boom
      Подскажите пожалуйста как прописать технику что-бы она каждый рестарт респавнилась по заданным координатам? и можно ли её поставить инфи и просто засейвить в БД через insert?
      И еще как в сектор FNG прописать технику к примеру хаммер, что нужно дописать в файл спавна ботов?
    • By Tasya_Busya
      Подскажите как перенести exile мод на другую карту а то устал искать и пробовать как это сделать?
    • By dok379
      Установил скрипт Igiload. Видел на одном сервере фишку, что можно продавать ящик из машины. Что за скрипт, может видел кто?
      И ещё, как убрать загрузку из транспортного средства? Просто не реалистично, когда ты сидишь в машине и коробка одним кликом загружается в машину.
  • 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.