Some more position fixes

This commit is contained in:
icomrade
2016-02-18 09:15:40 -05:00
parent 6ec324cf10
commit 277d87fa3b
4 changed files with 13 additions and 12 deletions

View File

@@ -2,13 +2,13 @@
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_need","_needNear","_vehicle","_inVehicle","_requireplot","_objHDiff","_isLandFireDZ","_isTankTrap"];
private ["_location","_pos","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_need","_needNear","_vehicle","_inVehicle","_requireplot","_objHDiff","_isLandFireDZ","_isTankTrap"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_40") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
_pos = [player] call FNC_GetPos;
// disallow building if too many objects are found within 30m
if((count ((getPosATL player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(format [localize "str_epoch_player_41", DZE_PlotPole select 0]), "PLAIN DOWN"];};
if((count (_pos nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(format [localize "str_epoch_player_41", DZE_PlotPole select 0]), "PLAIN DOWN"];};
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = dayz_isSwimming;
@@ -55,7 +55,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
case "fire":
{
_distance = 3;
_isNear = {inflamed _x} count (getPosATL player nearObjects _distance);
_isNear = {inflamed _x} count (_pos nearObjects _distance);
if(_isNear == 0) then {
_abort = true;
_reason = "fire";
@@ -64,7 +64,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
case "workshop":
{
_distance = 3;
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
_isNear = count (nearestObjects [_pos, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
@@ -73,7 +73,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
case "fueltank":
{
_distance = 30;
_isNear = count (nearestObjects [player, dayz_fuelsources, _distance]);
_isNear = count (nearestObjects [_pos, dayz_fuelsources, _distance]);
if(_isNear == 0) then {
_abort = true;
_reason = "fuel tank";
@@ -125,7 +125,7 @@ if(_isPole) then {
};
// check for near plot
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPoles = nearestObjects [_pos, ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPole = [];
{

View File

@@ -1,4 +1,4 @@
private ["_item","_config","_onLadder","_create","_started","_finished","_animState","_isMedic","_qty","_b0x1337","_num_removed","_text","_haskey","_hastoolweapon","_isNear","_hasTinBar"];
private ["_item","_config","_pos","_onLadder","_create","_started","_finished","_animState","_isMedic","_qty","_b0x1337","_num_removed","_text","_haskey","_hastoolweapon","_isNear","_hasTinBar"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_56") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
@@ -16,7 +16,8 @@ if (!_haskey) exitWith {DZE_ActionInProgress = false; cutText [format[(localize
_hastoolweapon = "ItemKeyKit" in weapons player;
if (!_hastoolweapon) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_57") , "PLAIN DOWN"]};
_isNear = {inflamed _x} count (getPosATL player nearObjects 3);
_pos = [player] call FNC_GetPos;
_isNear = {inflamed _x} count (_pos nearObjects 3);
if(_isNear == 0) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_58") , "PLAIN DOWN"]};
call gear_ui_init;
@@ -28,7 +29,7 @@ if(!_hasTinBar) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,50,true,_pos] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;

View File

@@ -8,7 +8,7 @@ _dateNow = (DateToNumber date);
_maxWildZombies = 3;
_age = -1;
_radius = 200;
_position = getPosATL player;
_position = [player] call FNC_GetPos;
dayz_spawnZombies = 0;
dayz_CurrentZombies = 0;

View File

@@ -25,7 +25,7 @@ while {true} do {
};
if ((diag_tickTime - _timer1) > 60) then {
_position = getPosATL player;
_position = [player] call FNC_GetPos;
//Current amounts
dayz_spawnZombies = {alive _x AND local _x} count (_position nearEntities ["zZombie_Base",200]);
dayz_CurrentNearByZombies = {alive _x} count (_position nearEntities ["zZombie_Base",200]);