Jump to content
!TS JORDAN

[Tutorial] Zipties Revised [Fully Working, With Gag and Blindfolds]

Recommended Posts

Altis Zipties

I have noticed that many people have been trying to use the current zipties on this forum and have had many problems, with my zipties I intend to shorten the install time and make the script work for everyone {excluding AL v3.1.4.8} 

In my zipties script, we have the interaction menu, blindfold, gag, and a separate variable so civilians can NOT unrestrain someone who was restrained by a police officer. 

Let's get started. 

1. Inside the functions.hpp file add: 

class CivTieing {
		file = "core\civilian\CivTieing";
		class gagAction {};					
		class gagged {};
		class removeGagAction {};
		class tieing {};
		class tieingAction {};
		class tieingActionb {};
		class tieingb {};
		class untie {};
		class untieb {};
	};

 

2. Inside the file core > functions > actionKeyHandler find:

if (player getVariable ["isEscorting",false]) exitWith {
    [] call life_fnc_copInteractionMenu;
};

And under add: 

if (playerSide isEqualTo civilian && {player getVariable ["isEscorting",false]} && (!(_curObject getVariable ["restrained",false]))) exitWith {
    [] call life_fnc_copInteractionMenu;
};

 

3. Inside the same file as above find: 

    if ((_curObject getVariable ["restrained",false]) && !dialog && playerSide isEqualTo west) then {
        [_curObject] call life_fnc_copInteractionMenu;
    };

And under it add: 

	if ((!(_curObject getVariable ["restrained",false])) && !dialog && playerSide isEqualTo civilian) then {
        [_curObject] call life_fnc_copInteractionMenu;
    };

 

4. Inside CfgRemoteExec add:

		F(life_fnc_tieing,CLIENT)
		F(life_fnc_tieingb,CLIENT)
		F(life_fnc_gagged,CLIENT)

 

5. Inside config_vItems add this where you items are created, NOTE: You will need to add them to the shops you want them in!

	class zipties {
        variable = "zipties";
        displayName = "STR_Item_ZipTies";
        weight = 0;
        buyPrice = 1200;
        sellPrice = -1;
        illegal = true;
        edible = -1;
        icon = "icons\ziptie.paa";
    };
	
	class blindfold {
        variable = "blindfold";
        displayName = "STR_Item_Blindfold";
        weight = 0;
        buyPrice = 600;
        sellPrice = -1;
        illegal = true;
        edible = -1;
        icon = "icons\blindfold.paa";
    };

 

6. In the file core > actions > escortAction comment out line 13 (The playerSide check)

6.2  In the file core > actions > stopEscort comment out line 14 (The playerSide check)

 

7. In the file core > actions > unRestrain under:

_unit setVariable ["transporting",FALSE,TRUE];

Add:

_unit setVariable["tied", nil, true];
_unit setVariable["gagged",false,true];
_unit setVariable["blindfolded", nil, true];

 

8. Inside the stringtable.xml add:

		<Key ID="STR_Item_ZipTies">
			<Original>ZipTies</Original>
		</Key>
		<Key ID="STR_Item_Blindfold">
			<Original>Blindfold</Original>
		</Key>

 

9. This is the difficult bit, inside the file core > cop > copInteractionMenu from line 46 replace it with:

