DayZ 1.8.0.3 handcuff player help

Inkko

Valued Member!
Okay some of the players in my community gave me this idea, so I thought about it for a while and I think it would be do able. I found cable ties in the magazine cfg, they aren't complete yet but It would be something to use that would be realistic.

My idea was using fn_selfAction make something like if player has cable ties in inventory and is X distance from another player then it would add an action to "handcuff" someone.

When the script is executed it would play all the animations and the other player would be stuck in the arrested animation unable to move for X seconds or until released.

I'm just not sure on how I would go about doing this. I want a time limit on the handcuffs so people don't run around leaving people stuck.
 

Vampire

OpenDayZ Rockstar!
Rough logic throw together

If target is player < 3m and hasitem ziptie then {
addaction to ziptie handcuff player
} else {
remove the action
};

and then handcuffplayer.sqf or whatever

player removeinput true;
playMove surrender;
sleep 10mins;
switchmove "";
player removeinput false;

Rough code but totally doable. I would code it but I run epoch.
 

Inkko

Valued Member!
I'll try out that armaholic script. I know how to setup the selfaction part but when it comes to coding other players to do stuff on an action I use I'm completely lost >.<
 

Inkko

Valued Member!
This looks right to me for the fn_selfaction menu, i think atleast lol
Code:
//arrest
_mags = magazines player;
//arrest init check
if (("equip_cable_tie" in _mags)) then {
        hasArrestItem = true;
    } else { hasArrestItem = false;};
    if((_cursorTarget isKindOf _isMan && player distance _cursorTarget < 2) && hasArrestItem && _canDo) then {
        if (s_player_arrest < 0) then {
            s_player_arrest = player addaction ['<t color="#003300">' + "Investigation Menu" + '</t>', "Scripts\Investigate.sqf","",5,false,true,"", ""];
};
    } else {
        player removeAction s_player_arrest;
        s_player_arrest = -1;
};
 

Vampire

OpenDayZ Rockstar!
Code:
//arrest
_mags = magazines player;
//arrest init check
if ("equip_cable_tie" in _mags) then {
    hasArrestItem = true;
} else {
    hasArrestItem = false;
};
if(cursorTarget isKindOf "Man" && !(cursorTarget isKindOf "zZombie_base") && player distance cursorTarget < 2 && hasArrestItem && _canDo) then {
    if (s_player_arrest < 0) then {
        s_player_arrest = player addaction ['<t color="#003300">' + "Investigation Menu" + '</t>', "Scripts\Investigate.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_arrest;
    s_player_arrest = -1;
};
If you are running epoch you may also want to check that the target isn't a player zombie.
Code:
!(cursorTarget isKindOf "PZombie_VB")
 

Inkko

Valued Member!
Some random person joined my test server so I tested it out on him. Seems to be working along with the script SchwEde linked. The menu is a little buggy since i haven't modified it all yet but I was able to detain someone ect just how I wanted. Gotta figure out a timer now and figure out how to fix the menu.
 

Halvhjearne

Valued Member!
was looking at this too, it does sounds kinda interesting but its done in a wierd way and imo its never good to do too many addaction like that

i think i would rather do a commanding menu for the options and only the one addaction in fn_selfactions ...
i did not test this tho i just looked at the scripts, but it seems theres no way to release someone again after being detained either?

(is it even actually "arresting" someone?)

also i think 50m distance from the taget might be a bit overkill on dayz
(unless you are actually running a police force to use this on your server like on island life or something)

im not exactly sure where the extraction is taking the prisoner either, but im sure yo can get some fun out of this somehow
(i would love to see this more developed)
 

Inkko

Valued Member!
I modified the script so its a 2m max distance, the menus get really bugged out currently while I was testing it. Had several duplicate menus. When you have the item on you and you're next to a player looking at them, you get the Investigation Menu, which once clicked shows detain, escort ect. When you detain someone you shout something and in side chat say something (pretty much all the menu options shout and say something in side chat). The player is then forced to sit ( the player I did this with said he was not sitting and could still run around and fire his weapon, he shot me while detained. On my screen he was sitting with his hands behind his back). Escorting seemed to work fine. Those are the only 2 I used from this. The escorting is similar to dragging someone while they're unconscious except they are standing. I'm gonna be working on this more to try and get it working a lot better. Most likely will make it server side since mission doesn't seem to be working to great. Hopefully I will be able to do all this, not the best at coding but I'll give it a shot.
 

Halvhjearne

Valued Member!
i did not notice any call RE in the scripts, wich is most likely why they are only spawning for the player calling it ... regarding the multiple addactions, as i mentioned do a commanding menu instead, it would work much better than the script adding and removing actions like that

i belive this is either very old scripts or ment for singleplayer, thats mostlikely why its only for the player calling it, but i dont think it would be too hard to change that tho
 

Inkko

Valued Member!
Ya i noticed that as well, not really familiar with how the call re works. I left the arrest script pretty much as is, i just took out certain add actions since i didn't want them. Kept detain and escort, gonna have to go through that and add a remove weapons thats saved until released, disableuserinput, add a timer, add a realease, ect then look into the call re to get it all working on both sides along with fixing the menus lol >.<

But I'm just glad I have a semi working script so far to work with.
 

Halvhjearne

Valued Member!
change it to a commanding menu like this:
Code:
_pathtoscrts = "scripts\";
_EXECscrt = 'player execVM "'+_pathtoscrts+'%1"';
Test =
[
    ["",true],
        ["Choose Test:", [-1], "", -5, [["expression", ""]], "1", "0"],
            ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Test1", [2],  "", -5, [["expression", format[_EXECscrt,"Test1.sqf"]]], "1", "1"],
        ["Test2", [3],  "", -5, [["expression", format[_EXECscrt,"Test2.sqf"]]], "1", "1"],
        ["Test3", [4],  "", -5, [["expression", format[_EXECscrt,"Test3.sqf"]]], "1", "1"],
        ["Test4", [5],  "", -5, [["expression", format[_EXECscrt,"Test4.sqf"]]], "1", "1"],
        ["Test5", [6],  "", -5, [["expression", format[_EXECscrt,"Test5.sqf"]]], "1", "1"],
            ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Exit", [-1], "", -3, [["expression", ""]], "1", "1"]
];
showCommandingMenu "#USER:Test";
 

Inkko

Valued Member!
I was planning on setting the menu up similar to that, I just have no idea how to make the script MP compatible after staring at it for hours :c
 

Inkko

Valued Member!
Haven't tested this yet but would this be correct?
Code:
[objNull, _newCiv, rSwitchMove,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
 
Top