I've only tested this on 1.8.0.3 currently and I have updated this with only players being arrested in mind. You need a custom compiles and fn_selfactions. You will also need the files from here:
https://www.dropbox.com/s/n6h3xgg72275mhw/Arrest_V2.rar
Assuming you have a custom compiles and fn_selfaction.sqf start at step 2
Step 1:
Create a custom folder in your mission pbo. You will then need to obtain your compiles and fn_selfaction from your Dayz_Code.pbo. Drag them both into your new custom folder in you mission pbo.
Open up you init.sqf and look for this line:
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
change this line to:
Code:
call compile preprocessFileLineNumbers "custom\compiles.sqf";
Next you will need to open you compiles.sqf in custom\compiles.sqf.
find the line that looks like this:
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf";
and change it to:
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";
This will make the compiles.sqf and fn_selfaction.sqf client sided.
Step 2.
Open up your fn_selfaction and find the code that looks similar to this or has the comment mark that looks like this:
Code:
//Allow player to force save
if((_isVehicle or _isTent or _isStash or _isMediumStash) and _canDo and !_isMan and (damage _cursorTarget < 1)) then {
if (s_player_forceSave < 0) then {
s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_forceSave;
s_player_forceSave = -1;
};
Above the Allow player to force save line we will be adding the arrest script. Above you will need to add this:
Code:
//--------------------------------------ARREST----------------------------------------------------------------
_side = side _cursorTarget == west; //so only Players can be detained
_arrestreq = "PartGeneric" in magazines player; // CHANGE THIS TO THE ITEM YOU WANT PLAYERS TO NEED TO BE ABLE TO ARREST
if (player getVariable "Detain" == 1) then {
player removeAction s_player_arrest;
};
if(_isMan && !_isZombie && _canDo && _isAlive && !_isAnimal && _arrestreq && _side) then {
if (_cursorTarget getVariable "Detain" == 1) exitWith {};
if (s_player_arrest < 0) then {
s_player_arrest = player addaction [("<t color=""#0074E8"">" + ("Detain") +"</t>"), "arrest\Detain.sqf",_cursorTarget,100,false,true,"", ""];
};
} else {
player removeAction s_player_arrest;
s_player_arrest = -1;
};
if ((_cursorTarget getVariable "Detain" == 1) && cursorTarget distance player < 2 ) then
{
if(_isMan && !_isZombie && _canDo && _isAlive) then {
if (s_player_escort < 0) then {
s_player_escort = player addaction [("<t color=""#0074E8"">" + ("Escort") +"</t>"), "arrest\Escort.sqf",_cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_escort;
s_player_escort = -1;
};
if(_isMan && !_isZombie && _canDo && _isAlive) then {
if (s_player_search < 0) then {
s_player_search = player addaction [("<t color=""#0074E8"">" + ("Search") +"</t>"), "arrest\Search.sqf",_cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_search;
s_player_search = -1;
};
if(_isMan && !_isZombie && _canDo && _isAlive) then {
if (s_player_release < 0) then {
s_player_release = player addaction [("<t color=""#0074E8"">" + ("Release") +"</t>"), "arrest\release.sqf",_cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_release;
s_player_release = -1;
};
};
//-------------------------------------------------------------------------------------------------------------
You will need to edit the required item to your liking. The default is scarp metal.
Then near the bottom of fn_selfactions.sqf you will need to add this:
Code:
//Arrest
player removeAction s_player_arrest;
s_player_arrest = -1;
player removeAction s_player_release;
s_player_release = -1;
player removeAction s_player_escort;
s_player_escort = -1;
player removeAction s_player_search;
s_player_search = -1;
right above this:
Code:
//Others
player removeAction s_player_forceSave;
s_player_forceSave = -1;
Step 3.
Open up your init.sqf again and add this at the very bottom of it:
Code:
_nul = [] execVM "detaincheck.sqf";
You will then need to copy the detaincheck.sqf to the main folder of you mission pbo.
You will also need to copy the arrest folder to the main folder of you mission pbo.
Your mission folder then should have:
init.sqf, description.ext, mission.sqm, arrest\detain.sqf, arrest\release.sqf, arrest\search.sqf, arrest\escort.sqf, custom\compiles.sqf, custom\fn_selfaction.sqf, and detaincheck.sqf (+anything else you've added)
Future release will have load in option.
This version fixes bugs with escort, and globalizes detain when re-logging.