switch (playerSide) do {
	case west: {
		if (player getVariable ["isEscorting",false]) then {
			{ _x ctrlShow false; } forEach [_Btn1,_Btn2,_Btn3,_Btn5,_Btn6,_Btn7,_Btn8];
		};
			
		//Set Unrestrain Button
		_Btn1 ctrlSetText localize "STR_pInAct_Unrestrain";
		_Btn1 buttonSetAction "[life_pInact_curTarget] call life_fnc_unrestrain; closeDialog 0;";

		//Set Check Licenses Button
		_Btn2 ctrlSetText localize "STR_pInAct_checkLicenses";
		_Btn2 buttonSetAction "[player] remoteExecCall [""life_fnc_licenseCheck"",life_pInact_curTarget]; closeDialog 0;";

		//Set Search Button
		_Btn3 ctrlSetText localize "STR_pInAct_SearchPlayer";
		_Btn3 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_searchAction; closeDialog 0;";

		//Set Escort Button
		if (player getVariable ["isEscorting",false]) then {
			_Btn4 ctrlSetText localize "STR_pInAct_StopEscort";
			_Btn4 buttonSetAction "[] call life_fnc_stopEscorting; closeDialog 0;";
		} else {
			_Btn4 ctrlSetText localize "STR_pInAct_Escort";
			_Btn4 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
		};

		//Set Ticket Button
		_Btn5 ctrlSetText localize "STR_pInAct_TicketBtn";
		_Btn5 buttonSetAction "[life_pInact_curTarget] call life_fnc_ticketAction;";

		_Btn6 ctrlSetText localize "STR_pInAct_Arrest";
		_Btn6 buttonSetAction "[life_pInact_curTarget] call life_fnc_arrestAction; closeDialog 0;";
		_Btn6 ctrlEnable false;

		_Btn7 ctrlSetText localize "STR_pInAct_PutInCar";
		_Btn7 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar; closeDialog 0;";

		//SeizeWeapons Button
		_Btn8 ctrlSetText localize "STR_pInAct_Seize";
		_Btn8 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_seizePlayerAction; closeDialog 0;";

		if (FETCH_CONST(life_coplevel) < _seizeRank) then {_Btn8 ctrlEnable false;};

		{
			if ((player distance (getMarkerPos _x) <30)) exitWith { _Btn6 ctrlEnable true;};
		} forEach LIFE_SETTINGS(getArray,"sendtoJail_locations");
	};
	
	case civilian: {
		if (player getVariable ["isEscorting",false]) then {
			{ _x ctrlShow false; } forEach [_Btn1,_Btn2,_Btn4,_Btn5,_Btn6];
		};
		
		if (player getVariable ["isEscorting",false]) then {
			_Btn3 ctrlSetText localize "STR_pInAct_StopEscort";
			_Btn3 buttonSetAction "[] call life_fnc_stopEscorting; closeDialog 0;";
		} else {
			_Btn3 ctrlSetText localize "STR_pInAct_Escort";
			_Btn3 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
		};

		_Btn4 ctrlSetText localize "STR_pInAct_PutInCar";
		_Btn4 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar;";

		//SeizeWeapons Button
		_Btn5 ctrlSetText localize "STR_pInAct_Seize";
		_Btn5 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_seizePlayerAction; closeDialog 0;";

		if ((_curTarget getVariable ["blindfolded", false])) then {
			_Btn2 ctrlSetText "Remove blindfold";
			_Btn2 buttonSetAction "[] call life_fnc_untieb; closeDialog 0;";
		} else {
			_Btn2 ctrlSetText "Blindfold Person";
			_Btn2 buttonSetAction "[] call life_fnc_tieingActionb; closeDialog 0;";
		};
		
		if ((_curTarget getVariable ["gagged", false])) then {
			_Btn6 ctrlSetText "Remove Gag";
			_Btn6 buttonSetAction "[] call life_fnc_removeGagAction; closeDialog 0;";
		} else {
			_Btn6 ctrlSetText "Gag Person";
			_Btn6 buttonSetAction "[] call life_fnc_gagAction; closeDialog 0;";
		};

		if (!(_curTarget getVariable ["tied", false])) then {
			_Btn1 ctrlSetText "Ziptie Person";
			_Btn1 buttonSetAction "[] call life_fnc_tieingAction; closeDialog 0;";
			_Btn2 ctrlEnable false;
			_Btn3 ctrlEnable false;
			_Btn4 ctrlEnable false;
			_Btn5 ctrlEnable false;
			_Btn6 ctrlEnable false;
		} else {
			_Btn1 ctrlSetText "Remove Zipties";
			_Btn1 buttonSetAction "[] call life_fnc_untie; closeDialog 0;";
		};
		
		if (player getVariable ["isEscorting",false]) then {
			{ _x ctrlShow false; } forEach [_Btn1,_Btn2,_Btn4,_Btn5,_Btn6];
			_Btn3 ctrlEnable true;			
		};

		_Btn7 ctrlShow false;
		_Btn8 ctrlShow false;
	};
};

 

