Merge pull request #899 from dayz10k/plotpreview

#846 Plotpreview
This commit is contained in:
HARLAN
2013-12-13 10:59:01 -08:00
3 changed files with 25 additions and 0 deletions

View File

@@ -471,6 +471,8 @@ if (_hasrequireditem) then {
if(_num_removed == 1) then {
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
if (_isPole) then {spawn player_plotPreview;};
_tmpbuilt setVariable ["OEMPos",_location,true];

View File

@@ -0,0 +1,22 @@
//Build preview adopted from Axe Cop (@vos) Base Destruction Script
private ["_location","_object","_objects","_i","_dir","_nearPlotPole"];
// global vars
_nearPlotPole = nearestObject [player, "Plastic_Pole_EP1_DZ", 3];
//"privatized" center variable
_BD_radius = 30;
_BD_center = getPos _nearPlotPole;
_objects = [];
// circle
for "_i" from 0 to 360 step (270 / _BD_radius) do {
_location = [(_BD_center select 0) + ((cos _i) * _BD_radius), (_BD_center select 1) + ((sin _i) * _BD_radius), _BD_center select 2];
_object = createVehicleLocal ["Plastic_Pole_EP1", _location, [], 0, "CAN_COLLIDE"];
_dir = ((_BD_center select 0) - (_location select 0)) atan2 ((_BD_center select 1) - (_location select 1));
_object setDir _dir;
_objects set [count _objects, _object];
};

View File

@@ -110,6 +110,7 @@ if (!isDedicated) then {
player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf";
player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
//ui