Новости

SMF - Just Installed!

[Скрипт] Количество построенных объектов в радиусе PlotPole

ReloadeD · 1534

ReloadeD

  • Administrator
  • Новенький
  • *****
    • Сообщений: 17
    • Рейтинг: 15
    • Просмотр профиля
variables.sqf
if(isNil "DZE_PlotPole") then {
DZE_PlotPole = [30,45]; // установить радиус
};
if(isNil "DZE_BuildingLimit") then {
DZE_BuildingLimit = 250; // установить лимит объектов
};
	s_player_SurrenderedGear = -1; //найти
s_player_maintain_area = -1; //добавить
s_player_maintain_area_preview = -1; //добавить
s_player_maintain_area_count = -1; //добавить

fn_selfActions.sqf
	 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
if (s_player_maintain_area < 0) then {
  s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
s_player_maintain_area_count = player addaction [("<t color=""#ff0000"">" + ("Количество построек") +"</t>"),"custom\countpole.sqf",_cursorTarget,1,false,true,"",""]; //добавить
};
} else {
    player removeAction s_player_maintain_area;
    s_player_maintain_area = -1;
    player removeAction s_player_maintain_area_preview;
    s_player_maintain_area_preview = -1;
    player removeAction s_player_maintain_area_count; //добавить
    s_player_maintain_area_count = -1; //добавить
};
	player removeAction s_player_flipveh; //найти
s_player_flipveh = -1; //найти
player removeAction s_player_maintain_area; //добавить
s_player_maintain_area = -1; //добавить
player removeAction s_player_maintain_area_preview; //добавить
s_player_maintain_area_preview = -1; //добавить
player removeAction s_player_maintain_area_count; //добавить
s_player_maintain_area_count = -1; //добавить

countpole.sqf
private ["_countpole","_limited","_distance"];

_distance = 35; //установить значение идентичное DZE_PlotPole (+5)
_limited = 250; //установить значение идентичное DZE_BuildingLimit
_countpole = count (nearestObjects [player, [
"BagFenceRound_DZ"
,"BearTrap_DZ"
,"CanvasHut_DZ"
,"CinderWallDoorLocked_DZ"
,"CinderWallDoorSmallLocked_DZ"
,"CinderWallDoorSmall_DZ"
,"CinderWallDoor_DZ"
,"CinderWallDoorway_DZ"
,"CinderWallHalf_DZ"
,"CinderWallSmallDoorway_DZ"
,"CinderWall_DZ"
,"DeerStand_DZ"
,"DesertCamoNet_DZ"
,"DesertLargeCamoNet_DZ"
,"Fence_corrugated_DZ"
,"FireBarrel_DZ"
,"ForestCamoNet_DZ"
,"ForestLargeCamoNet_DZ"
,"Fort_RazorWire"
,"FuelPump_DZ"
,"Generator_DZ"
,"GunRack_DZ"
,"Hedgehog_DZ"
,"Land_DZE_GarageWoodDoor"
,"Land_DZE_GarageWoodDoorLocked"
,"Land_DZE_LargeWoodDoor"
,"Land_DZE_LargeWoodDoorLocked"
,"Land_DZE_WoodDoor"
,"Land_DZE_WoodDoorLocked"
,"Land_HBarrier1_DZ"
,"Land_HBarrier3_DZ"
,"Land_HBarrier5_DZ"
,"LightPole_DZ"
,"LockboxStorageLocked"
,"M240Nest_DZ"
,"MetalFloor_DZ"
,"MetalGate_DZ"
,"MetalPanel_DZ"
,"OutHouse_DZ"
,"ParkBench_DZ"
,"Plastic_Pole_EP1_DZ"
,"SandNest_DZ"
,"Sandbag1_DZ"
,"Scaffolding_DZ"
,"StickFence_DZ"
,"StorageShed_DZ"
,"TentStorage"
,"TentStorageDomed"
,"TentStorageDomed2"
,"TrapBear"
,"VaultStorageLocked"
,"WoodCrate_DZ"
,"WoodFloorHalf_DZ"
,"WoodFloorQuarter_DZ"
,"WoodFloor_DZ"
,"WoodGate_DZ"
,"WoodLadder_DZ"
,"WoodLargeWallDoor_DZ"
,"WoodLargeWallWin_DZ"
,"WoodLargeWall_DZ"
,"WoodRamp_DZ"
,"WoodShack_DZ"
,"WoodSmallWallDoor_DZ"
,"WoodSmallWallThird_DZ"
,"WoodSmallWallWin_DZ"
,"WoodSmallWall_DZ"
,"WoodStairsRails_DZ"
,"WoodStairsSans_DZ"
,"WoodStairs_DZ"
,"Wooden_shed_DZ"
,"WorkBench_DZ"
], _distance]);

if (_countpole > 0) then {
titleText [format["\n Количество построенных объектов: %1 \n Можно построить еще: %2 ",_countpole,(_limited - _countpole)], "PLAIN DOWN"];
player removeAction s_player_maintain_area_count;
s_player_maintain_area_count = -1;
} else {
titleText [format["\n Количество построенных объектов: 0 \n Можно построить еще: %1 ",_limited], "PLAIN DOWN"];
player removeAction s_player_maintain_area_count;
s_player_maintain_area_count = -1;
};

AHconfig.sqf
_dayzActions =
[
"s_player_maintain_area_count"  //добавить
];
« Последнее редактирование: Февраля 09, 2016, 03:21:01 pm от ReloadeD »