If you had any custom buttons inside that file make sure to re-implement them!

The final step it to download the Zip below and insert them into their respective places. 

Kind thanks to @lowheartrate @Panda For providing the Gag scripts. 

If you have any questions please TAG me in them DO NOT quote the whole tutorial. 

CivRestraining.zip

Edited by !TS JORDAN
Added Step 6.2
  • Like 3

Share this post


Link to post
Share on other sites

@!TS JORDAN

 

Hi  , on the first thank's for your script , but i don't understant what you want to say??

 

10 hours ago, !TS JORDAN said:

6. In the file core > actions > escortAction comment out line 13 (The playerSide check)

I'm on 4.5 and this is my line 13 : 

if (!(side _unit in [civilian,independent])) exitWith {};

 

Thank's for your help

Edited by SAF68

Share this post


Link to post
Share on other sites
10 minutes ago, SAF68 said:

@!TS JORDAN

 

Hi  , on the first thank's for your script , but i don't understant what you want to say??

 

I'm on 4.5 and this is my line 13 : 

if (!(side _unit in [civilian,independent])) exitWith {};

 

Thank's for your help

I believe you delete it, he says to comment out the player side check, what you posted was the player side check

Share this post


Link to post
Share on other sites
15 minutes ago, Deadlesszombie said:

I believe you delete it, he says to comment out the player side check, what you posted was the player side check

Where do I add the files in the Zip into my mission file, I'm confused about that..

Share this post


Link to post
Share on other sites
Just now, STG_SilentF0x said:
core\civilian\CivTieing

There! 

do I just put the folder in or the drag all the files from the folder into that folder?

Share this post


Link to post
Share on other sites

There is a problem, the vehicle interaction menu does not work.. you cant pullout the palyer, or even repair vehicles after the script is in?? any help?

Edited by Jason_000
Huge quote

Share this post


Link to post
Share on other sites

Hi all

I tried the script ....all it's ok but we have 2 little issue!

-We can use zipties on cop , but we can't stop the escort

-we can't pullout the player of the vehicle

 

Anyway all it's ok and repair kit run fine

Share this post


Link to post
Share on other sites
16 minutes ago, Hyper4u said:

@!TS JORDAN

Anyway to add the restrain animations for cops? and add gag kit to gag people

There is, as long as you know how to write the script for it. Or add the animation after the action "restrain" in the fn_keyHandler.sqf, idk just a though.

Share this post


Link to post
Share on other sites

I restored everything back to normal because the script didn't work for me and my cops always have the player interaction menu wherever they go and aiming at vehicles they do not have a vehivle interaction menu, I'm on altis life 4.5 and if anyone could help me with my problem asap I really need it for my server to stay active with people.

  • Like 1

Share this post


Link to post
Share on other sites
18 hours ago, DCactivity said:

@!TS JORDAN

nice script! but cops can't seem to unrestrain anyone, any help?

 

can you post serverside and client side rpt logs from when you tried it :D

 

18 hours ago, Skalica said:

I have 2 issues which are that cops cannot restrain anyone, and anyone cannot repair vehicles. So any help would be highly appreciated.

can you post serverside and client side rpt  logs from when you tried it :D

On 24/01/2017 at 3:48 PM, OneShot said:

I did everything as you said, except that the civilian manages to handcuff and the cop

What do you mean, in this script civilians are supposed to restrain the cops you can change that it you wish :P

Share this post


Link to post
Share on other sites
14 hours ago, Benro said:

I restored everything back to normal because the script didn't work for me and my cops always have the player interaction menu wherever they go and aiming at vehicles they do not have a vehivle interaction menu, I'm on altis life 4.5 and if anyone could help me with my problem asap I really need it for my server to stay active with people.

 

Can you post your actionKeyHandler file bro :P

 

Share this post


Link to post
Share on other sites
6 hours ago, !TS JORDAN said:

Can you post your actionKeyHandler file bro :P

 

