DayZ 1.8.0.3 handcuff player help

ok let me explain something here:
I just wanted to help here and not to steal something. I dont get any reward for this nor get i paid after i finished it.
The reason why i disabled the menu is because i think the prisoner should be first detained before he can get escorted.
Next thing i've got this working now and shit like this isnt good for anyone here.
My Version is working fine now! Thanks for the help anyway.

Many thanks to Graver and Inkko.
 
This is a discussion board and the post certainly seemed to me like he wanted constructive feedback. Not trying to steal anyone's thunder just want to lend a hand if I can.


yes, but i dont see anyone here asking him if it was ok to continue his work ... thats what i mean!

I just wanted to help here and not to steal something.


then why did you just take the scripts inikko and graver made changed it and turned it into "your" version?

My Version is working fine now! Thanks for the help anyway.
.


aparently not, or you would be able to always detach ...


im not trying to bash anyone here, i just dont see inkko asking anyone to take over "his" work ... and i dont see anyone asking him if it is ok to continue it!

(you could atleast ask the guy if he was going to finish it)
 
so why Inkko liked my post as i said i've got this working now?! Seems to me he hasnt anything against it that i took the code and edited it a bit.
And like i said i'm working on it because i want to help and not to get anything of it.
Grave, Inkko and I working for the same goal, so there is no reason for me to steal anything here.
If i wanted to steal here something i just would take the code and wouldnt write a word about my edits here.
So do me a favour and keep such thoughts to you.
 
The script originally came from armaholic and I've just been modifying that code to make it work with dayz. I'm fine with anyone tweaking it to their liking, changing it to make it better ect. I'm more interested in getting it all functioning properly.
 
ok i've got everything working now like it should be. If nobody has something against it i will release my version here in this threat tomorrow and everyone can change it to his taste.
 
ok i've got everything working now like it should be. If nobody has something against it i will release my version here in this threat tomorrow and everyone can change it to his taste.

I'm completely fine with that, I'm looking forward to it. There was only so much I could do on my own with the knowledge I have so I was hoping someone else would pick up where I left off and continue.
 
so here is my Version of the Script:

fn_selfaction.sqf:
after
Code:
_isVehicle = _cursorTarget isKindOf "AllVehicles";
add
Code:
_side = side _cursorTarget == west; //so only Players can be detained
_string = "equip_string" in magazines player; //Player need a String in his Inventory to detain someone
before
Code:
//gather
add
Code:
//--------------------------------------ARREST----------------------------------------------------------------
if (player getVariable "Detain" == 1) then {
player removeAction s_player_arrest;
 
};
 
        if(_isMan && !_isZombie && _canDo && _isAlive && !_isAnimal && _string && _side) then {
            if (s_player_arrest < 0) then {
                s_player_arrest = player addaction [("<t color=""#0074E8"">" + ("Detain") +"</t>"), "Scripts\Investigation\Detain.sqf","",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>"), "Scripts\Investigation\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>"), "Scripts\Investigation\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>"), "Scripts\Investigation\release.sqf",_cursorTarget, 1, true, true, "", ""];
                };
        } else {
            player removeAction s_player_release;
            s_player_release = -1;
            };
};
//-------------------------------------------------------------------------------------------------------------
at the bottom after
Code:
//Allow player to gather
player removeAction s_player_gather;
s_player_gather = -1;
add
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;

Detain.sqf:
Code:
_newCiv = cursorTarget;
_dist = player distance _newCiv;
_newCiv setVariable ["Detain",0,true];
player removeMagazine"equip_string";
 
