Jump to content

[Making Tie Up] with a lil help of my friends.


juandayz

Recommended Posts

1 hour ago, oldmatechoc said:

its only showing after being released :/ @juandayz

private["_body","_positionp","_stick","_waitTime","_hastools","_inventory","_break_free","_waitcut"];
_body = _this select 0;
_waitTime = 60;
_waitcut =10;
_inventory = items player;
_hastools = "ItemKnife" in _inventory;

diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
if (_body == player) then {
    diag_log("tied up!");
	_positionp = [player] call FNC_GetPos;
	_stick = createVehicle ["Plastic_Pole_EP1",_positionp, [], 0, "CAN_COLLIDE"];
    _body attachTo [_stick, [0, 0, 0]];
	player setVariable ["dayz_tieup",true];

if (_hastools) then {
	if (s_player_cut < 0) then {
		s_player_cut = player addaction [("<t color=""#C0A172"">" + ("cutoff") +"</t>"),"dayz_code\actions\player_breakfree.sqf","",5,false,true,"",""]; };	
				

		} else {
		player removeAction s_player_cut;
		s_player_cut = -1;
//	disableuserinput true;	disableuserinput true;	disableuserinput true;
//	player playMove "AmelPercMstpSnonWnonDnon_zasah6hlava";
	[player,10,true,(getPosATL player)] spawn player_alertZombies;
    cutText ["You've been tied up! You will be released in 1min!", "PLAIN DOWN"];
	sleep _waitTime;				
	deleteVehicle _stick; 	
	cutText ["Releasing you now!", "PLAIN DOWN"];
//	disableuserinput false;disableuserinput false;disableuserinput false;
	player setVariable ["dayz_tieup",false];
//	call dayz_resetSelfActions;
		};

}; 

 

Link to comment
Share on other sites

@oldmatechoc @Cherdenko  or another variant, to execute automatically a user menu if the player have the knife to cut the rope

Spoiler

private["_msg","_camDistance","_camera","_body","_positionp","_stick","_waitTime","_hastools","_inventory","_break_free","_waitcut"];
_body = _this select 0;
_waitTime = 60;
_inventory = items player;
_hastools = "ItemKnife" in _inventory;

diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
if (_body == player) then {
    diag_log("tied up!");
	_positionp = [player] call FNC_GetPos;
	_stick = createVehicle ["Plastic_Pole_EP1",_positionp, [], 0, "CAN_COLLIDE"];
    _body attachTo [_stick, [0, 0, 0]];
	player setVariable ["dayz_tieup",true];
[player,10,true,(getPosATL player)] spawn player_alertZombies;

///CAMERA EFFECT
_msg = format["You've been tied up! %1,",format["%1", name player]];
_camDistance = 60;
   showCinemaBorder true;
   camUseNVG false;			   
   _camera = "camera" camCreate [(position player select 0)-2, position player select 1,(position player select 2)+_camDistance];
   _camera cameraEffect ["internal","back"];
   
   _camera camSetFOV 2.000;
   _camera camCommit 0;
   waitUntil {camCommitted _camera};
  // playsound "";//add sound
 
   _camera camSetTarget vehicle player;
   _camera camSetRelPos [0,0,2];
   _camera camCommit 12;
 
   cutText [_msg, "PLAIN DOWN"];

   waitUntil {camCommitted _camera};
 
  _camera cameraEffect ["terminate","back"];
  camDestroy _camera;





if (_hastools) then {

ropecut = 
[
	["Confirmation",true],
	["Wanna Cut?", [-1], "", -5, [["expression", ""]], "1", "0"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["No", [2], "", -5, 	[["expression", "cut_answer=false;"]], "1", "1"],
	["Yes", [3], "", -5, 	[["expression", "cut_answer=true;"]], "1", "1"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["Exit", [-1], "", -3, 	[["expression", "cut_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:ropecut";

waitUntil {((!isNil 'cut_answer')||(commandingMenu == ""))};

if (isNil 'cut_answer') then {cut_answer=false;};

if (cut_answer) then {
deleteVehicle _stick; 	
	cutText ["Releasing you now!", "PLAIN DOWN"];
//	disableuserinput false;disableuserinput false;disableuserinput false;
	player setVariable ["dayz_tieup",false];
//	call dayz_resetSelfActions;		
};


		} else {

		
		
		
//	disableuserinput true;	disableuserinput true;	disableuserinput true;
//	player playMove "AmelPercMstpSnonWnonDnon_zasah6hlava";

	sleep _waitTime;				
	deleteVehicle _stick; 	
	cutText ["Releasing you now!", "PLAIN DOWN"];
//	disableuserinput false;disableuserinput false;disableuserinput false;
	player setVariable ["dayz_tieup",false];
//	call dayz_resetSelfActions;
		};

}; 

 

 

Link to comment
Share on other sites

1 hour ago, Hooty said:

If we use this animation awoppercmstpsoptwbindnon_awoppknlmstpsoptwbindnon_lnr  it should auto disable input if you have the rpg crash fix in. Also the player should stand still as well. Not sure I dont have a helper tonight on my end :(

Ok dont use this animation lol 

Link to comment
Share on other sites

10 hours ago, juandayz said:

@oldmatechoc @Cherdenko  or another variant, to execute automatically a user menu if the player have the knife to cut the rope

  Reveal hidden contents


private["_msg","_camDistance","_camera","_body","_positionp","_stick","_waitTime","_hastools","_inventory","_break_free","_waitcut"];
_body = _this select 0;
_waitTime = 60;
_inventory = items player;
_hastools = "ItemKnife" in _inventory;

diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
if (_body == player) then {
    diag_log("tied up!");
	_positionp = [player] call FNC_GetPos;
	_stick = createVehicle ["Plastic_Pole_EP1",_positionp, [], 0, "CAN_COLLIDE"];
    _body attachTo [_stick, [0, 0, 0]];
	player setVariable ["dayz_tieup",true];
[player,10,true,(getPosATL player)] spawn player_alertZombies;

///CAMERA EFFECT
_msg = format["You've been tied up! %1,",format["%1", name player]];
_camDistance = 60;
   showCinemaBorder true;
   camUseNVG false;			   
   _camera = "camera" camCreate [(position player select 0)-2, position player select 1,(position player select 2)+_camDistance];
   _camera cameraEffect ["internal","back"];
   
   _camera camSetFOV 2.000;
   _camera camCommit 0;
   waitUntil {camCommitted _camera};
  // playsound "";//add sound
 
   _camera camSetTarget vehicle player;
   _camera camSetRelPos [0,0,2];
   _camera camCommit 12;
 
   cutText [_msg, "PLAIN DOWN"];

   waitUntil {camCommitted _camera};
 
  _camera cameraEffect ["terminate","back"];
  camDestroy _camera;





if (_hastools) then {

ropecut = 
[
	["Confirmation",true],
	["Wanna Cut?", [-1], "", -5, [["expression", ""]], "1", "0"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["No", [2], "", -5, 	[["expression", "cut_answer=false;"]], "1", "1"],
	["Yes", [3], "", -5, 	[["expression", "cut_answer=true;"]], "1", "1"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["Exit", [-1], "", -3, 	[["expression", "cut_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:ropecut";

waitUntil {((!isNil 'cut_answer')||(commandingMenu == ""))};

if (isNil 'cut_answer') then {cut_answer=false;};

if (cut_answer) then {
deleteVehicle _stick; 	
	cutText ["Releasing you now!", "PLAIN DOWN"];
//	disableuserinput false;disableuserinput false;disableuserinput false;
	player setVariable ["dayz_tieup",false];
//	call dayz_resetSelfActions;		
};


		} else {

		
		
		
//	disableuserinput true;	disableuserinput true;	disableuserinput true;
//	player playMove "AmelPercMstpSnonWnonDnon_zasah6hlava";

	sleep _waitTime;				
	deleteVehicle _stick; 	
	cutText ["Releasing you now!", "PLAIN DOWN"];
//	disableuserinput false;disableuserinput false;disableuserinput false;
	player setVariable ["dayz_tieup",false];
//	call dayz_resetSelfActions;
		};

}; 

 

 

Infastar users need to add 

#USER:ropecut
Link to comment
Share on other sites

Tested with 2 other people once the tied up player breaks free, they are insta released next time tied up and so on until the player takes the knife out of inventory manually. Also shooting allows player to move and tp back once timer is up. 

@oldmatechoc 

56 minutes ago, oldmatechoc said:

@juandayz @Hooty

This is what i have so far. Very happy with it!

Ive commented out adding in the stick and attaching players too it. its not needed with the animations and disabling user input.

Ive left it in for those wanting to allow user input, warning though. if a player has a gun they can exit the animation and shoot infront of themselves.

  Reveal hidden contents


private["_breakfree","_breakfreechance","_body","_positionp","_stick","_TieupTimer","_hastools","_inventory","_TieupTimerMsg","_Done"];
_body	= _this select 0;
_inventory	= items player;
_BreakFree	= round(random 10);
_Done	= false;
//----------------------------------------------------//	Config
_TieUpTimer	= 30;
_HasTools	= "ItemKnife" in _inventory;
_BreakFreeChance	= 5;
_TieupTimerMsg	= "You will be released %1 seconds!";
//----------------------------------------------------//	Config End
Tie_Countdown= {
while{!_done} do {
    if(_TieUpTimer > 0) then {
	cutText [format[_TieupTimerMsg,_TieUpTimer], "PLAIN DOWN"];
	sleep 1;
	_TieUpTimer = _TieUpTimer - 1;   
	 _Done = _TieUpTimer <= 0;
		};
	};
};
//----------------------------------------------------//
diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
//----------------------------------------------------//
if (_body == player) then {
    diag_log("tied up!");
	_body switchMove "boundCaptive_loop";
//	_positionp = [player] call FNC_GetPos;
//	_stick = createVehicle ["Plastic_Pole_EP1",_positionp, [], 0, "CAN_COLLIDE"];
 //  _body attachTo [_stick,[0,0,0]];
	player setVariable ["dayz_tieup",true];
	[player,10,true,(getPosATL player)] spawn player_alertZombies;
	sleep 5;
//----------------------------------------------------//	
if (_hastools) then {
ropecut = [
	["Confirmation",true],
	["Try to break free?", [-1], "", -5, [["expression", ""]], "1", "0"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["No", [2], "", -5, 	[["expression", "cut_answer=false;"]], "1", "1"],
	["Yes", [3], "", -5, 	[["expression", "cut_answer=true;"]], "1", "1"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["Exit", [-1], "", -3, 	[["expression", "cut_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:ropecut";
waitUntil {((!isNil 'cut_answer')||(commandingMenu == ""))};
if (isNil 'cut_answer') then {cut_answer=false;};
if (cut_answer) then {
if (_breakfree < _breakfreechance)  exitWith {
	cutText ["Fuck! Dropped the knife!", "PLAIN DOWN"];
	disableuserinput true;disableuserinput true;disableuserinput true;
	_body switchMove "boundCaptive_loop";
	player removeWeapon "ItemKnife";
	call Tie_Countdown;
	sleep _TieupTimer;				
//	deleteVehicle _stick; 	
	disableuserinput false;disableuserinput false;disableuserinput false;
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["Releasing you now!", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];
};
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["Releasing you now!", "PLAIN DOWN"];
	sleep 3;
//	deleteVehicle _stick; 
	disableuserinput false;disableuserinput false;disableuserinput false;	
	player setVariable ["dayz_tieup",false];
};
	} else {
//----------------------------------------------------//
	disableuserinput true;disableuserinput true;disableuserinput true;
    _body switchMove "boundCaptive_loop";
	call Tie_Countdown;
	sleep _TieupTimer;		
//	deleteVehicle _stick; 	
	disableuserinput false;disableuserinput false;disableuserinput false;	
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["Releasing you now!", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];
	};
}; 





 

 

Better animations. hands bound behind back, and get up when over.
Count down for how long youll be tied up for.
Removed attachment and stick.
50/50 chance to break free or drop your knife (removes knife)

Only things I noticed. Rest of it seems works perfect. 

Link to comment
Share on other sites

@oldmatechoc @Hooty @Cherdenko

Quote

Tested with 2 other people once the tied up player breaks free, they are insta released next time tied up and so on until the player takes the knife out of inventory manually. Also shooting allows player to move and tp back once timer is up. 

tie_up2.sqf

Spoiler

private["_breakfree","_breakfreechance","_body","_seconds","_maxSeconds","_countdown","_hastools","_inventory","_time"];
_body	= _this select 0;
_inventory	= items player;
_BreakFree	= round(random 10);

//----------------------------------------------------//	Config

_HasTools	= "ItemKnife" in _inventory;
_BreakFreeChance	= 5;
_time = 40;
//----------------------------------------------------//	Config End

//----------------------------------------------------//
diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
//----------------------------------------------------//
if (_body == player) then {
    diag_log("tied up!");
	_body switchMove "boundCaptive_loop";
	player setVariable ["dayz_tieup",true];
	[player,10,true,(getPosATL player)] spawn player_alertZombies;
	sleep 5;
//----------------------------------------------------//	
if (_hastools) then {
ropecut = [
	["Confirmation",true],
	["Try to break free?", [-1], "", -5, [["expression", ""]], "1", "0"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["No", [2], "", -5, 	[["expression", "cut_answer=false;"]], "1", "1"],
	["Yes", [3], "", -5, 	[["expression", "cut_answer=true;"]], "1", "1"],
	["", [-1], "", -5, 		[["expression", ""]], "1", "0"],
	["Exit", [-1], "", -3, 	[["expression", "cut_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:ropecut";
waitUntil {((!isNil 'cut_answer')||(commandingMenu == ""))};
if (isNil 'cut_answer') then {cut_answer=false;};
if (cut_answer) then {

if (_breakfree < _breakfreechance)  exitWith {
	cutText ["Fuck! Dropped the knife!", "PLAIN DOWN"];
	disableuserinput true;disableuserinput true;disableuserinput true;
	_body switchMove "boundCaptive_loop";
	player removeWeapon "ItemKnife";
    sleep _time;

	disableuserinput false;disableuserinput false;disableuserinput false;
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["Releasing you now!", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];
};

disableuserinput false;disableuserinput false;disableuserinput false;
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["Releasing you now!", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];

	} else {
//----------------------------------------------------//
/////COUNT//////////////
_countdown = true;
_maxSeconds = 40;
_seconds = 0;

while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["Releasing you now!", "PLAIN DOWN"];
	disableuserinput false;disableuserinput false;disableuserinput false;	
	player setVariable ["dayz_tieup",false];
    };
/////////////////////

_seconds = _seconds + 1;
  sleep 1;
};


	};
}; 

 

 

Link to comment
Share on other sites

 if (_DisableInput) then {disableuserinput false;disableuserinput false;disableuserinput false;};

if this code are giving issues (love it) we can just remove it and add a

removeAllWeapons _body;

and other thing  @oldmatechoc about my bad englsish cannot understand so well..  the user menu are working bad?

this

Spoiler

ropecut = [
    ["Confirmation",true],
    ["Try to break free?", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["No", [2], "", -5,     [["expression", "cut_answer=false;"]], "1", "1"],
    ["Yes", [3], "", -5,     [["expression", "cut_answer=true;"]], "1", "1"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["Exit", [-1], "", -3,     [["expression", "cut_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:ropecut";
waitUntil {((!isNil 'cut_answer')||(commandingMenu == ""))};
if (isNil 'cut_answer') then {cut_answer=false;};
if (cut_answer) then {

 

and about the animation:

Quote

from what i tested i couldn't interrupt that animation.

i see that youre not using playMove only switch.

so for example

   _body playMove "boundCaptive_loop"; //start animate
//bunch of code....
    _body switchMove "boundCaptive_loop";//stop animation

and if the animation still no longer be stoped.. press "V"

And another thing some time ago working on kumyrna town mod, i was proove  animations, and a lot of them never go back to a normal state.

Link to comment
Share on other sites

@oldmatechoc   @Hooty @Cherdenko  this must be work

Spoiler

private["_breakfree","_breakfreechance","_body","_seconds","_maxSeconds","_countdown","_hastools","_inventory","_time"];
_body	= _this select 0;
_inventory	= items player;
_BreakFree	= round(random 10);

//----------------------------------------------------//	Config

_HasTools	= "ItemKnife" in _inventory;
_BreakFreeChance	= 5;
_time = 10;
//----------------------------------------------------//	Config End

//----------------------------------------------------//
diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
//----------------------------------------------------//
if (_body == player) then {
    diag_log("tied up!");
 _body playMove "boundCaptive_loop"; //start animate
	
	player setVariable ["dayz_tieup",true];
	[player,10,true,(getPosATL player)] spawn player_alertZombies;
	sleep 5;
//----------------------------------------------------//	
if (_hastools) then {

cut = 0;
ropecut = 
[
	["Confirmation",true],
	["Try to break free?", [-1], "", -5, [["expression", ""]], "1", "0"],
	["", [-1], "", -5, [["expression", ""]], "1", "0"],
	["YES", [], "", -5, [["expression", "cut=1;"]], "1", "1"],
	["NO", [], "", -5, [["expression", "cut=0;"]], "1", "1"],	
	["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:ropecut";
WaitUntil{commandingMenu == ""};		


if(cut != 0) then {



if (_breakfree < _breakfreechance)  exitWith {
	cutText ["Fuck! Dropped the knife!", "PLAIN DOWN"];
	disableuserinput true;disableuserinput true;disableuserinput true;
	_body switchMove "boundCaptive_loop";
	player removeWeapon "ItemKnife";
    sleep _time;

	disableuserinput false;disableuserinput false;disableuserinput false;
	cutText ["Releasing you now!", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];
};


	cutText ["Releasing you now!", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];
    _body switchMove "boundCaptive_loop";
	} else {
//----------------------------------------------------//
/////COUNT//////////////
_countdown = true;
_maxSeconds = 40;
_seconds = 0;

while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
  _body switchMove "boundCaptive_loop";
	cutText ["Releasing you now!", "PLAIN DOWN"];
	disableuserinput false;disableuserinput false;disableuserinput false;	
	player setVariable ["dayz_tieup",false];
    };
/////////////////////

_seconds = _seconds + 1;
  sleep 1;
};


	};
}; 

 

the exit syntax  from user menu is diferent

Link to comment
Share on other sites

10 hours ago, oldmatechoc said:

 


 _body playMove "boundCaptive_loop";

Doesnt work. Players just stand there and don't do the animation.


	_body playMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";	//Getup

freezes players until they press the vault key (V)

ok, your the boss friend :laugh:

Link to comment
Share on other sites

@oldmatechoc i made a lil change,, we forgot add what happend if player have a knife but select No cut the rope.

basically

if(cut != 0) then {

}else{

};

so now looks:

Spoiler

private["_DisableInput","_AttachtoStick","_TieupTimerMsg","_TieUpTimer","_Done","_GiveBackRope","_positionp","_stick","_breakfree","_BreakFreeFailChance","_body","_hastools","_inventory","_TieUpTimer"];
_body	= _this select 0;
_inventory	= items player;
_BreakFree	= round(random 10);
_Done	= false;

//-----------------------Config-----------------------------//	
_DisableInput					= true;					//	Disable thier mouse and keyboard? >:D 	//If true, you must attach to stick or player can stand up and walk away.
_AttachtoStick				= false;				//	Stick them to a stick?
_GiveBackRope				= true;					//	If player didnt try cut the rope give it to the victim?
_TieUpTimer					= 30;					//How long do we want to be tied up for?
_TieupTimerMsg				= "Trying to get free, I'll have it in %1 seconds";
_HasTools						= "ItemKnife" in _inventory;			// Tools needed to cut free
_BreakFreeFailChance	= 5;						// 5/10 to fail.   9/10 Hard		1/10 Easy
//-----------------------End-----------------------------//	

/////////////////////////OLDMATECHO FUNCTIONS///////////////////////////
/////////////////////////COUNTDOWN//////////////////////////////////////
Tie_Countdown= {
while{!_done} do {
    if(_TieUpTimer > 0) then {
	cutText [format[_TieupTimerMsg,_TieUpTimer], "PLAIN DOWN"];
	sleep 1;
	_TieUpTimer = _TieUpTimer - 1;   
	 _Done = _TieUpTimer <= 0;
		};
	};
};

//////////////////////////////DETACH PLAYER TIEDUP//////////////////////////////
Player_Tiedup = {
	if (_DisableInput) then {disableuserinput true;disableuserinput true;disableuserinput true;};
    _body switchMove "boundCaptive_loop";
	call Tie_Countdown;
	sleep _TieupTimer;		
	if (_AttachtoStick) then {deleteVehicle _stick; };
	if (_DisableInput) then {disableuserinput false;disableuserinput false;disableuserinput false;};
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["You've wriggled free", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false]; 
};
////////////////////////////////END OF FUNCTIONS//////////////////////////////////////////////	



////////////////////////////START  PLAYER TO BE TIED UP

diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
//----------------------------------------------------//
if (_body == player) then {
    diag_log("tied up!");
	_body switchMove "boundCaptive_loop";
if (_AttachtoStick) then { 
	_positionp = [player] call FNC_GetPos;
	_stick = createVehicle ["Plastic_Pole_EP1",_positionp, [], 0, "CAN_COLLIDE"];
   _body attachTo [_stick];
}; 
	player setVariable ["dayz_tieup",true];
	[player,10,true,(getPosATL player)] spawn player_alertZombies;
	sleep 5;
///////////////////////////////END OF TIE UP////////////////////////


///////////////////////////CHECK IF PLAYER TIE UP HAD A KNIFE TO TRY TO CUT THE ROPE//////////////////	
if (_hastools) then {
cut = 0;
ropecut = 
[
	["Confirmation",true],
	["Try to break free?", [-1], "", -5, [["expression", ""]], "1", "0"],
	["", [-1], "", -5, [["expression", ""]], "1", "0"],
	["YES", [], "", -5, [["expression", "cut=1;"]], "1", "1"],
	["NO", [], "", -5, [["expression", "cut=0;"]], "1", "1"],	
	["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:ropecut";
WaitUntil{commandingMenu == ""};		
if(cut != 0) then {
if (_BreakFree < _BreakFreeFailChance)  exitWith {
	cutText ["Fuck! Dropped the knife!", "PLAIN DOWN"];
	if (_DisableInput) then {disableuserinput true;disableuserinput true;disableuserinput true;};
	_body switchMove "boundCaptive_loop";
	player removeWeapon "ItemKnife";
	call Tie_Countdown;
    sleep _TieUpTimer;
	call Player_Tiedup;	
};
	if (_DisableInput) then {disableuserinput false;disableuserinput false;disableuserinput false;};
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";	//Getup
	cutText ["You've cut yourself free", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];
} else {
/////////////////////////IF PLAYER HAVE KNIFE BUT HE DONT WANNA CUT THE ROPE///////
call Tie_Countdown;
    sleep _TieUpTimer;
	call Player_Tiedup;	
	if (_GiveBackRope) then {player addMagazine "equip_rope";};
	};
////////////////////////END OF KNIFE CHECK////////////////	
	} else {
///////////////////////////PROCEED IF PLAYER DSNT HAVE KNIFE
	call Tie_Countdown;
    sleep _TieUpTimer;
	call Player_Tiedup;	
	if (_GiveBackRope) then {player addMagazine "equip_rope";};
	};
}; 

 

 

Link to comment
Share on other sites

so this is the new update in tie_up2  right?

Spoiler

private["_DisableInput","_AttachtoStick","_TieupTimerMsg","_TieUpTimer","_Done","_GiveBackRope","_positionp","_stick","_breakfree","_BreakFreeFailChance","_body","_hastools","_inventory","_TieUpTimer"];
_body	= _this select 0;
_inventory	= items player;
_BreakFree	= round(random 10);
_Done	= false;

//-----------------------Config-----------------------------//	
_DisableInput					= true;					//	Disable thier mouse and keyboard? >:D 	//If true, you must attach to stick or player can stand up and walk away.
_AttachtoStick				= false;				//	Stick them to a stick?
_GiveBackRope				= true;					//	If player didnt try cut the rope give it to the victim?
_TieUpTimer					= 30;					//How long do we want to be tied up for?
_TieupTimerMsg				= "Trying to get free, I'll have it in %1 seconds";
_HasTools						= "ItemKnife" in _inventory;			// Tools needed to cut free
_BreakFreeFailChance	= 5;						// 5/10 to fail.   9/10 Hard		1/10 Easy
//-----------------------End-----------------------------//	

/////////////////////////OLDMATECHO FUNCTIONS///////////////////////////
/////////////////////////COUNTDOWN//////////////////////////////////////
Tie_Countdown= {
while{!_done} do {
    if(_TieUpTimer > 0) then {
	cutText [format[_TieupTimerMsg,_TieUpTimer], "PLAIN DOWN"];
	sleep 1;
	_TieUpTimer = _TieUpTimer - 1;   
	 _Done = _TieUpTimer <= 0;
		};
	};
};

//////////////////////////////DETACH PLAYER TIEDUP//////////////////////////////
Player_Tiedup = {
	if (_DisableInput) then {disableuserinput true;disableuserinput true;disableuserinput true;};
    _body switchMove "boundCaptive_loop";
	call Tie_Countdown;
	sleep _TieupTimer;		
	if (_AttachtoStick) then {deleteVehicle _stick; };
	if (_DisableInput) then {disableuserinput false;disableuserinput false;disableuserinput false;};
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";
	cutText ["You've wriggled free", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false]; 
};
////////////////////////////////END OF FUNCTIONS//////////////////////////////////////////////	



////////////////////////////START  PLAYER TO BE TIED UP

diag_log("tie up attempt on:" + str(_body) + " and I am: " + str(player) );
//----------------------------------------------------//
if (_body == player) then {
    diag_log("tied up!");
	_body switchMove "boundCaptive_loop";
if (_AttachtoStick) then { 
	_positionp = [player] call FNC_GetPos;
	_stick = createVehicle ["Plastic_Pole_EP1",_positionp, [], 0, "CAN_COLLIDE"];
   _body attachTo [_stick];
}; 
	player setVariable ["dayz_tieup",true];
	[player,10,true,(getPosATL player)] spawn player_alertZombies;
	sleep 5;
///////////////////////////////END OF TIE UP////////////////////////


///////////////////////////CHECK IF PLAYER TIE UP HAD A KNIFE TO TRY TO CUT THE ROPE//////////////////	
if (_hastools) then {
cut = 0;
ropecut = 
[
	["Confirmation",true],
	["Try to break free?", [-1], "", -5, [["expression", ""]], "1", "0"],
	["", [-1], "", -5, [["expression", ""]], "1", "0"],
	["YES", [], "", -5, [["expression", "cut=1;"]], "1", "1"],
	["NO", [], "", -5, [["expression", "cut=0;"]], "1", "1"],	
	["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:ropecut";
WaitUntil{commandingMenu == ""};		
if(cut != 0) then {
if (_BreakFree < _BreakFreeFailChance)  exitWith {
	cutText ["Fuck! Dropped the knife!", "PLAIN DOWN"];
	if (_DisableInput) then {disableuserinput true;disableuserinput true;disableuserinput true;};
	_body switchMove "boundCaptive_loop";
	player removeWeapon "ItemKnife";
	call Tie_Countdown;
    sleep _TieUpTimer;
	call Player_Tiedup;	
};
	if (_DisableInput) then {disableuserinput false;disableuserinput false;disableuserinput false;};
	_body switchMove "amovpsitmstpsraswrfldnon_amovpercmstpslowwrfldnon";	//Getup
	cutText ["You've cut yourself free", "PLAIN DOWN"];
	player setVariable ["dayz_tieup",false];
} else {
/////////////////////////IF PLAYER HAVE KNIFE BUT HE DONT WANNA CUT THE ROPE///////
call Tie_Countdown;
    sleep _TieUpTimer;
	call Player_Tiedup;	
	if (_GiveBackRope) then {player addMagazine "equip_rope";};
	};
////////////////////////END OF KNIFE CHECK////////////////	
	} else {
///////////////////////////PROCEED IF PLAYER DSNT HAVE KNIFE
	call Tie_Countdown;
    sleep _TieUpTimer;
	call Player_Tiedup;	
	if (_GiveBackRope) then {player addMagazine "equip_rope";};
	};
}; 

 

Link to comment
Share on other sites

@oldmatechoc  @Hooty  @Cherdenko @gernika whats about if we use something like this in player_restrain.sqf

Spoiler

private["_hasitem","_body","_isHero","_isBandit","_setZedType","_rand","_positionp","_zCreate","_zPos"];
_body =    _this select 3;
_hasitem = "equip_rope" in magazines player;
_isHero = (_body getVariable["humanity",0]) >= 5000;
_isBandit = (_body getVariable["humanity",0]) <= 5000;

//FN_createZeds
fn_createZeds = {
zTypes = ["zZombie_Base","z_villager1","z_villager2","z_villager3","z_suit1","z_suit2","z_worker1","z_worker2","z_worker3","z_soldier","z_soldier_heavy","z_soldier_pilot","z_policeman","z_teacher","z_doctor","z_hunter","z_priest"];
zCount = 0;
area = 0;
_positionp = _body call FNC_GetPos;
_rand = floor(random 100);
if (_rand <= 70) then {
zCount = 5;
area = 5;	
};
if (_rand <= 100 && _rand > 71) then {
zCount = 10;
area = 10;
};
_i = 1;
for "_i" from 1 to zCount do {
	[zTypes] spawn {
		zTypes = _this select 0;
		_setZedType = zTypes call BIS_fnc_selectRandom;
		_zCreate = createAgent [_setZedType, _positionp, [], area, "NONE"];
		_zPos = getPosATL _zCreate;
		[_zPos,_zCreate] execFSM "\z\addons\dayz_code\system\zombie_agent.fsm";
	};
};
};
//END FN



if (!_hasitem) exitWith {
        systemChat("You need Rope to tie up another Player");
};
 
 
if (_hasitem) then {
dayz_tieup = [_body,3.5];
player removeMagazine "equip_rope";
publicVariable "dayz_tieup";
player playActionNow "Medic";
sleep 1;
if (_isHero) then {
[player,-300] call player_humanityChange;
call fn_createZeds;

	}else{
    
if (_isBandit) then {
call fn_createZeds;
[player,100] call player_humanityChange;
player addMagazine "ItemBriefcase100oz";

}else{
 if (!_isHero && !_isBandit) then {	
 [player,-100] call player_humanityChange;
call fn_createZeds;
	};
};
};


   };

 

 

Link to comment
Share on other sites

8 hours ago, oldmatechoc said:

hahaha @juandayz

So spawn zeds in the area and tie them up? with humanity reductions? haha very nice.

Rewarding bandits?


player addMagazine "ItemBriefcase100oz";

i fear players would sit in their base and make themselves rich with this. otherwise i really like the humanity additions.

 

 

also typo in the main post, no biggie but someone might not read it correctly :P


Player_Restrain.sqf .sqf  (drop in the new path)

 

spawns zeds in the tied up player area.. any way i thinks is better use something like a radio and integrate the boilt mod to call the zeds.

about the briefcase, yup you right.:laugh:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...