#include "..\..\script_macros.hpp"
/*
    File: fn_actionKeyHandler.sqf
    Author: Bryan "Tonic" Boardwine
    Description:
    Master action key handler, handles requests for picking up various items and
    interacting with other players (Cops = Cop Menu for unrestrain,escort,stop escort, arrest (if near cop hq), etc).
*/
private ["_curObject","_isWater","_CrateModelNames","_crate","_fish","_animal","_whatIsIt","_handle"];
_curObject = cursorObject;
if (life_action_inUse) exitWith {}; //Action is in use, exit to prevent spamming.
if (life_interrupted) exitWith {life_interrupted = false;};
_isWater = surfaceIsWater (visiblePositionASL player);
if (player getVariable ["isEscorting",false]) exitWith {
    [] call life_fnc_copInteractionMenu;
};
if ((!(_curObject getVariable ["restrained",false])) && !dialog && playerSide isEqualTo west) then {
        [_curObject] call life_fnc_copInteractionMenu;
    };
if (LIFE_SETTINGS(getNumber,"global_ATM") isEqualTo 1) then{
    //Check if the player is near an ATM.
    if ((call life_fnc_nearATM) && {!dialog}) exitWith {
        [] call life_fnc_atmMenu;
    };
};
if (isNull _curObject) exitWith {
    if (_isWater) then {
        _fish = (nearestObjects[player,(LIFE_SETTINGS(getArray,"animaltypes_fish")),3]) select 0;
        if (!isNil "_fish") then {
            if (!alive _fish) then {
                [_fish] call life_fnc_catchFish;
            };
        };
    } else {
        _animal = (nearestObjects[player,(LIFE_SETTINGS(getArray,"animaltypes_hunting")),3]) select 0;
        if (!isNil "_animal") then {
            if (!alive _animal) then {
                [_animal] call life_fnc_gutAnimal;
            };
        } else {
            private "_handle";
            if (playerSide isEqualTo civilian && !life_action_gathering) then {
          _whatIsIt = [] call life_fnc_whereAmI;
                if (life_action_gathering) exitWith {};                 //Action is in use, exit to prevent spamming.
                switch (_whatIsIt) do {
                    case "mine" : { _handle = [] spawn life_fnc_mine };
                    default { _handle = [] spawn life_fnc_gather };
                };
                life_action_gathering = true;
                waitUntil {scriptDone _handle};
                life_action_gathering = false;
            };
        };
    };
};
if ((_curObject isKindOf "B_supplyCrate_F" || _curObject isKindOf "Box_IND_Grenades_F") && {player distance _curObject < 3} ) exitWith {
    if (alive _curObject) then {
        [_curObject] call life_fnc_containerMenu;
    };
};
private _vaultHouse = ALTIS_TANOA("Land_Research_house_V1_F","Land_Medevac_house_V1_F");
_altisArray = [16019.5,16952.9,0];
_tanoaArray = [11074.2,11501.5,0.00137329];
private _pos = ALTIS_TANOA(_altisArray,_tanoaArray);
if (_curObject isKindOf "House_F" && {player distance _curObject < 12} || ((nearestObject [_pos,"Land_Dome_Big_F"]) isEqualTo _curObject || (nearestObject [_pos,_vaultHouse]) isEqualTo _curObject)) exitWith {
    [_curObject] call life_fnc_houseMenu;
};
if (dialog) exitWith {}; //Don't bother when a dialog is open.
if (vehicle player != player) exitWith {}; //He's in a vehicle, cancel!
life_action_inUse = true;
//Temp fail safe.
[] spawn {
    sleep 60;
    life_action_inUse = false;
};
//Check if it's a dead body.
if (_curObject isKindOf "Man" && !(_curObject isKindOf "Animal") && {!alive _curObject} && !(_curObject getVariable ["Revive",false]) && {playerSide in [west,independent]}) exitWith {
    //Hotfix code by ins0
    if (((playerSide isEqualTo west && {(LIFE_SETTINGS(getNumber,"revive_cops") isEqualTo 1)}) || playerSide isEqualTo independent)) then {
        if (life_inv_defibrillator > 0) then {
            [_curObject] call life_fnc_revivePlayer;
        };
    };
};
//If target is a player then check if we can use the cop menu.
if (isPlayer _curObject && _curObject isKindOf "Man") then {
    if ((_curObject getVariable ["restrained",false]) && !dialog && playerSide isEqualTo west) then {
        [_curObject] call life_fnc_copInteractionMenu;
    };
} else {
    //OK, it wasn't a player so what is it?
    private ["_isVehicle","_miscItems","_money","_list"];
    _list = ["landVehicle","Ship","Air"];
    _isVehicle = if (KINDOF_ARRAY(_curObject,_list)) then {true} else {false};
    _miscItems = ["Land_BottlePlastic_V1_F","Land_TacticalBacon_F","Land_Can_V3_F","Land_CanisterFuel_F","Land_Suitcase_F"];
    //It's a vehicle! open the vehicle interaction key!
    if (_isVehicle) then {
        if (!dialog) then {
            if (player distance _curObject < ((boundingBox _curObject select 1) select 0)+2 && (!(player getVariable ["restrained",false])) && (!(player getVariable ["playerSurrender",false])) && !life_isknocked && !life_istazed) then {
                [_curObject] call life_fnc_vInteractionMenu;
            };
        };
    } else {
        //OK, it wasn't a vehicle so let's see what else it could be?
        if ((typeOf _curObject) in _miscItems) then {
            [_curObject,player,false] remoteExecCall ["TON_fnc_pickupAction",RSERV];
        } else {
            //It wasn't a misc item so is it money?
            if ((typeOf _curObject) isEqualTo "Land_Money_F" && {!(_curObject getVariable ["inUse",false])}) then {
                [_curObject,player,true] remoteExecCall ["TON_fnc_pickupAction",RSERV];
            };
        };
    };
};