sleep 1;
player playActionNow "Medic";
_newCiv setVariable ["Detain",1,true];
PVDZ_ply_Arrst = _newCiv;
publicVariable "PVDZ_ply_Arrst";
[objNull, _newCiv, rswitchmove ,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;

Escort.sqf:
Code:
_newCiv = cursorTarget;
_dist = player distance _newCiv;
player removeAction s_player_escort;
player removeAction s_player_search;
player removeAction s_player_release;
 
// set cursortarget to variable
_cursorTarget = cursorTarget;
 
_isMan = _cursorTarget isKindOf "Man";
_isAlive = alive _cursorTarget;
 
[objNull, _newCiv, rswitchmove ,"ActsPercMstpSnonWrflDnon_interrogate02_forgoten"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;
player forceWalk True;
[objNull, _newCiv, rforceWalk,true] call RE;
_newCiv attachto [player,[-0.2, 0.7, 0]];
act4 = player addaction ['<t color="#00ff00">' + "Stop Escorting" + '</t>', "Scripts\Investigation\stop_escort.sqf",_cursorTarget, 1, true, true, "", ""];
stop_escort.sqf:
Code:
player removeAction act4;
player forceWalk false;
_newCiv = cursorTarget;
_dist = player distance _newCiv;
_newCiv setVariable ["Detain",0,true];
sleep 1;
detach _newCiv;
_newCiv setVariable ["Detain",1,true];
PVDZ_ply_Arrst = _newCiv;
publicVariable "PVDZ_ply_Arrst";
[objNull, _newCiv, rswitchmove ,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;
release.sqf:
Code:
_newCiv = cursorTarget;
 
player playActionNow "Medic";
sleep 15;
player forceWalk False;
[objNull, _newCiv, rSwitchMove,""] call RE;
_newCiv setVariable ["Detain",0,true];
PVDZ_ply_Arrst = _newCiv;
publicVariable "PVDZ_ply_Arrst";
Search.sqf:
Code:
_newCiv = cursorTarget;
player action ["Gear", _newCiv];
The only Problem that i have is so far now is that the detained player wont be able to detain another player until he relogs. There needs to be a file like:
Code:
_nearby = (position player) nearEntities [["Man"], 10];
if (count _nearby == 0) then {
player setVariable ["Detain",0,true];
PVDZ_ply_Arrst = player;
publicVariable "PVDZ_ply_Arrst";
player switchMove "";
disableUserInput false;
};
So he will be released and is getting the variable to detain again. This will be the last step and my version of the script is done. I have no problems with it if someone could finish this.
Cheers

EDIT: Another Problem is, that if a player is detained and another player joins in after he doesnt see him in this animation. For him the Person is just standing there.
 
I have my half working version workin on epoch lol, I'm just using scrap metal and a tool box for the required
 
Ove got the surrender animation to Work but not the arrest part, any cancer to get an update in the needed changes?

Thanks in advance
 
cant find the //Gather nor the //Allow player to gather part in fn_selfaction.sqf...
on 1.8.0.3 in fn_selfaction its
Code:
//gather
    if(_isPlant and _canDo) then {
        if (s_player_gather < 0) then {
            _text = getText (configFile >> "CfgVehicles" >> typeOf _cursorTarget >> "displayName");
            s_player_gather = player addAction [format[localize "str_actions_gather",_text], "\z\addons\dayz_code\actions\player_gather.sqf",_cursorTarget, 1, true, true, "", ""];
        };
    } else {
        player removeAction s_player_gather;
        s_player_gather = -1;
    };
if its epoch 1.0.4.2 I added mine above the allow force save.
 
Thanks inkko, ive added Gravers version of this, but missing the Imprison.sqf sadly.
What is the main differance between Scwedes/yours and Gravers script?

thanks in advance!

Edit: is my @epoch fn_selfActions.sqf flawed? im running 1.8.0.2 dayz with epoch 1.0.4.2 and theres no such line as //gather or allow force...
 
The differences between SchwEde's and mine is that mine is just simple and has some bugs that need to be fixed. I pretty much just fond the handcuff script and added it into the selfaction and made the animations MP compatible. SchwEde put a lot more time into it and is a more refined version of mine that fixes several bugs and improved off of what I could come up with. He might have added more. From looking at Gravers really fast it looks like my script, but with a command menu instead of my add each individual action.

For epoch, I have my selfactions looking like this:
Code:
    // Allow Owner to lock and unlock vehicle  
    if(_player_lockUnlock_crtl) then {
        if (s_player_lockUnlock_crtl < 0) then {
            _hasKey = _ownerID in _temp_keys;
            _oldOwner = (_ownerID == dayz_playerUID);
            if(locked _cursorTarget) then {
                if(_hasKey or _oldOwner) then {
                    _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _ownerID))], 2, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                    s_player_lockUnlock_crtl = 1;
                } else {
                    if(_hasHotwireKit) then {
                        _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                    } else {
                        _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, true, true, "", ""];
                    };
                    s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                    s_player_lockUnlock_crtl = 1;
                };
            } else {
                if(_hasKey or _oldOwner) then {
                    _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };
         
    } else {
        {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
        s_player_lockUnlock_crtl = -1;
    };
//------------------------------------------------------------------------------------------------------------
    if(_isMan && !_isZombie && _hasArrestItems && _canDo && _isAlive && !(_traderType in serverTraders)) then {
        if (s_player_arrest < 0) then {
            s_player_arrest = player addaction ['<t color="#0074E8">' + "Investigation Menu" + '</t>', "ATPExclusion\Investigate.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_arrest;
        s_player_arrest = -1;
    };
//-------------------------------------------------------------------------------------------------------------
    if(DZE_AllowForceSave) then {
        //Allow player to force save
        if((_isVehicle or _isTent) and !_isMan) 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;
        };
    };
 
ah i see, still you dont use the Imprison.sqf?
I assume the imprisson part is the code that puts the escorted player inside a vehicle still being detained.

so far i have it working with detaining, searching,escorting and releasing, only problem is if you forget to force the player to do a Surrender, which makes him drop primary & secondary weapon on ground, then he will be able to shoot while detained :D
 
Last edited:
ah i see, still you dont use the Imprison.sqf?
I assume the imprisson part is the code that puts the escorted player inside a vehicle still being detained.

so far i have it working with detaining, searching,escorting and releasing, only problem is if you forget to force the player to do a Surrender, which makes him drop primary & secondary weapon on ground, then he will be able to shoot while detained :D
I'm actually gonna start working on this again now that I have some free time from all my other little projects, so hopefully I'll be able to get some work done on it.
 
Back
Top