DayZ 1.8.0.3 handcuff player help

i had to look that up, but from what i find, that looks correct ... if _newCiv is the person who has to do the move ... i belive there was another line saying _newCiv is cursor target or something, then it should work like that
 
I got this mostly working now, couldn't get the commanding menu working, but I got the menus working properly.

Didn't test it with BE tho
I prematurely added some BE filters for setvariable just incase and I'll update the
 
I would assume it would work on epoch as well. Just remember its not 100% functioning yet. The menu is still buggy and I'm not completely sure it's all scripts right. You could make it so anything is needed to arrest and I know epoch doesn't really ban anything so there should be something to use.
 
I've got this working great on epoch. Redid the menu using a CMDmenu and altered your code just a bit here and there. Only thing I'm having trouble with is that you can detain and escort the traders... (already fixed the problem of players being able to escort houses LOL) does anyone know of any way to limit an action to only other players? is that even something you can do?
 
I think this would work:
Code:
if(_isMan && !_isZombie && _hasArrestItems && _canDo && _isAlive &&  !_traderType in serverTraders)

I also noticed that hilarious bug where you could escort buildings xD. I fixed it aswell, but still haven't setup a CMDmenu. What kind of changes did you make if you don't mind sharing?
 
I've got this working great on epoch. Redid the menu using a CMDmenu and altered your code just a bit here and there. Only thing I'm having trouble with is that you can detain and escort the traders... (already fixed the problem of players being able to escort houses LOL) does anyone know of any way to limit an action to only other players? is that even something you can do?

What are you using to tie people up with? Would you be willing to share your progress :)
 
yeah guys! I'm basing it on humanity right now so if player > 9000 humanity they get the option...

okay so first in fn_selfActions right before // CURSOR TARGET ALIVE
Code:
//--------------------------------------ARREST----------------------------------------------------------------
    if ((player getVariable"humanity") >= 9000) then {
        if(_isMan && !_isZombie && _canDo && _isAlive) then {
            if (s_player_arrest < 0) then {
                s_player_arrest = player addaction ['<t color="#0074E8">' + "Investigation Menu" + '</t>', "Scripts\Investigation\investigation.sqf","",100,false,true,"", ""];
                };
        } else {
            player removeAction s_player_arrest;
            s_player_arrest = -1;
            };
    };
//-------------------------------------------------------------------------------------------------------------
and after
Code:
player removeAction s_player_fuelauto2;
    s_player_fuelauto2 = -1;
I put
Code:
    //Arrest
    player removeAction s_player_arrest;
    s_player_arrest = -1;