Share this post


Link to post
Share on other sites
2 minutes ago, Benro said:
#include "..\..\script_macros.hpp"
/*
    File: fn_actionKeyHandler.sqf
    Author: Bryan "Tonic" Boardwine
    Description:
    Master action key handler, handles requests for picking up various items and
    interacting with other players (Cops = Cop Menu for unrestrain,escort,stop escort, arrest (if near cop hq), etc).
*/
private ["_curObject","_isWater","_CrateModelNames","_crate","_fish","_animal","_whatIsIt","_handle"];
_curObject = cursorObject;
if (life_action_inUse) exitWith {}; //Action is in use, exit to prevent spamming.
if (life_interrupted) exitWith {life_interrupted = false;};
_isWater = surfaceIsWater (visiblePositionASL player);
if (player getVariable ["isEscorting",false]) exitWith {
    [] call life_fnc_copInteractionMenu;
};
if ((!(_curObject getVariable ["restrained",false])) && !dialog && playerSide isEqualTo west) then {
        [_curObject] call life_fnc_copInteractionMenu;
    };
if (LIFE_SETTINGS(getNumber,"global_ATM") isEqualTo 1) then{
    //Check if the player is near an ATM.
    if ((call life_fnc_nearATM) && {!dialog}) exitWith {
        [] call life_fnc_atmMenu;
    };
};
if (isNull _curObject) exitWith {
    if (_isWater) then {
        _fish = (nearestObjects[player,(LIFE_SETTINGS(getArray,"animaltypes_fish")),3]) select 0;
        if (!isNil "_fish") then {
            if (!alive _fish) then {
                [_fish] call life_fnc_catchFish;
            };
        };
    } else {
        _animal = (nearestObjects[player,(LIFE_SETTINGS(getArray,"animaltypes_hunting")),3]) select 0;
        if (!isNil "_animal") then {
            if (!alive _animal) then {
                [_animal] call life_fnc_gutAnimal;
            };
        } else {
            private "_handle";
            if (playerSide isEqualTo civilian && !life_action_gathering) then {
          _whatIsIt = [] call life_fnc_whereAmI;
                if (life_action_gathering) exitWith {};                 //Action is in use, exit to prevent spamming.
                switch (_whatIsIt) do {
                    case "mine" : { _handle = [] spawn life_fnc_mine };
                    default { _handle = [] spawn life_fnc_gather };
                };
                life_action_gathering = true;
                waitUntil {scriptDone _handle};
                life_action_gathering = false;
            };
        };
    };
};
if ((_curObject isKindOf "B_supplyCrate_F" || _curObject isKindOf "Box_IND_Grenades_F") && {player distance _curObject < 3} ) exitWith {
    if (alive _curObject) then {
        [_curObject] call life_fnc_containerMenu;
    };
};
private _vaultHouse = ALTIS_TANOA("Land_Research_house_V1_F","Land_Medevac_house_V1_F");
_altisArray = [16019.5,16952.9,0];
_tanoaArray = [11074.2,11501.5,0.00137329];
private _pos = ALTIS_TANOA(_altisArray,_tanoaArray);
if (_curObject isKindOf "House_F" && {player distance _curObject < 12} || ((nearestObject [_pos,"Land_Dome_Big_F"]) isEqualTo _curObject || (nearestObject [_pos,_vaultHouse]) isEqualTo _curObject)) exitWith {
    [_curObject] call life_fnc_houseMenu;
};
if (dialog) exitWith {}; //Don't bother when a dialog is open.
if (vehicle player != player) exitWith {}; //He's in a vehicle, cancel!
life_action_inUse = true;
//Temp fail safe.
[] spawn {
    sleep 60;
    life_action_inUse = false;
};
//Check if it's a dead body.
if (_curObject isKindOf "Man" && !(_curObject isKindOf "Animal") && {!alive _curObject} && !(_curObject getVariable ["Revive",false]) && {playerSide in [west,independent]}) exitWith {
    //Hotfix code by ins0
    if (((playerSide isEqualTo west && {(LIFE_SETTINGS(getNumber,"revive_cops") isEqualTo 1)}) || playerSide isEqualTo independent)) then {
        if (life_inv_defibrillator > 0) then {
            [_curObject] call life_fnc_revivePlayer;
        };
    };
};
//If target is a player then check if we can use the cop menu.
if (isPlayer _curObject && _curObject isKindOf "Man") then {
    if ((_curObject getVariable ["restrained",false]) && !dialog && playerSide isEqualTo west) then {
        [_curObject] call life_fnc_copInteractionMenu;
    };
} else {
    //OK, it wasn't a player so what is it?
    private ["_isVehicle","_miscItems","_money","_list"];
    _list = ["landVehicle","Ship","Air"];
    _isVehicle = if (KINDOF_ARRAY(_curObject,_list)) then {true} else {false};
    _miscItems = ["Land_BottlePlastic_V1_F","Land_TacticalBacon_F","Land_Can_V3_F","Land_CanisterFuel_F","Land_Suitcase_F"];
    //It's a vehicle! open the vehicle interaction key!
    if (_isVehicle) then {
        if (!dialog) then {
            if (player distance _curObject < ((boundingBox _curObject select 1) select 0)+2 && (!(player getVariable ["restrained",false])) && (!(player getVariable ["playerSurrender",false])) && !life_isknocked && !life_istazed) then {
                [_curObject] call life_fnc_vInteractionMenu;
            };
        };
    } else {
        //OK, it wasn't a vehicle so let's see what else it could be?
        if ((typeOf _curObject) in _miscItems) then {
            [_curObject,player,false] remoteExecCall ["TON_fnc_pickupAction",RSERV];
        } else {
            //It wasn't a misc item so is it money?
            if ((typeOf _curObject) isEqualTo "Land_Money_F" && {!(_curObject getVariable ["inUse",false])}) then {
                [_curObject,player,true] remoteExecCall ["TON_fnc_pickupAction",RSERV];
            };
        };
    };
};

if ((!(_curObject getVariable ["restrained",false])) && !dialog && playerSide isEqualTo west) then {
        [_curObject] call life_fnc_copInteractionMenu;

 

I KNOW ITS SOME WHERE PART OF  THE LIKE EITHER ["restrained",false])) has to be ["restrained",true]))  or  && playerSide isEqualTo west changes to && playerSide isEqualTo Civ/civilian but I don't know what it should be

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...