-
Posts
209 -
Joined
-
Last visited
Content Type
Profiles
Forums
Articles
Posts posted by js2k6
-
-
Hi,
I was wondering if someone could help me with cleaning up some of the errors that are showing in client.rpt after playing in my taviana server
this error appears repeatedly.
if ( AGN_safeZoneMessages )> Error position: <_if ) then { if ( AGN_safeZoneMessages )> Error Undefined variable in expression: _if File mpmissions\__CUR_MP.Tavi\CAGN\agn_SafeZoneCommander.sqf, line 196 Error in expression <FindDisplay 106) }; };
this is line 196 of agn_SafeZoneCommander.sqf
if ( _skip && _if ) then { if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] This player is tagged friendly, you have access to this players bag") }; sleep 30; };
how would i go about defining the variable _if?
the complete file is pasted here.
-
to stop this you need to edit your server_cleanup.fsm around the check for hackers part.
and then add
_this setVariable ["Sarge",1,true];
or something similar to each of the vehicles init's?
or if you're using epoch admin tools. you would use malsar instead of sarge
this is assuming that you see KILLING A HACKER: entries in your rpt logs. and thats what is killing your players?
edit: refer to this
-
So it's the anti-hack causing this? I'll double check that I put the BattleEye filters in then. I'm also running OverPoch and have not gotten this to work since.
yeah i was using these tools fine with epoch, and then when we started overpoch servers the tp2me function was broken
and my spawn select script was also tp'ing players back to their random spawn location regardless of what they selected.
when i started looking through the overwatch files, i noticed the overwatch inbuilt antihack seemed to only cover teleporting.
so i added that variable to disable the overwatch antihack, and the default epoch ah is left on. and it works.
hope it works for you too.
-
edit: got all my things working. have also been able to manually spawn in WAI missions using this
stumbled across a link on these forums, and edited it to fit.
works like a charm.
(in case anyone in future ever stumbles across this post and wants to know how i got it working)
-
Addition:
playing around a bit more with the script.
This now displays the hint with the correct word. but still wont exec the events.
private ["_missionName","_var","_pveh"]; _missionName = _this select 0; _var = format ["%1 = true",_missionName]; _pveh = format ["publicVariableServer %1",_missionName]; if (1>0) then { hint format ["you are spawning %1",_missionName]; _var; _pveh; }
-
I've been trying to re-write the way i currently call in my admin events using epoch admin tools
and i'm not having much luck.
I have a method that works, but i'd like to simplify it using the %1 and such, like the skin change tool uses.
currently i have the event files stored in my server.pbo
I added pveh like so, and i can call them from the tools.
admincompiles.sqf inside server.pbo, (called from the bottom of init\server_functions.sqf)
// stop objects from despawning ProtectObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\protectobj.sqf"; // fill boxes gunCrate = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\gunCrate.sqf"; goldCrate = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\goldCrate.sqf"; buildCrate = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\buildCrate.sqf"; // events "RaceJetski" addPublicVariableEventHandler {execVM "\z\addons\dayz_server\adminevents\race_jetski.sqf";}; // cleanup "CleanupAdminEvent" addPublicVariableEventHandler {execVM "\z\addons\dayz_server\adminevents\cleanup.sqf";};
in AdminToolsMain.sqf I have
EventMenu = [ ["",true], ["Jetski Race",[],"", -5,[["expression",format[_EXECscript8,"raceJetski.sqf"]]],"1","1"], ["", [], "", -5,[["expression", ""]], "1", "0"], ["Cleanup Running Event",[10],"", -5,[["expression",format[_EXECscript8,"cleanup.sqf"]]],"1","1"], ["Main Menu", [12], "#USER:epochmenustart", -5, [["expression", ""]], "1", "1"] ];
raceJetski.sqf
RaceJetski = true; publicVariableServer "RaceJetski";
now this method does work, but it's horribly untidy and it also means I have to create a new file like raceJetski.sqf every time I create a new event, And i'd like to avoid it if possible.
what I want to do is something like this...
admintoolsmain.sqf
EventMenu= [ ["",true], ["Jetski Race",[],"",-5,[["expression",format[_EXECscript9,"RaceJetski","missionstart.sqf"]]],"1","1"], ["Other Admin Event",[],"",-5,[["expression",format[_EXECscript9,"otherEvent","missionstart.sqf"]]],"1","1"], ["Yet Another Event",[],"",-5,[["expression",format[_EXECscript9,"yetAnotherEvent","missionstart.sqf"]]],"1","1"] ["", [], "", -5,[["expression", ""]], "1", "0"], ["Cleanup Running Event",[10],"", -5,[["expression",format[_EXECscript8,"cleanup.sqf"]]],"1","1"], ["Main Menu", [12], "#USER:epochmenustart", -5, [["expression", ""]], "1", "1"] ];
so in missionstart.sqf
(this is the bit i need help with!!!)
private ["_missionStart"]; _missionStart = _this select 0; _missionStart = true; publicVariableServer _missionStart;
but this doesn't work of course, I'm just hoping someone can point me in the right direction. If what I want to do can't be done. that's fine. I'll continue using my old method. But I've gone through so many different links and guides, tried many different methods such as switch case, if, if else, nested ifs and I feel like i'm just beating my head against the wall.
-
I can teleport fine but if i try the teleport to me they pop in for only a sec then go back to their original place.
I have to get a vehicle tell them to get in and then teleport while inside to move them.
I found I was having this issue when i first switched from epoch to overpoch.
I added dayz_antihack = 0; to my init.sqf and I was able to use the tp2me function again
------------------------------------
I've been playing around a bit with pveh and calling my admin events using these tools. I've got a method that works. but it's untidy and upsets me.
I've been trying to rewrite it.
I also made a post in the scripting help section,
can anyone here help me with the bit i've highlighted in red? I feel like i'm close to achieving my goal, but i'm still beating my head against a wall,
-
^ what cen said.
at 35+ players, my server sits around the 5fps mark. and i have a shitload of objects on my cherno server (plot pole build limit is set to 700 so people can build giant monstrosities if they choose. i just stop them building in cities or near barracks)
at 1-5 players server fps hovers between 48-50
in my experience, as long as you stay above 3fps you wont run into any major issues.
-
you could create a headless client/mission starter to automatically start the mission. (you would need a second copy of arma 2 oa)
as far as i know, until something tries to connect to the server and the mission file is read/downloaded, the hive will not begin to load
you're going to have to do your own research into setting this up,
but for a while (before the 1.63 update i was running a mission starter, but in the end i found it to be a pointless waste of system resources.. and my attempts at setting up a decent headless client for z's / ai failed pretty miserably.
there are a few good guides out there, do a search around these forums. you'll find something that'll work for you i'm sure
-
easy enough to fix with notepad++ and find and replace.
find: Land_HBarrier5_DZ
replace with: Base_WarfareBBarrier5x
for instance. i'll have to make sure that the classnames dont move at all.
I'll have a look into it tonight, and edit post where necessary. thanks for letting me know
*EDIT*
I replaced all the classnames. and of course they all went the wrong way around :(
Smoose said he'll have another go at making it this weekend using the correct classname.
-
dude, thats pretty damn cool.
-
in init.sqf
[]execVM "map\mapname.sqf";
would be used if you were storing your map additions in the mission file.
because i'm storing my map additions in the server pbo, and the additions to server_functions.sqf is also in server pbo
call compile preProcessFileLineNumbers works.
i've been using this method for about 5 months now, it was the only way i could make the bridge to skalisty island work without rotating on my cherno server.
plus it keeps the mission file size down, so thats a bonus
the other good part, is the AI actually "see" the additional buildings when you call them server side. stops them from shooting straight through them.
-
with my map additions, ive created a folder called map in my server pbo
then at the very bottom of dayz_server\init\server_functions.sqf
i add the following
// map additions made in editor by jakehekesfists call compile preProcessFileLineNumbers "\z\addons\dayz_server\map\owtrader.sqf"; // overwatch trader call compile preProcessFileLineNumbers "\z\addons\dayz_server\map\lights.sqf"; // street lights in random places call compile preProcessFileLineNumbers "\z\addons\dayz_server\map\calamarTrader.sqf"; // calamar trader city // map additions made in editor by smooose call compile preProcessFileLineNumbers "\z\addons\dayz_server\map\corazonTrader.sqf"; // corazon trader city
-
updated original post, as mission.sqm contained sensors and markers for a seperate overwatch trader which i have not released
-
oh nice, such timing dude, i was gonna do all the work because didnt like the traders too.
Going to try iy yours.
did u edit mission.sqm too ? for markers and safezone ?
yeah, i may have edited it after you posted that.
but i added it to the post.
-
Hi, Recently I created a Lingor 1.5 overpoch server
And the first thing I noticed was that I really hated the layout of having the traders scattered around the place.
An individual trader here, another one over there.
A vehicle trader taking over the race track.
So I created a trader city, and my clanmate Smooose created a seperate trader city
these both use many of the existing traders, plus I have an additional overwatch weapons trader which has been added in.
I will include a few files which will need to be placed in your server pbo
here are some screenshots in the spoiler tag
http://pastebin.com/gHXCa9wn < -- calamarTrader.sqf
http://pastebin.com/cABgLcX2 <-- corazonTrader.sqf
to install these, add a folder called map to your server.pbo
add the following to the bottom of your server_functions.sqf (located in the init folder of your server.pbo)
call compile preProcessFileLineNumbers "\z\addons\dayz_server\map\calamarTrader.sqf"; // calamar trader city call compile preProcessFileLineNumbers "\z\addons\dayz_server\map\corazonTrader.sqf"; // corazon trader city
http://pastebin.com/tLbVS3Le <-- edited mission.sqf
if you want to remove many of the existing traders from lingor and replace them with our trader cities, copy the above mission.sqf
and overwrite your existing mission.sqf (located in the server.pbo in the \missions\DayZ_Epoch_7.Lingor\ folder)
/* EDIT
http://pastebin.com/V7s1sxU8 <-- edited mission.sqm (from mission.pbo) *edit - original file contained a marker for an unreleased overwatch trader - use this updated version instead*
*/
the above file will update the map markers for the trader cities and adds sensors to say "you are now entering trader city corazon" etc
this uses canbuild, so it will work with AGN safezones. *note my airfields are not protected by safezones*
also note, as my server is running overpoch. the addons section is full of overwatch parts.
extras
if you want to use my overwatch trader
you will need to make a few edits
the following edits go into server_traders.sqf in your mission.pbo
copy this section of code, and overwrite your existing section
serverTraders = ["RU_Worker1","Dr_Annie_Baker_EP1","CIV_EuroWoman01_EP1","Citizen2_EP1","ibr_lingorman2s","Worker2","TK_CIV_Woman03_EP1","ibr_lingorman3s","ibr_lingorman5s","ibr_lingorman4","ibr_lingorman2","Worker1","RU_Madam3","Pilot","CIV_EuroMan02_EP1","CIV_EuroMan01_EP1","ibr_lingorman7s","Damsel3","Rocker4","Worker4","ibr_lingorman7","ibr_lingorman5","Citizen3_EP1","ibr_lingorman6","ibr_lingorman6s","TK_CIV_Woman02_EP1","Pilot_EP1","TK_CIV_Worker01_EP1","RU_Doctor","Functionary1","TK_CIV_Takistani04_EP1","UN_CDF_Soldier_Guard_EP1"];
next, add this to the bottom of your file
// overwatch trader menu_UN_CDF_Soldier_Guard_EP1 = [ [["Pistols",1000],["ACRs",1100],["H&K Assault Rifles", 1101],["Magpul ACRs",1102],["Tarvors",1103],["Opfor Assault Rifles",1104],["Marksman Rifles",1002],["SMGs",1003],["Heavy Machine Guns",1004],["Assorted Ammunition",1005]], [], "neutral" ];
finally, if you need some SQL inserts so you can use my trader tid's,
http://pastebin.com/raw.php?i=Cbb6yHAN
copy and paste that, and run that sql insert.
of course, please back up your database before running this, because if anything goes wrong, I wont take responsibility for any damage that can occur to your hive.
enjoy :)
-
my suggestion, well its more of a tip really.
when using the 3d editor, and in particular placing those long/tall h barriers.
move the piece roughly into location, release mouse 1. then make a minor adjustment to the piece
then press save, if the piece moves. move it correctly into place. press save again.
its a pain, but do that with each piece and they should line up properly. your sandbag walls are giving me a bit of ocd. i just wanna fix them haha.
*edit*
the existing traders are located in the server.pbo
\missions\DayZ_Epoch_11.Chernarus\mission.sqf
you can find the biedi files for the existing traders https://github.com/vbawol/DayZ-Epoch/tree/master/TraderCitySources
i edit the biedi files to remove the things i dont want, then i use diffmerge so i can easily see which parts i need to remove from the mission.sqf file
good luck. happy editing
-
been able to get rid of my old debug monitor thanks to you asremix :)
-
does the ghost preview still cause issues with your latest release (v2)?
-
Arg I really want this.. but I don't want to give up geeks admin build. It is awesome for building stuff for admin events. Lets you set them up super fast. Is there any way to add geeks admin build to this?
I was having similar thoughts, so I decided to edit some files.
I used diffmerge to compare the files and copied the appropriate parts across
player_build.sqf (THIS ONE DOESNT WORK PROPERLY!!!!) - PROPER WORKING VERSION DOWN BELOW
/* DayZ Base Building Made for DayZ Epoch please ask permission to use/edit/distrubute email [email protected]. */ private ["_helperColor","_objectHelper","_objectHelperDir","_objectHelperPos","_canDo", "_location","_dir","_classname","_item","_hasRequiredTools","_missingT","_missingB","_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","_previewCounter","_requireplot","_objHupDiff","_objHDiff","_isLandFireDZ","_isTankTrap","_isNear2","_typeIsString","_isBuildAdmin","_needBuildItem","_hasbuilditems","_itemIn","_countIn","_qty","_missingQty","_textMissing","_removed","_tobe_removed_total","_removed_total","_ownerPUID", "_playerUID"]; DZE_BuildVector = [[0,0,0],[0,0,0]]; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_40") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; // disallow building if too many objects are found within 30m if((count ((getPosATL player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];}; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _isWater = dayz_isSwimming; _cancel = false; _reason = ""; _canBuildOnPlot = false; _isBuildAdmin = (getPlayerUID player) in WG_adminBuild; _vehicle = vehicle player; _inVehicle = (_vehicle != player); _playerUID = getPlayerUID player; //snap helperDetach = false; _canDo = (!r_drag_sqf and !r_player_unconscious); _vector = []; fnc_SetPitchBankYawBuild = { private ["_object","_rotations","_aroundX","_aroundY","_aroundZ","_dirX","_dirY","_dirZ","_upX","_upY","_upZ","_dir","_up","_dirXTemp", "_upXTemp"]; _object = _this select 0; _rotations = _this select 1; _aroundX = _rotations select 0; _aroundY = _rotations select 1; _aroundZ = (360 - (_rotations select 2)) - 360; _dirX = 0; _dirY = 1; _dirZ = 0; _upX = 0; _upY = 0; _upZ = 1; if (_aroundX != 0) then { _dirY = cos _aroundX; _dirZ = sin _aroundX; _upY = -sin _aroundX; _upZ = cos _aroundX; }; if (_aroundY != 0) then { _dirX = _dirZ * sin _aroundY; _dirZ = _dirZ * cos _aroundY; _upX = _upZ * sin _aroundY; _upZ = _upZ * cos _aroundY; }; if (_aroundZ != 0) then { _dirXTemp = _dirX; _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); _upXTemp = _upX; _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); }; _dir = [_dirX,_dirY,_dirZ]; _up = [_upX,_upY,_upZ]; _object setVectorDirAndUp [_dir,_up]; DZE_BuildVector = [_dir,_up]; }; DZE_Q = false; DZE_Z = false; DZE_Q_alt = false; DZE_Z_alt = false; DZE_Q_ctrl = false; DZE_Z_ctrl = false; DZE_5 = false; DZE_4 = false; DZE_6 = false; DZE_F = false; DZE_cancelBuilding = false; call gear_ui_init; closeDialog 1; if (_isWater) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"];}; if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];}; if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"];}; if (player getVariable["combattimeout", 0] >= time) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"];}; _typeIsString = ((typeName _this) == "STRING"); //diag_log format["Type is STRING: %1",_typeIsString]; if (_typeIsString) then { _item = _this; }; if (!_typeIsString) then { _item = _this select 0; }; // Need Near Requirements _abort = false; _distance = 10; _reason = ""; if (_typeIsString) then { _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "neednearby"); { switch(_x) do{ case "fire": { _distance = 3; _isNear = {inflamed _x} count (getPosATL player nearObjects _distance); if(_isNear == 0) then { _abort = true; _reason = "fire"; }; }; case "workshop": { _distance = 3; _isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]); if(_isNear == 0) then { _abort = true; _reason = "workshop"; }; }; case "fueltank": { _distance = 30; _isNear = count (nearestObjects [player, dayz_fuelsources, _distance]); _isNear2 = nearestObjects [player, dayz_fuelsources, _distance]; if(_isNear == 0) then { _abort = true; _reason = "fuel tank"; _distance = 30; }; }; }; } forEach _needNear; if(_abort) exitWith { cutText [format[(localize "str_epoch_player_135"),_reason,_distance], "PLAIN DOWN"]; DZE_ActionInProgress = false; }; }; if (_typeIsString) then { _classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create"); _classnametmp = _classname; _require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require"); }; if (!_typeIsString) then { _classname = _this select 0; _classnametmp = _classname; _require = _this select 1; }; _text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); _ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview"); _lockable = 0; if(isNumber (configFile >> "CfgVehicles" >> _classname >> "lockable")) then { _lockable = getNumber(configFile >> "CfgVehicles" >> _classname >> "lockable"); }; _requireplot = DZE_requireplot; if(isNumber (configFile >> "CfgVehicles" >> _classname >> "requireplot")) then { _requireplot = getNumber(configFile >> "CfgVehicles" >> _classname >> "requireplot"); }; _isAllowedUnderGround = 1; if(isNumber (configFile >> "CfgVehicles" >> _classname >> "nounderground")) then { _isAllowedUnderGround = getNumber(configFile >> "CfgVehicles" >> _classname >> "nounderground"); }; if (!_typeIsString) then { _offset = _this select 3; }; if (_typeIsString) then { _offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset"); if((count _offset) <= 0) then { _offset = [0,1.5,0]; }; }; _isPole = (_classname == "Plastic_Pole_EP1_DZ"); _isLandFireDZ = (_classname == "Land_Fire_DZ"); _distance = DZE_PlotPole select 0; _needText = localize "str_epoch_player_246"; if(_isPole) then { _distance = DZE_PlotPole select 1; }; // check for near plot _findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance]; _findNearestPole = []; { if (alive _x) then { _findNearestPole set [(count _findNearestPole),_x]; }; } count _findNearestPoles; _IsNearPlot = count (_findNearestPole); // If item is plot pole && another one exists within 45m if(_isPole && _IsNearPlot > 0) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; }; if(_IsNearPlot == 0) then { // Allow building of plot if(_requireplot == 0 || _isLandFireDZ) then { _canBuildOnPlot = true; }; } else { // Since there are plots nearby we check for ownership && then for friend status // check nearby plots ownership && then for friend status _nearestPole = _findNearestPole select 0; // Find owner _ownerID = _nearestPole getVariable ["ownerPUID","0"]; // //diag_log format["Player_build start: [PlayerUID = %1] [OwnerID = %2]", _playerUID, _ownerID]; // check if friendly to owner if(_playerUID == _ownerID) then { //Keep ownership // owner can build anything within his plot except other plots if(!_isPole) then { _canBuildOnPlot = true; }; } else { // disallow building plot if(!_isPole) then { _friendlies = player getVariable ["friendlyTo",[]]; // check if friendly to owner if(_ownerID in _friendlies) then { _canBuildOnPlot = true; }; }; }; }; // _message if(!_canBuildOnPlot) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; }; _missingT = ""; _missingB = ""; _hasRequiredTools = true; _hasbuilditem = true; if (!_isBuildAdmin) then { { //diag_log format["Testing for tool: %1",_x]; _hastoolweapon = _x in weapons player; if(!_hastoolweapon) exitWith {_hasRequiredTools = false; _missingT = getText (configFile >> "cfgWeapons" >> _x >> "displayName");}; } forEach _require; if (!_typeIsString && _hasRequiredTools) then { _needBuildItem = _this select 2; { _itemIn = _x select 0; _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if(_qty < _countIn) exitWith { _missingB = getText(configFile >> "CfgMagazines" >> _itemIn >> "displayName"); _missingQty = (_countIn - _qty); _hasbuilditem = false;}; } forEach _needBuildItem; }; if (_typeIsString && _hasRequiredTools) then { _hasbuilditem = _this in magazines player; }; }; // Message If missing if (!_hasRequiredTools) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_137"),_missingT] , "PLAIN DOWN"];}; if (!_typeIsString && !_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_146"),_missingQty, _missingB], "PLAIN DOWN"];}; if (_typeIsString && !_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; }; //Proceed after item check if (_hasRequiredTools && _hasbuilditem) then { _location = [0,0,0]; _isOk = true; // get inital players position _location1 = getPosATL player; _dir = getDir player; // if ghost preview available use that instead /*if (_ghost != "") then { _classname = _ghost; };*/ _object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; _object setDir 0; //Build gizmo _objectHelper = "Sign_sphere10cm_EP1" createVehicle _location; _helperColor = "#(argb,8,8,3)color(0,0,0,0,ca)"; _objectHelper setobjecttexture [0,_helperColor]; _objectHelper attachTo [player,_offset]; _object attachTo [_objectHelper,[0,0,0]]; _position = getPosATL _objectHelper; //cutText [(localize "str_epoch_player_45"), "PLAIN DOWN"]; _objHDiff = 0; if (isClass (missionConfigFile >> "SnapBuilding" >> _classname)) then { ["","","",["Init",_object,_classname,_objectHelper]] spawn snap_build; }; if (isClass (missionConfigFile >> "SnapBuilding" >> _classname)) then { ["","","",["Init",_object,_classname,_objectHelper]] spawn snap_build; }; DZE_updateVec = false; DZE_memDir = getDir _objectHelper; DZE_memForBack = 0; DZE_memLeftRight = 0; if !(_classname in DZE_noRotate) then{ s_player_setVectorsReset = player addaction ["Reset","custom\snap_pro\player_vectorChange.sqf","reset"]; s_player_setVectorsForward = player addaction ["Pitch Forward","custom\snap_pro\player_vectorChange.sqf","forward"]; s_player_setVectorsBack = player addaction ["Pitch Back","custom\snap_pro\player_vectorChange.sqf","back"]; s_player_setVectorsLeft = player addaction ["Bank Left","custom\snap_pro\player_vectorChange.sqf","left"]; s_player_setVectorsRight = player addaction ["Bank Right","custom\snap_pro\player_vectorChange.sqf","right"]; s_player_setVectors1 = player addaction ["Increment by 1 degree","custom\snap_pro\player_vectorChange.sqf","1"]; s_player_setVectors5 = player addaction ["Increment by 5 degrees","custom\snap_pro\player_vectorChange.sqf","5"]; s_player_setVectors45 = player addaction ["Increment by 45 degrees","custom\snap_pro\player_vectorChange.sqf","45"]; s_player_setVectors90 = player addaction ["Increment by 90 degrees","custom\snap_pro\player_vectorChange.sqf","90"]; }; while {_isOk} do { _zheightchanged = false; _zheightdirection = ""; _rotate = false; if (DZE_Q) then { DZE_Q = false; _zheightdirection = "up"; _zheightchanged = true; }; if (DZE_Z) then { DZE_Z = false; _zheightdirection = "down"; _zheightchanged = true; }; if (DZE_Q_alt) then { DZE_Q_alt = false; _zheightdirection = "up_alt"; _zheightchanged = true; }; if (DZE_Z_alt) then { DZE_Z_alt = false; _zheightdirection = "down_alt"; _zheightchanged = true; }; if (DZE_Q_ctrl) then { DZE_Q_ctrl = false; _zheightdirection = "up_ctrl"; _zheightchanged = true; }; if (DZE_Z_ctrl) then { DZE_Z_ctrl = false; _zheightdirection = "down_ctrl"; _zheightchanged = true; }; if (DZE_4) then { _rotate = true; DZE_4 = false; if (helperDetach) then { _dir = -45; DZE_memDir = DZE_memDir - 45; } else { _dir = 180; DZE_memDir = 180; }; }; if (DZE_6) then { _rotate = true; DZE_6 = false; if (helperDetach) then { _dir = 45; DZE_memDir = DZE_memDir + 45; } else { _dir = 0; DZE_memDir = 0; }; }; if(DZE_updateVec) then{ [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; DZE_updateVec = false; }; if (DZE_F and _canDo) then { if (helperDetach) then { _objectHelper attachTo [player]; DZE_memDir = DZE_memDir-(getDir player); helperDetach = false; [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; } else { _objectHelperPos = getPosATL _objectHelper; detach _objectHelper; DZE_memDir = getDir _objectHelper; [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; _objectHelper setPosATL _objectHelperPos; _objectHelper setVelocity [0,0,0]; //fix sliding glitch helperDetach = true; }; DZE_F = false; }; if(_rotate) then { [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; }; if(_zheightchanged) then { if (!helperDetach) then { detach _objectHelper; }; _position = getPosATL _objectHelper; if(_zheightdirection == "up") then { _position set [2,((_position select 2)+0.1)]; _objHDiff = _objHDiff + 0.1; }; if(_zheightdirection == "down") then { _position set [2,((_position select 2)-0.1)]; _objHDiff = _objHDiff - 0.1; }; if(_zheightdirection == "up_alt") then { _position set [2,((_position select 2)+1)]; _objHDiff = _objHDiff + 1; }; if(_zheightdirection == "down_alt") then { _position set [2,((_position select 2)-1)]; _objHDiff = _objHDiff - 1; }; if(_zheightdirection == "up_ctrl") then { _position set [2,((_position select 2)+0.01)]; _objHDiff = _objHDiff + 0.01; }; if(_zheightdirection == "down_ctrl") then { _position set [2,((_position select 2)-0.01)]; _objHDiff = _objHDiff - 0.01; }; _objectHelper setDir (getDir _objectHelper); if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then { _position set [2,0]; }; _objectHelper setPosATL _position; //diag_log format["DEBUG Change BUILDING POS: %1", _position]; if (!helperDetach) then { _objectHelper attachTo [player]; }; [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; }; sleep 0.5; _location2 = getPosATL player; if(DZE_5) exitWith { _isOk = false; detach _object; _dir = getDir _object; _vector = [(vectorDir _object),(vectorUp _object)]; _position = getPosATL _object; //diag_log format["DEBUG BUILDING POS: %1", _position]; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if(_location1 distance _location2 > 10) exitWith { _isOk = false; _cancel = true; _reason = "You've moved to far away from where you started building (within 10 meters)"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if(_IsNearPlot == 0 && !_isPole) then { _findNearestPoles = nearestObjects [_objectHelper, ["Plastic_Pole_EP1_DZ"], 30]; _nearestPole = _findNearestPoles select 0; _objectHelperPos = getPosATL _objectHelper; if (_objectHelperPos distance _nearestPole < 30) exitWith { _isOk = false; _cancel = true; _reason = "You cannot enter plot pole area while building is in progress"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; }; if(_location1 distance _objectHelperPos > 10) exitWith { _isOk = false; _cancel = true; _reason = "Object is placed to far away from where you started building (within 10 meters)"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if(abs(_objHDiff) > 10) exitWith { _isOk = false; _cancel = true; _reason = "Cannot move up || down more than 10 meters"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if (player getVariable["combattimeout", 0] >= time) exitWith { _isOk = false; _cancel = true; _reason = (localize "str_epoch_player_43"); detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if (DZE_cancelBuilding) exitWith { _isOk = false; _cancel = true; _reason = "Cancelled building."; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; }; if !(_classname in DZE_noRotate) then{ player removeAction s_player_setVectorsReset; player removeAction s_player_setVectorsForward; player removeAction s_player_setVectorsBack; player removeAction s_player_setVectorsLeft; player removeAction s_player_setVectorsRight; player removeAction s_player_setVectors1; player removeAction s_player_setVectors5; player removeAction s_player_setVectors45; player removeAction s_player_setVectors90; }; //No building on roads unless toggled if (!DZE_BuildOnRoads) then { if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; }; }; // No building in trader zones if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; }; if(!_cancel) then { _classname = _classnametmp; // Start Build _tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; _tmpbuilt setdir _dir; // Get position based on object _location = _position; if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then { _location set [2,0]; }; _tmpbuilt setVectorDirAndUp _vector; _tmpbuilt setPosATL _location; cutText [format[(localize "str_epoch_player_138"),_text], "PLAIN DOWN"]; _limit = 3; if (DZE_StaticConstructionCount > 0) then { _limit = DZE_StaticConstructionCount; } else { if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then { _limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount"); }; }; _isOk = true; _proceed = false; _counter = 0; while {_isOk && !_isBuildAdmin} do { [10,10] call dayz_HungerThirst; player playActionNow "Medic"; _dis=20; _sfx = "repair"; [player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_dis,true,(getPosATL player)] spawn player_alertZombies; r_interrupt = false; _animState = animationState player; r_doLoop = true; _started = false; _finished = false; while {r_doLoop} do { _animState = animationState player; _isMedic = ["medic",_animState] call fnc_inString; if (_isMedic) then { _started = true; }; if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then { r_doLoop = false; }; if (DZE_cancelBuilding) exitWith { r_doLoop = false; }; sleep 0.1; }; r_doLoop = false; if(!_finished) exitWith { _isOk = false; _proceed = false; }; if(_finished) then { _counter = _counter + 1; }; cutText [format[(localize "str_epoch_player_139"),_text, _counter,_limit], "PLAIN DOWN"]; if(_counter == _limit) exitWith { _isOk = false; _proceed = true; }; }; if (_isBuildAdmin) then { _isOk = false; _proceed = true; }; if (_proceed) then { //diag_log "Proceed OK"; _tobe_removed_total = 0; _removed_total = 0; _temp_removed_array = []; if (!_isBuildAdmin) then { //diag_log "Is Admin REMOVE NOT OK"; if (_typeIsString) then { _tobe_removed_total = ([player,_item] call BIS_fnc_invRemove); _removed_total = _tobe_removed_total; }; if (!_typeIsString) then { { _removed = 0; _itemIn = _x select 0; _countIn = _x select 1; // //diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn]; _tobe_removed_total = _tobe_removed_total + _countIn; { if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then { _num_removed = ([player,_x] call BIS_fnc_invRemove); _removed = _removed + _num_removed; _removed_total = _removed_total + _num_removed; if(_num_removed == 1) then { _temp_removed_array set [count _temp_removed_array,_x]; }; }; } forEach magazines player; } forEach _needBuildItem; }; } else { //diag_log "Is Admin REMOVE OK"; _tobe_removed_total = 1; _removed_total = 1; }; if((_tobe_removed_total == _removed_total) && (_removed_total >= 1)) then { //diag_log "Removed Item OK"; cutText [format[localize "str_build_01",_text], "PLAIN DOWN"]; if (_isPole) then { [] spawn player_plotPreview; }; _tmpbuilt setVariable ["OEMPos",_location,true]; if(_lockable > 1) then { //diag_log "Is Lockable OK"; _combinationDisplay = ""; switch (_lockable) do { case 2: { // 2 lockbox _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue _combination_2 = floor(random 10); _combination_3 = floor(random 10); _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; dayz_combination = _combination; if (_combination_1 == 100) then { _combination_1_Display = "Red"; }; if (_combination_1 == 101) then { _combination_1_Display = "Green"; }; if (_combination_1 == 102) then { _combination_1_Display = "Blue"; }; _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3]; }; case 3: { // 3 combolock _combination_1 = floor(random 10); _combination_2 = floor(random 10); _combination_3 = floor(random 10); _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; dayz_combination = _combination; _combinationDisplay = _combination; }; case 4: { // 4 safe _combination_1 = floor(random 10); _combination_2 = floor(random 10); _combination_3 = floor(random 10); _combination_4 = floor(random 10); _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4]; dayz_combination = _combination; _combinationDisplay = _combination; }; }; _tmpbuilt setVariable ["CharacterID",_combination,true]; _tmpbuilt setVariable ["ownerPUID",_playerUID,true]; PVDZE_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,_playerUID],_classname]; //diag_log "Publish Lockable"; publicVariableServer "PVDZE_obj_Publish"; cutText [format[(localize "str_epoch_player_140"),_combinationDisplay,_text], "PLAIN DOWN", 5]; } else { _tmpbuilt setVariable ["CharacterID",dayz_characterID,true]; _tmpbuilt setVariable ["ownerPUID",_playerUID,true]; // fire? if(_tmpbuilt isKindOf "Land_Fire_DZ") then { _tmpbuilt spawn player_fireMonitor; } else { //diag_log "Publish Other"; PVDZE_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,_playerUID],_classname]; publicVariableServer "PVDZE_obj_Publish"; }; }; } else { //diag_log "Remove Item NOT OK"; deleteVehicle _tmpbuilt; cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"]; { [player,_x] call BIS_fnc_invAdd; } forEach _temp_removed_array; }; } else { //diag_log "Proceed NOT OK"; r_interrupt = false; if (vehicle player == player) then { [objNull, player, rSwitchMove,""] call RE; player playActionNow "stop"; }; deleteVehicle _tmpbuilt; cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"]; }; } else { //diag_log "Cancel is TRUE"; deleteVehicle _tmpbuilt; cutText [format[(localize "str_epoch_player_47"),_text,_reason], "PLAIN DOWN"]; }; }; DZE_ActionInProgress = false;
player_upgrade.sqf (working fine)
/* DayZ Base Building Upgrades Made for DayZ Epoch please ask permission to use/edit/distrubute email [email protected]. */ private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_distance","_needText","_findNearestPoles","_findNearestPole","_IsNearPlot","_isBuildAdmin"]; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_52") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; player removeAction s_player_upgrade_build; s_player_upgrade_build = 1; _distance = 30; _needText = localize "str_epoch_player_246"; // check for near plot _findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance]; _findNearestPole = []; _isBuildAdmin = (getPlayerUID player) in WG_adminBuild; { if (alive _x) then { _findNearestPole set [(count _findNearestPole),_x]; }; } count _findNearestPoles; _IsNearPlot = count (_findNearestPole); _canBuildOnPlot = false; if(_IsNearPlot == 0) then { _canBuildOnPlot = true; } else { // check nearby plots ownership && then for friend status _nearestPole = _findNearestPole select 0; // Find owner _ownerID = _nearestPole getVariable["ownerPUID","0"]; _playerUID = getPlayerUID player; // diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID]; // check if friendly to owner if(_playerUID == _ownerID) then { _canBuildOnPlot = true; } else { _friendlies = player getVariable ["friendlyTo",[]]; // check if friendly to owner if(_ownerID in _friendlies) then { _canBuildOnPlot = true; }; }; }; // exit if not allowed due to plot pole if(!_canBuildOnPlot) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_157"),_needText,_distance] , "PLAIN DOWN"]; }; // get cursortarget from addaction _obj = _this select 3; // Find objectID _objectID = _obj getVariable ["ObjectID","0"]; // Find objectUID _objectUID = _obj getVariable ["ObjectUID","0"]; if(_objectID == "0" && _objectUID == "0") exitWith {DZE_ActionInProgress = false; s_player_upgrade_build = -1; cutText [(localize "str_epoch_player_50"), "PLAIN DOWN"];}; // Get classname _classname = typeOf _obj; // Find display name _text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); // Find next upgrade _upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "upgradeBuilding"); if ((count _upgrade) > 0) then { _newclassname = _upgrade select 0; _lockable = 0; if(isNumber (configFile >> "CfgVehicles" >> _newclassname >> "lockable")) then { _lockable = getNumber(configFile >> "CfgVehicles" >> _newclassname >> "lockable"); }; _requirements = _upgrade select 1; _missingQty = 0; _missing = ""; _proceed = true; if (!_isBuildAdmin) then { { _itemIn = _x select 0; _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; } forEach _requirements; }; if (_proceed) then { if (!_isBuildAdmin) then { [1,1] call dayz_HungerThirst; player playActionNow "Medic"; [player,20,true,(getPosATL player)] spawn player_alertZombies; }; _temp_removed_array = []; _removed_total = 0; _tobe_removed_total = 0; if (!_isBuildAdmin) then { { _removed = 0; _itemIn = _x select 0; _countIn = _x select 1; // diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn]; _tobe_removed_total = _tobe_removed_total + _countIn; { if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then { _num_removed = ([player,_x] call BIS_fnc_invRemove); _removed = _removed + _num_removed; _removed_total = _removed_total + _num_removed; if(_num_removed >= 1) then { _temp_removed_array set [count _temp_removed_array,_x]; }; }; } forEach magazines player; } forEach _requirements; }; // all parts removed proceed if (_tobe_removed_total == _removed_total) then { // Get position _location = _obj getVariable["OEMPos",(getposATL _obj)]; // Get direction _dir = getDir _obj; // Get Vector _vector = [(vectorDir _obj),(vectorUp _obj)]; // Current charID _objectCharacterID = _obj getVariable ["CharacterID","0"]; _ownerID = _obj getVariable["ownerPUID","0"]; _classname = _newclassname; // Create new object _object = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"]; // Set direction _object setDir _dir; // Set vector _object setVectorDirAndUp _vector; // Set location _object setPosATL _location; // Set Owner. _object setVariable ["ownerPUID",_ownerID,true]; if (_lockable == 3) then { _combination_1 = floor(random 10); _combination_2 = floor(random 10); _combination_3 = floor(random 10); _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; _objectCharacterID = _combination; cutText [format[(localize "str_epoch_player_158"),_combination,_text], "PLAIN DOWN", 5]; } else { cutText [format[(localize "str_epoch_player_159"),_text], "PLAIN DOWN", 5]; }; PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location, _ownerID, _vector],_classname,_obj,player]; publicVariableServer "PVDZE_obj_Swap"; player reveal _object; } else { {player addMagazine _x;} count _temp_removed_array; cutText [format[(localize "str_epoch_player_145"),_removed_total,_tobe_removed_total], "PLAIN DOWN"]; }; } else { _textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName"); cutText [format[(localize "str_epoch_player_146"),_missingQty, _textMissing], "PLAIN DOWN"]; }; } else { cutText [(localize "str_epoch_player_82"), "PLAIN DOWN"]; }; DZE_ActionInProgress = false; s_player_upgrade_build = -1;
this works with all my right click extra buildables, geeks admin build, p4l, vectors, and snap pro
Now, for me i've got this working pretty much fine. i've just noticed that metal floors don't like to be saved with vectors. they reset to being flat on restart.
is this a common issue? or is this due to the changes ive made to get things working with my customised files?
everything else i've built on my test server is fine. and saves correctly.
the worldspace doesn't appear to be getting updated in my sql db for floors like it is with everything else
example below:
ObjectUID;Instance;Classname;Datestamp;LastUpdated;CharacterID;Worldspace;Inventory;Hitpoints;Fuel;Damage 1985044584080;11;CinderWall_DZ;2014-08-09 13:17:07;2014-08-09 13:17:07;660;[353.354,[1984.97,4458.41,0.039],"76561198035522330",[[-0.116,0.993,0],[-0.702,-0.082,0.707]]];[];[];0.00000;0.00000 ObjectUID;Instance;Classname;Datestamp;LastUpdated;CharacterID;Worldspace;Inventory;Hitpoints;Fuel;Damage 19830445542983;11;MetalFloor_DZ;2014-08-09 13:20:41;2014-08-09 13:20:41;660;[83.337,[1983.03,4455.39,2.86],"76561198035522330"];[];[];0.00000;0.00000
edit* im just going through my player_build.sqf again and have noticed some of my PVDZE_obj_Publish = lines have omitted the _vector part. i'll re-add and see how it goes
edit2* i updated player_build.sqf to include the _vector lines... lo and behold it all works. it was me who stuffed up (no surprises there haha)
updated player_build.sqf (working with vectors, snap-pro, plot 4 life, geeks admin build + extra right click buildables)
this one functions properly. it is based off prymary's
/* DayZ Base Building Made for DayZ Epoch please ask permission to use/edit/distrubute email [email protected]. */ private ["_helperColor","_objectHelper","_objectHelperDir","_objectHelperPos","_canDo", "_location","_dir","_classname","_item","_hasRequiredTools","_missingT","_missingB","_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","_previewCounter","_requireplot","_objHupDiff","_objHDiff","_isLandFireDZ","_isTankTrap","_isNear2","_typeIsString","_isBuildAdmin","_needBuildItem","_hasbuilditems","_itemIn","_countIn","_qty","_missingQty","_textMissing","_removed","_tobe_removed_total","_removed_total","_ownerPUID", "_playerUID"]; DZE_BuildVector = [[0,0,0],[0,0,0]]; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_40") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; // disallow building if too many objects are found within 30m if((count ((getPosATL player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];}; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _isWater = dayz_isSwimming; _cancel = false; _reason = ""; _canBuildOnPlot = false; _isBuildAdmin = (getPlayerUID player) in WG_adminBuild; _vehicle = vehicle player; _inVehicle = (_vehicle != player); _playerUID = getPlayerUID player; //snap helperDetach = false; _canDo = (!r_drag_sqf and !r_player_unconscious); _vector = []; fnc_SetPitchBankYawBuild = { private ["_object","_rotations","_aroundX","_aroundY","_aroundZ","_dirX","_dirY","_dirZ","_upX","_upY","_upZ","_dir","_up","_dirXTemp", "_upXTemp"]; _object = _this select 0; _rotations = _this select 1; _aroundX = _rotations select 0; _aroundY = _rotations select 1; _aroundZ = (360 - (_rotations select 2)) - 360; _dirX = 0; _dirY = 1; _dirZ = 0; _upX = 0; _upY = 0; _upZ = 1; if (_aroundX != 0) then { _dirY = cos _aroundX; _dirZ = sin _aroundX; _upY = -sin _aroundX; _upZ = cos _aroundX; }; if (_aroundY != 0) then { _dirX = _dirZ * sin _aroundY; _dirZ = _dirZ * cos _aroundY; _upX = _upZ * sin _aroundY; _upZ = _upZ * cos _aroundY; }; if (_aroundZ != 0) then { _dirXTemp = _dirX; _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); _upXTemp = _upX; _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); }; _dir = [_dirX,_dirY,_dirZ]; _up = [_upX,_upY,_upZ]; _object setVectorDirAndUp [_dir,_up]; DZE_BuildVector = [_dir,_up]; }; DZE_Q = false; DZE_Z = false; DZE_Q_alt = false; DZE_Z_alt = false; DZE_Q_ctrl = false; DZE_Z_ctrl = false; DZE_5 = false; DZE_4 = false; DZE_6 = false; DZE_F = false; DZE_cancelBuilding = false; call gear_ui_init; closeDialog 1; if (_isWater) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"];}; if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];}; if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"];}; if (player getVariable["combattimeout", 0] >= time) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"];}; _typeIsString = ((typeName _this) == "STRING"); //diag_log format["Type is STRING: %1",_typeIsString]; if (_typeIsString) then { _item = _this; }; if (!_typeIsString) then { _item = _this select 0; }; // Need Near Requirements _abort = false; _distance = 10; _reason = ""; if (_typeIsString) then { _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "neednearby"); { switch(_x) do{ case "fire": { _distance = 3; _isNear = {inflamed _x} count (getPosATL player nearObjects _distance); if(_isNear == 0) then { _abort = true; _reason = "fire"; }; }; case "workshop": { _distance = 3; _isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]); if(_isNear == 0) then { _abort = true; _reason = "workshop"; }; }; case "fueltank": { _distance = 30; _isNear = count (nearestObjects [player, dayz_fuelsources, _distance]); if(_isNear == 0) then { _abort = true; _reason = "fuel tank"; }; }; }; } forEach _needNear; if(_abort) exitWith { cutText [format[(localize "str_epoch_player_135"),_reason,_distance], "PLAIN DOWN"]; DZE_ActionInProgress = false; }; }; if (_typeIsString) then { _classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create"); _classnametmp = _classname; _require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require"); }; if (!_typeIsString) then { _classname = _this select 0; _classnametmp = _classname; _require = _this select 1; }; _text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); _ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview"); _lockable = 0; if(isNumber (configFile >> "CfgVehicles" >> _classname >> "lockable")) then { _lockable = getNumber(configFile >> "CfgVehicles" >> _classname >> "lockable"); }; _requireplot = DZE_requireplot; if(isNumber (configFile >> "CfgVehicles" >> _classname >> "requireplot")) then { _requireplot = getNumber(configFile >> "CfgVehicles" >> _classname >> "requireplot"); }; _isAllowedUnderGround = 1; if(isNumber (configFile >> "CfgVehicles" >> _classname >> "nounderground")) then { _isAllowedUnderGround = getNumber(configFile >> "CfgVehicles" >> _classname >> "nounderground"); }; if (!_typeIsString) then { _offset = _this select 3; }; if (_typeIsString) then { _offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset"); if((count _offset) <= 0) then { _offset = [0,1.5,0]; }; }; _isPole = (_classname == "Plastic_Pole_EP1_DZ"); _isLandFireDZ = (_classname == "Land_Fire_DZ"); _distance = DZE_PlotPole select 0; _needText = localize "str_epoch_player_246"; if(_isPole) then { _distance = DZE_PlotPole select 1; }; // check for near plot _findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance]; _findNearestPole = []; { if (alive _x) then { _findNearestPole set [(count _findNearestPole),_x]; }; } count _findNearestPoles; _IsNearPlot = count (_findNearestPole); // If item is plot pole && another one exists within 45m if(_isPole && _IsNearPlot > 0) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; }; if(_IsNearPlot == 0) then { // Allow building of plot if(_requireplot == 0 || _isLandFireDZ) then { _canBuildOnPlot = true; }; } else { // Since there are plots nearby we check for ownership && then for friend status // check nearby plots ownership && then for friend status _nearestPole = _findNearestPole select 0; // Find owner _ownerID = _nearestPole getVariable ["ownerPUID","0"]; // //diag_log format["Player_build start: [PlayerUID = %1] [OwnerID = %2]", _playerUID, _ownerID]; // check if friendly to owner if(_playerUID == _ownerID) then { //Keep ownership // owner can build anything within his plot except other plots if(!_isPole) then { _canBuildOnPlot = true; }; } else { // disallow building plot if(!_isPole) then { _friendlies = player getVariable ["friendlyTo",[]]; // check if friendly to owner if(_ownerID in _friendlies) then { _canBuildOnPlot = true; }; }; }; }; // _message if(!_canBuildOnPlot) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; }; _missingT = ""; _missingB = ""; _hasRequiredTools = true; _hasbuilditem = true; if (!_isBuildAdmin) then { { //diag_log format["Testing for tool: %1",_x]; _hastoolweapon = _x in weapons player; if(!_hastoolweapon) exitWith {_hasRequiredTools = false; _missingT = getText (configFile >> "cfgWeapons" >> _x >> "displayName");}; } forEach _require; if (!_typeIsString && _hasRequiredTools) then { _needBuildItem = _this select 2; { _itemIn = _x select 0; _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if(_qty < _countIn) exitWith { _missingB = getText(configFile >> "CfgMagazines" >> _itemIn >> "displayName"); _missingQty = (_countIn - _qty); _hasbuilditem = false;}; } forEach _needBuildItem; }; if (_typeIsString && _hasRequiredTools) then { _hasbuilditem = _this in magazines player; }; }; // Message If missing if (!_hasRequiredTools) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_137"),_missingT] , "PLAIN DOWN"];}; if (!_typeIsString && !_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_146"),_missingQty, _missingB], "PLAIN DOWN"];}; if (_typeIsString && !_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; }; //Proceed after item check if (_hasRequiredTools && _hasbuilditem) then { _location = [0,0,0]; _isOk = true; // get inital players position _location1 = getPosATL player; _dir = getDir player; // if ghost preview available use that instead /*if (_ghost != "") then { _classname = _ghost; };*/ _object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; _object setDir 0; //Build gizmo _objectHelper = "Sign_sphere10cm_EP1" createVehicle _location; _helperColor = "#(argb,8,8,3)color(0,0,0,0,ca)"; _objectHelper setobjecttexture [0,_helperColor]; _objectHelper attachTo [player,_offset]; _object attachTo [_objectHelper,[0,0,0]]; _position = getPosATL _objectHelper; //cutText [(localize "str_epoch_player_45"), "PLAIN DOWN"]; _objHDiff = 0; if (isClass (missionConfigFile >> "SnapBuilding" >> _classname)) then { ["","","",["Init",_object,_classname,_objectHelper]] spawn snap_build; }; DZE_updateVec = false; DZE_memDir = getDir _objectHelper; DZE_memForBack = 0; DZE_memLeftRight = 0; if !(_classname in DZE_noRotate) then{ s_player_setVectorsReset = player addaction ["Reset","custom\snap_pro\player_vectorChange.sqf","reset"]; s_player_setVectorsForward = player addaction ["Pitch Forward","custom\snap_pro\player_vectorChange.sqf","forward"]; s_player_setVectorsBack = player addaction ["Pitch Back","custom\snap_pro\player_vectorChange.sqf","back"]; s_player_setVectorsLeft = player addaction ["Bank Left","custom\snap_pro\player_vectorChange.sqf","left"]; s_player_setVectorsRight = player addaction ["Bank Right","custom\snap_pro\player_vectorChange.sqf","right"]; s_player_setVectors1 = player addaction ["Increment by 1 degree","custom\snap_pro\player_vectorChange.sqf","1"]; s_player_setVectors5 = player addaction ["Increment by 5 degrees","custom\snap_pro\player_vectorChange.sqf","5"]; s_player_setVectors45 = player addaction ["Increment by 45 degrees","custom\snap_pro\player_vectorChange.sqf","45"]; s_player_setVectors90 = player addaction ["Increment by 90 degrees","custom\snap_pro\player_vectorChange.sqf","90"]; }; while {_isOk} do { _zheightchanged = false; _zheightdirection = ""; _rotate = false; if (DZE_Q) then { DZE_Q = false; _zheightdirection = "up"; _zheightchanged = true; }; if (DZE_Z) then { DZE_Z = false; _zheightdirection = "down"; _zheightchanged = true; }; if (DZE_Q_alt) then { DZE_Q_alt = false; _zheightdirection = "up_alt"; _zheightchanged = true; }; if (DZE_Z_alt) then { DZE_Z_alt = false; _zheightdirection = "down_alt"; _zheightchanged = true; }; if (DZE_Q_ctrl) then { DZE_Q_ctrl = false; _zheightdirection = "up_ctrl"; _zheightchanged = true; }; if (DZE_Z_ctrl) then { DZE_Z_ctrl = false; _zheightdirection = "down_ctrl"; _zheightchanged = true; }; if (DZE_4) then { _rotate = true; DZE_4 = false; if (helperDetach) then { _dir = -45; DZE_memDir = DZE_memDir - 45; } else { _dir = 180; DZE_memDir = 180; }; }; if (DZE_6) then { _rotate = true; DZE_6 = false; if (helperDetach) then { _dir = 45; DZE_memDir = DZE_memDir + 45; } else { _dir = 0; DZE_memDir = 0; }; }; if(DZE_updateVec) then{ [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; DZE_updateVec = false; }; if (DZE_F and _canDo) then { if (helperDetach) then { _objectHelper attachTo [player]; DZE_memDir = DZE_memDir-(getDir player); helperDetach = false; [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; } else { _objectHelperPos = getPosATL _objectHelper; detach _objectHelper; DZE_memDir = getDir _objectHelper; [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; _objectHelper setPosATL _objectHelperPos; _objectHelper setVelocity [0,0,0]; //fix sliding glitch helperDetach = true; }; DZE_F = false; }; if(_rotate) then { [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; }; if(_zheightchanged) then { if (!helperDetach) then { detach _objectHelper; }; _position = getPosATL _objectHelper; if(_zheightdirection == "up") then { _position set [2,((_position select 2)+0.1)]; _objHDiff = _objHDiff + 0.1; }; if(_zheightdirection == "down") then { _position set [2,((_position select 2)-0.1)]; _objHDiff = _objHDiff - 0.1; }; if(_zheightdirection == "up_alt") then { _position set [2,((_position select 2)+1)]; _objHDiff = _objHDiff + 1; }; if(_zheightdirection == "down_alt") then { _position set [2,((_position select 2)-1)]; _objHDiff = _objHDiff - 1; }; if(_zheightdirection == "up_ctrl") then { _position set [2,((_position select 2)+0.01)]; _objHDiff = _objHDiff + 0.01; }; if(_zheightdirection == "down_ctrl") then { _position set [2,((_position select 2)-0.01)]; _objHDiff = _objHDiff - 0.01; }; _objectHelper setDir (getDir _objectHelper); if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then { _position set [2,0]; }; _objectHelper setPosATL _position; //diag_log format["DEBUG Change BUILDING POS: %1", _position]; if (!helperDetach) then { _objectHelper attachTo [player]; }; [_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYawBuild; }; sleep 0.5; _location2 = getPosATL player; if(DZE_5) exitWith { _isOk = false; detach _object; _dir = getDir _object; _vector = [(vectorDir _object),(vectorUp _object)]; _position = getPosATL _object; //diag_log format["DEBUG BUILDING POS: %1", _position]; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if(_location1 distance _location2 > 10) exitWith { _isOk = false; _cancel = true; _reason = "You've moved to far away from where you started building (within 10 meters)"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if(_IsNearPlot == 0 && !_isPole) then { _findNearestPoles = nearestObjects [_objectHelper, ["Plastic_Pole_EP1_DZ"], 30]; _nearestPole = _findNearestPoles select 0; _objectHelperPos = getPosATL _objectHelper; if (_objectHelperPos distance _nearestPole < 30) exitWith { _isOk = false; _cancel = true; _reason = "You cannot enter plot pole area while building is in progress"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; }; if(_location1 distance _objectHelperPos > 10) exitWith { _isOk = false; _cancel = true; _reason = "Object is placed to far away from where you started building (within 10 meters)"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if(abs(_objHDiff) > 10) exitWith { _isOk = false; _cancel = true; _reason = "Cannot move up || down more than 10 meters"; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if (player getVariable["combattimeout", 0] >= time) exitWith { _isOk = false; _cancel = true; _reason = (localize "str_epoch_player_43"); detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; if (DZE_cancelBuilding) exitWith { _isOk = false; _cancel = true; _reason = "Cancelled building."; detach _object; deleteVehicle _object; detach _objectHelper; deleteVehicle _objectHelper; }; }; if !(_classname in DZE_noRotate) then{ player removeAction s_player_setVectorsReset; player removeAction s_player_setVectorsForward; player removeAction s_player_setVectorsBack; player removeAction s_player_setVectorsLeft; player removeAction s_player_setVectorsRight; player removeAction s_player_setVectors1; player removeAction s_player_setVectors5; player removeAction s_player_setVectors45; player removeAction s_player_setVectors90; }; //No building on roads unless toggled if (!DZE_BuildOnRoads) then { if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; }; }; // No building in trader zones if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; }; if(!_cancel) then { _classname = _classnametmp; // Start Build _tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; _tmpbuilt setdir _dir; // Get position based on object _location = _position; if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then { _location set [2,0]; }; _tmpbuilt setVectorDirAndUp _vector; _tmpbuilt setPosATL _location; cutText [format[(localize "str_epoch_player_138"),_text], "PLAIN DOWN"]; _limit = 3; if (DZE_StaticConstructionCount > 0) then { _limit = DZE_StaticConstructionCount; } else { if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then { _limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount"); }; }; _isOk = true; _proceed = false; _counter = 0; while {_isOk && !_isBuildAdmin} do { [10,10] call dayz_HungerThirst; player playActionNow "Medic"; _dis=20; _sfx = "repair"; [player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_dis,true,(getPosATL player)] spawn player_alertZombies; r_interrupt = false; _animState = animationState player; r_doLoop = true; _started = false; _finished = false; while {r_doLoop} do { _animState = animationState player; _isMedic = ["medic",_animState] call fnc_inString; if (_isMedic) then { _started = true; }; if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then { r_doLoop = false; }; if (DZE_cancelBuilding) exitWith { r_doLoop = false; }; sleep 0.1; }; r_doLoop = false; if(!_finished) exitWith { _isOk = false; _proceed = false; }; if(_finished) then { _counter = _counter + 1; }; cutText [format[(localize "str_epoch_player_139"),_text, _counter,_limit], "PLAIN DOWN"]; if(_counter == _limit) exitWith { _isOk = false; _proceed = true; }; }; if (_isBuildAdmin) then { _isOk = false; _proceed = true; }; if (_proceed) then { //diag_log "Proceed OK"; _tobe_removed_total = 0; _removed_total = 0; _temp_removed_array = []; if (!_isBuildAdmin) then { //diag_log "Is Admin REMOVE NOT OK"; if (_typeIsString) then { _tobe_removed_total = ([player,_item] call BIS_fnc_invRemove); _removed_total = _tobe_removed_total; }; if (!_typeIsString) then { { _removed = 0; _itemIn = _x select 0; _countIn = _x select 1; // //diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn]; _tobe_removed_total = _tobe_removed_total + _countIn; { if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then { _num_removed = ([player,_x] call BIS_fnc_invRemove); _removed = _removed + _num_removed; _removed_total = _removed_total + _num_removed; if(_num_removed == 1) then { _temp_removed_array set [count _temp_removed_array,_x]; }; }; } forEach magazines player; } forEach _needBuildItem; }; } else { //diag_log "Is Admin REMOVE OK"; _tobe_removed_total = 1; _removed_total = 1; }; if((_tobe_removed_total == _removed_total) && (_removed_total >= 1)) then { //diag_log "Removed Item OK"; cutText [format[localize "str_build_01",_text], "PLAIN DOWN"]; if (_isPole) then { [] spawn player_plotPreview; }; _tmpbuilt setVariable ["OEMPos",_location,true]; if(_lockable > 1) then { //diag_log "Is Lockable OK"; _combinationDisplay = ""; switch (_lockable) do { case 2: { // 2 lockbox _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue _combination_2 = floor(random 10); _combination_3 = floor(random 10); _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; dayz_combination = _combination; if (_combination_1 == 100) then { _combination_1_Display = "Red"; }; if (_combination_1 == 101) then { _combination_1_Display = "Green"; }; if (_combination_1 == 102) then { _combination_1_Display = "Blue"; }; _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3]; }; case 3: { // 3 combolock _combination_1 = floor(random 10); _combination_2 = floor(random 10); _combination_3 = floor(random 10); _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; dayz_combination = _combination; _combinationDisplay = _combination; }; case 4: { // 4 safe _combination_1 = floor(random 10); _combination_2 = floor(random 10); _combination_3 = floor(random 10); _combination_4 = floor(random 10); _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4]; dayz_combination = _combination; _combinationDisplay = _combination; }; }; _tmpbuilt setVariable ["CharacterID",_combination,true]; _tmpbuilt setVariable ["ownerPUID",_playerUID,true]; PVDZE_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,_playerUID,_vector],_classname]; //diag_log "Publish Lockable"; publicVariableServer "PVDZE_obj_Publish"; cutText [format[(localize "str_epoch_player_140"),_combinationDisplay,_text], "PLAIN DOWN", 5]; } else { _tmpbuilt setVariable ["CharacterID",dayz_characterID,true]; _tmpbuilt setVariable ["ownerPUID",_playerUID,true]; // fire? if(_tmpbuilt isKindOf "Land_Fire_DZ") then { _tmpbuilt spawn player_fireMonitor; } else { PVDZE_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,_playerUID,_vector],_classname]; publicVariableServer "PVDZE_obj_Publish"; }; }; } else { //diag_log "Remove Item NOT OK"; deleteVehicle _tmpbuilt; cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"]; { [player,_x] call BIS_fnc_invAdd; } forEach _temp_removed_array; }; } else { //diag_log "Proceed NOT OK"; r_interrupt = false; if (vehicle player == player) then { [objNull, player, rSwitchMove,""] call RE; player playActionNow "stop"; }; deleteVehicle _tmpbuilt; cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"]; }; } else { //diag_log "Cancel is TRUE"; deleteVehicle _tmpbuilt; cutText [format[(localize "str_epoch_player_47"),_text,_reason], "PLAIN DOWN"]; }; }; DZE_ActionInProgress = false;
ObjectUID;Instance;Classname;Datestamp;LastUpdated;CharacterID;Worldspace;Inventory;Hitpoints;Fuel;Damage 198104448612142;11;MetalFloor_DZ;2014-08-09 14:18:49;2014-08-09 14:18:49;660;[265.291,[1980.96,4448.6,1.151],"76561198035522330",[[-0.705,-0.058,0.707],[0.705,0.058,0.707]]];[];[];0.00000;0.00000
Vectors now saving to the database with metal floors! yay
-
Ah yeah, doesn't work btw. Seems you cannot call a server side script on the client side. Maybe this could be achieved with a eventhandler that listens to a client set var.
Something like, put that in your server side mission folder.
publicvariable _AdminMissionCMD; _lastCMD = ""; waituntil{!isNil "_AdminMissionCMD"}; if(_AdminMissionCMD != _lastCMD) then { //This is shit but didnt know how to do it better _lastCMD = _AdminMissionCMD; _type = _AdminMissionCMD select 0; switch(_type) do { case "start" : { _mission = _AdminMissionCMD select 1; if(isNil "_mission") then { _mission = wai_missions call BIS_fnc_selectRandom; }; execVM format ["missions\%1.sqf",_mission]; missionrunning = true; _startTime = floor(time); diag_log format["WAI: Starting mission %1",_mission]; }; case "stop" : { clean_running_mission = true; }; default { diag_log format["ADMIN MISSION CMD: NO VALID INPUT %1", _AdminMissionCMD]; }; } };
Then all you need to do is set the _AdminMissionCMD somewhere client side with a array like _AdminMissionCMD = ["start", "bandit_base"] and you should be good to go.
--
Edit: Read into the publiceventhandler a bit more and think it supposed to work like this.
"AdminMissionCMD" addPublicVariableEventHandler { _type = _this select 0; switch(_type) do { case "start" : { _mission = _this select 1; if(isNil "_mission") then { _mission = wai_missions call BIS_fnc_selectRandom; }; execVM format ["missions\%1.sqf",_mission]; missionrunning = true; _startTime = floor(time); diag_log format["WAI: Starting mission %1",_mission]; }; case "stop" : { clean_running_mission = true; }; default { diag_log format["ADMIN MISSION CMD: NO VALID INPUT %1", _this]; }; } };
killzone kid has some pretty good and easy to understand scripting tutorials
http://killzonekid.com/arma-scripting-tutorials-basic-multiplayer-coding/
he covers pveh in that one. not sure if you've already read his guides or not. but it might be helpful for what you're trying to accomplish
-
going back to the ESP with group management
I used diffmerge and compared the regular ESP with the no group ESP ebay posted
I added the appropriate parts to admintools\tools\AdminMode\ESPplayer.sqf
playerESP = _this select 0; setGroupIconsVisible [true, true]; _color_green = [0,1,0,1]; _color_blue = [0,0,1,1]; _color_white = [1, 1, 1, 1]; _color_orange = [1,0.3,0,1]; _color_red = [1,0,0,1]; if (!("ItemGPS" in items player)) then {player addweapon "ItemGPS";}; while {playerESP} do { { _plist = units group _x; _unitCount = count _plist; if (_unitCount == 1) then { if (vehicle _x == _x) then { clearGroupIcons group _x; group _x addGroupIcon ["x_art"]; if ((side _x == side player) && (side player != resistance)) then { group _x setGroupIconParams [_color_red, format ["[%1]-[%2m]",name _x,round(_x distance player)], 0.5, true]; } else { group _x setGroupIconParams [_color_orange, format ["[%1]-[%2m]",name _x,round(_x distance player)], 0.5, true]; }; } else { clearGroupIcons group _x; group _x addGroupIcon ["x_art"]; if ((side _x == side player) && (side player != resistance)) then { _vehname = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _x) >> 'displayName')); _crew = (name (crew (vehicle _x) select 0)); _crew2 = ", "+(name (crew (vehicle _x) select 1)); _crew3 = ", "+(name (crew (vehicle _x) select 2)); _crew4 = ", "+(name (crew (vehicle _x) select 3)); _crew5 = ", "+(name (crew (vehicle _x) select 4)); _crew6 = ", "+(name (crew (vehicle _x) select 5)); _crew7 = ", "+(name (crew (vehicle _x) select 6)); _crew8 = ", "+(name (crew (vehicle _x) select 7)); _crew9 = ", "+(name (crew (vehicle _x) select 8)); _crew10 = ", "+(name (crew (vehicle _x) select 9)); group _x setGroupIconParams [_color_blue, format ["[%2]-[%3%4%5%6%7%8%9%10%11]-[%1m]",round(_x distance player),_vehname,_crew,_crew2,_crew3,_crew4,_crew5,_crew6,_crew7,_crew8,_crew9,_crew10], 0.5, true]; } else { _vehname = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle _x) >> 'displayName')); _crew = (name (crew (vehicle _x) select 0)); _crew2 = ", "+(name (crew (vehicle _x) select 1)); _crew3 = ", "+(name (crew (vehicle _x) select 2)); _crew4 = ", "+(name (crew (vehicle _x) select 3)); _crew5 = ", "+(name (crew (vehicle _x) select 4)); _crew6 = ", "+(name (crew (vehicle _x) select 5)); _crew7 = ", "+(name (crew (vehicle _x) select 6)); _crew8 = ", "+(name (crew (vehicle _x) select 7)); _crew9 = ", "+(name (crew (vehicle _x) select 8)); _crew10 = ", "+(name (crew (vehicle _x) select 9)); group _x setGroupIconParams [_color_red, format ["[%2]-[%3%4%5%6%7%8%9%10%11]-[%1m]",round(_x distance player),_vehname,_crew,_crew2,_crew3,_crew4,_crew5,_crew6,_crew7,_crew8,_crew9,_crew10], 0.5, true]; }; }; } else { _grp = group _x; _leader = leader _grp; _memberNames = []; {_memberNames = _memberNames + [name _x];} count _plist; _memberNames = _memberNames - [name _leader]; _show = format ["%1 Leader of group: %2",(name _leader),_memberNames]; _clr = _color_orange; clearGroupIcons _grp; _grp addGroupIcon ["x_art"]; _grp setGroupIconParams [_clr, _show, 1, true]; }; } forEach playableUnits; sleep 1; }; {clearGroupIcons group _x;} forEach playableUnits;
In any case this doesn't really work as I'd like.
It shows the Marker above the group leaders head, for example Leader of Group: Jedish3ep, Jack, Jill, John
But no markers over any of the other group members. And no distance either.
-
We're having the old issue of the Admin Tools menu not showing up again when logging in forcing us to relog several times. Any ideas on fixing this? The old method worked well but broke TP.
Also do the tools play nicely with Infistar? Since our servers are becoming popular again the amount of hackers has gone way up and we need the extra help stopping them. I'd rather use these admin tools since I've spent ages tweaking then for our admins.
I also had the same issue of the tools not loading forcing us to relog repeatedly in the hopes of it working
So.... rather than leave it up to init.sqf
I removed
[] execVM "admintools\Activate.sqf";
from my init.sqf
and I added this to dayz_spaceInterrupt.sqf
// manually kick in admin mode if it doesnt load if (_dikCode == 0x43) then { [] execVM "admintools\AdminList.sqf"; [] execVM "admintools\Activate.sqf"; };
This way an admin needs to press F9 to enable their tools, be warned that it takes about 10 seconds for the admin menu scroll option to appear. and if you press it multiple times you will get multiple menus appearing.
_____________________________________
Now on to my questions.
I have added ebay's DZGM (dayz group management) script to our server.
and it has practically broken the ESP from these tools, as only the group leader shows up and it can make it rather difficult to police the troublemakers on the server if they are in a group.
In the support thread on opendayz.net there are a few fixes for this, but all seem to be for infistar's esp. and I haven't had any luck adapting them to work with epoch admin tools
I have also asked over there if anyone knows how it could work with epoch admin tools 1.8 but it's been over a week and I still haven't had any reply.
^ is one of the ESP no group linked in the support thread. but I can't make it work! :(
if anyone knows how to do it, please let me know.
-
assuming you are using the default plot for life v2 setup.
in your mission.pbo
init folder, compiles.sqf
ensure that this line is pointing to your custom player_build.sqf
for instance, i'm using snap pro. so my player_build is located in the snap pro folder.
player_build = compile preprocessFileLineNumbers "Custom\snap_pro\player_build.sqf";
OR....
if you are referring to extra right click buildables
edit extra_rc.hpp
class PartGeneric { class menuItem1 { text = "Build Scaffolding"; script = "[""MAP_leseni4x"",[""ItemToolbox"",""ItemEtool""],[[""PartWoodLumber"", 3],[""PartGeneric"", 3]],[0,3,3.87]] execVM ""custom\snap_pro\player_build.sqf"";"; };
ensure that the execVM "" is pointing to the correct player_build.sqf.
hopefully that can help
or you could use this
i can confirm that player_build.sqf works with p4l, snap-pro and extra right click buildables. thats the one i'm using
Help cleaning up some errors in Client.RPT
in General Discussion.
Posted
thank you zupa. i will try that now
*edit* live testing on server - problem resolved. you are a legend :)