then for my CMDmenu I did this...
investigation.sqf
Code:
_pathtoscrts = "Scripts\investigation\";
_EXECscrt = 'player execVM "'+_pathtoscrts+'%1"';
Investigation =
[
        ["",true],
        ["Investigation:", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Detain", [2],  "", -5, [["expression", format[_EXECscrt,"Detain.sqf"]]], "1", "1"],
        ["Search", [3],  "", -5, [["expression", format[_EXECscrt,"Search.sqf"]]], "1", "1"],
        ["Escort", [4],  "", -5, [["expression", format[_EXECscrt,"Escort.sqf"]]], "1", "1"],
        ["Imprison", [5],  "", -5, [["expression", format[_EXECscrt,"imprison.sqf"]]], "1", "1"],
        ["Release", [6],  "", -5, [["expression", format[_EXECscrt,"Release.sqf"]]], "1", "1"],
        ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Exit", [-1], "", -3, [["expression", ""]], "1", "1"]
];
showCommandingMenu "#USER:Investigation";

Detain.sqf
Code:
_newCiv = cursorTarget;
_dist = player distance _newCiv;
 
/////////////////////////////////////////////////////////////////////////////////////
if(_dist < 10) then {
_newCiv setVariable ["Detain","1",true];
[objNull, _newCiv, rswitchmove ,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;
sleep (2);
if (_newCiv getVariable "Detain" == 1) then {
sleep 300;
[objNull, _newCiv, rswitchmove,""] call RE;
[objNull, _newCiv, rDisableuserinput,false] call RE;
};};
/////////////////////////////////////////////////////////////////////////////////////
 
exit;

Escort.sqf
Code:
_newCiv = cursorTarget;
_dist = player distance _newCiv;
 
// set cursortarget to variable
_cursorTarget = cursorTarget;
 
_isMan = _cursorTarget isKindOf "Man";
_isAlive = alive _cursorTarget;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
if(_isMan && _isAlive && _dist < 10) then {
[objNull, _newCiv, rswitchmove,"UUnaErc_UnaErcPoslechVelitele"] call RE;
player forceWalk True;
[objNull, _newCiv, rforceWalk,true] call RE;
_newCiv attachTo [player,[0,1,0]];
_newCiv setVariable ["Escort","1",true];
if (_newCiv getVariable "Escort" == 1) then {
sleep 600;
[objNull, _newCiv, rswitchmove,""] call RE;
detach _newCiv;
};};
exit;

release.sqf
Code:
_newCiv = cursorTarget;
 
////////////////////////////////////////////////////////////////////////////////////////
 
player forceWalk False;
detach _newCiv;
[objNull, _newCiv, rSwitchMove,""] call RE;
 
////////////////////////////////////////////////////////////////////////////////////////
exit;


Really you did a great job with what you had the only real problem was your menu =D

Thanks for the idea on how to stop traders from being targeted!

if you want to see it in action you can hop on my server... 64.31.15.98:2352
 
yeah guys! I'm basing it on humanity right now so if player > 9000 humanity they get the option...

okay so first in fn_selfActions right before // CURSOR TARGET ALIVE
Code:
//--------------------------------------ARREST----------------------------------------------------------------
    if ((player getVariable"humanity") >= 9000) then {
        if(_isMan && !_isZombie && _canDo && _isAlive) then {
            if (s_player_arrest < 0) then {
                s_player_arrest = player addaction ['<t color="#0074E8">' + "Investigation Menu" + '</t>', "Scripts\Investigation\investigation.sqf","",100,false,true,"", ""];
                };
        } else {
            player removeAction s_player_arrest;
            s_player_arrest = -1;
            };
    };
//-------------------------------------------------------------------------------------------------------------
and after
Code:
player removeAction s_player_fuelauto2;
    s_player_fuelauto2 = -1;
I put
Code:
    //Arrest
    player removeAction s_player_arrest;
    s_player_arrest = -1;

then for my CMDmenu I did this...
investigation.sqf
Code:
_pathtoscrts = "Scripts\investigation\";
_EXECscrt = 'player execVM "'+_pathtoscrts+'%1"';
Investigation =
[
        ["",true],
        ["Investigation:", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Detain", [2],  "", -5, [["expression", format[_EXECscrt,"Detain.sqf"]]], "1", "1"],
        ["Search", [3],  "", -5, [["expression", format[_EXECscrt,"Search.sqf"]]], "1", "1"],
        ["Escort", [4],  "", -5, [["expression", format[_EXECscrt,"Escort.sqf"]]], "1", "1"],
        ["Imprison", [5],  "", -5, [["expression", format[_EXECscrt,"imprison.sqf"]]], "1", "1"],
        ["Release", [6],  "", -5, [["expression", format[_EXECscrt,"Release.sqf"]]], "1", "1"],
        ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Exit", [-1], "", -3, [["expression", ""]], "1", "1"]
];
showCommandingMenu "#USER:Investigation";

Detain.sqf
Code:
_newCiv = cursorTarget;
_dist = player distance _newCiv;
 
/////////////////////////////////////////////////////////////////////////////////////
if(_dist < 10) then {
_newCiv setVariable ["Detain","1",true];
[objNull, _newCiv, rswitchmove ,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;
sleep (2);
if (_newCiv getVariable "Detain" == 1) then {
sleep 300;
[objNull, _newCiv, rswitchmove,""] call RE;
[objNull, _newCiv, rDisableuserinput,false] call RE;
};};
/////////////////////////////////////////////////////////////////////////////////////
 
exit;

Escort.sqf
Code:
_newCiv = cursorTarget;
_dist = player distance _newCiv;
 
// set cursortarget to variable
_cursorTarget = cursorTarget;
 
_isMan = _cursorTarget isKindOf "Man";
_isAlive = alive _cursorTarget;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
if(_isMan && _isAlive && _dist < 10) then {
[objNull, _newCiv, rswitchmove,"UUnaErc_UnaErcPoslechVelitele"] call RE;
player forceWalk True;
[objNull, _newCiv, rforceWalk,true] call RE;
_newCiv attachTo [player,[0,1,0]];
_newCiv setVariable ["Escort","1",true];
if (_newCiv getVariable "Escort" == 1) then {
sleep 600;
[objNull, _newCiv, rswitchmove,""] call RE;
detach _newCiv;
};};
exit;

release.sqf
Code:
_newCiv = cursorTarget;
 
////////////////////////////////////////////////////////////////////////////////////////
 
player forceWalk False;
detach _newCiv;
[objNull, _newCiv, rSwitchMove,""] call RE;
 
////////////////////////////////////////////////////////////////////////////////////////
exit;


Really you did a great job with what you had the only real problem was your menu =D

Thanks for the idea on how to stop traders from being targeted!

if you want to see it in action you can hop on my server... 64.31.15.98:2352

Lol i knew my menu was majorly flawed lol, just didn't know how to fix it >.< tried my best with removing actions ect. Not sure about some of the stuff I did tho like with the timers. No idea if those work, don't know if the disableuserinput works either. But atleast I got people rolling on getting it more functional after my attempts :)
 
I can confirm that both the disable input works and the timers! need to add it into the escort one too though because people can shoot their guns while you escort lol!
 
I just assumed the disable input wasn't working since when you are detained you are able to reload your weapon. If you bash a direction key you will slowly start moving aswell.
 
You could get the detainee's primary and secondary weapon classnames, remove them, and then replace them afterwards. Only problem with that is since the script is ran from fn_selfActions its clientside, so if they "combat log" they will login without a weapon as the script stops running.
 
I just assumed the disable input wasn't working since when you are detained you are able to reload your weapon. If you bash a direction key you will slowly start moving aswell.

Huh I guess I did not test it that hard haha! I'll look into it. And vampire good idea on that was going to work in something like that to my imprison part of the script.
 
i belive the "exit;" at the end of the scripts are unneeded, since they exit when they end anyway

also release.sqf is flawed!

you need to change _newCiv to a public var and then not refer it to cursorTarget (wich will be uneeded if _newCiv was a public var) in release.sqf or you might end up with two guys who cannot detach

also idk if you are aware of this, but the escort is always ended after 600 seconds.
if you want to get around this you will need to remove some of that code, but i guess its alright, or someone could lock down another player indefinitely (or atleast untill a reboot or combat log)
 
so here is what i've got so far is:
Everything is working like it should except for some things.
1. When a Player detain another, only the player who detained is allwoed to search/escort/release the prisoner
2. Sometimes the detach dont work like it should
3. When the player who detained another is logged out the script stop working, and the prisoner is free but still attach to the position

Here is my Script tested on 1.8.0.3 Vanilla:

fn_selfaction:
before //gather
Code:
//--------------------------------------ARREST----------------------------------------------------------------
        if(_isMan && !_isZombie && _canDo && _isAlive) 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 end after gather-part:
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;
 
 
sleep 0.1;
player playActionNow "Medic";
_newCiv setVariable ["Detain",1,true];
[objNull, _newCiv, rswitchmove ,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;
_pos = player modeltoWorld [0,0.5,-2];
_item = createVehicle ["Can_Small", _pos, [], 0.0, "CAN_COLLIDE"];
_item setPosATL _pos;
_newCiv attachTo [_item,[0,0.5,2]];
if ((_newCiv getVariable "Detain" == 1) && _newCiv distance player > 10) then {
sleep 60;
[objNull, _newCiv, rswitchmove,""] call RE;
[objNull, _newCiv, rDisableuserinput,false] call RE;
_newCiv setVariable ["Detain",0,true];
detach _newCiv;
 
};

Escort.sqf:
Code:
_newCiv = cursorTarget;
_dist = player distance _newCiv;
 
// 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, "", ""];
 
if ((_newCiv getVariable "Detain" == 1) && cursorTarget distance player > 10) then {
sleep 600;
player forceWalk false;
_newCiv setVariable ["Detain",0,true];
[objNull, _newCiv, rswitchmove,""] call RE;
[objNull, _newCiv, rDisableuserinput,false] call RE;
detach _newCiv;
};
stop_escort.sqf:
Code:
player removeAction act4;
player forceWalk false;
_newCiv = cursorTarget;
_dist = player distance _newCiv;
 
[objNull, _newCiv, rswitchmove ,"ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"] call RE;
[objNull, _newCiv, rDisableuserinput,true] call RE;
_pos = player modeltoWorld [0,0.5,-2];
_item = createVehicle ["Can_Small", _pos, [], 0.0, "CAN_COLLIDE"];
_item setPosATL _pos;
_newCiv attachTo [_item,[0,0.5,2]];
if ((_newCiv getVariable "Detain" == 1) && cursorTarget distance player > 10) then {
[objNull, _newCiv, rswitchmove,""] call RE;
[objNull, _newCiv, rDisableuserinput,false] call RE;
_newCiv setVariable ["Detain",0,true];
detach _newCiv;
};
release.sqf:
Code:
_newCiv = cursorTarget;
 
 
player playActionNow "Medic";
sleep 15;
player forceWalk False;
detach _newCiv;
[objNull, _newCiv, rSwitchMove,""] call RE;
_newCiv setVariable ["Detain",0,true];
Search.sqf:
Code:
_newCiv = cursorTarget;
 
player action ["Gear", _newCiv];

I'm attaching the guy because if he isnt attached to something he can still scroll and is also able to detain other people while detained. I dont know if there is a way to disable the scroll-menu but so far this is the only way i found.
Sadly I'm not skilled enough to get a public var to the detained player so everybody can search/escort/release him. I know it has to be similar to the Medic-Stuff like "drag, give Blood/Morph/etc.
I will add later a condition that a player who want detain someone has to have a Gauze in his inventory.

Hope someone can finish this work, i will keep trying and tell you the results here ;)

Cheers
 
So there is a similar way in the Tow and Lift Script:

Code:
                    R3F_ARTY_AND_LOG_PUBVAR_setDir = [_objet, (getDir _objet)-_azimut_canon];
                    if (isServer) then
                    {
                        ["R3F_ARTY_AND_LOG_PUBVAR_setDir", R3F_ARTY_AND_LOG_PUBVAR_setDir] spawn R3F_ARTY_AND_LOG_FNCT_PUBVAR_setDir;
                    }
                    else
                    {
                        publicVariable "R3F_ARTY_AND_LOG_PUBVAR_setDir";
                    };
                };

I will try to get this working on the Detain-Script
 
1. why are you adding the addactions back, when graver made a perfect commanding menu for this, that eliminated the need for multiple addactions?

2. if you read my last post, you would know why you cannot detach and how to fix it ... but aparently you are too busy trying to mess up the scripts.

also inniko startet this project ... how about you guys let him finish his work, before trying to take it over?

i would be fucking furious if i was him!
 
1. why are you adding the addactions back, when graver made a perfect commanding menu for this, that eliminated the need for multiple addactions?

2. if you read my last post, you would know why you cannot detach and how to fix it ... but aparently you are too busy trying to mess up the scripts.

also inniko startet this project ... how about you guys let him finish his work, before trying to take it over?

i would be fucking furious if i was him!


I'll take the compliment on the CMDmenu... thanks!

BUT!

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.
 
Back
Top