// *******************************************************************************
// **       Funcion: setTrap
// **   Descripcion: Set boobytrap designed
// *******************************************************************************
// **         Autor: RAVEN
// **          Site: www.ArmedAssault.com.ar
// **         Forum: 
// *******************************************************************************

_man = _this select 0;
_tip = _this select 3;

private ["_dist","_tip","_action","_pos"];

if (_tip > 0) then
{
	_dist = 0.5;
	_action = "AinvPknlMstpSlayWrflDnon_AmovPercMstpSrasWrflDnon";

	_man playmove _action;
	sleep 1.5;

	switch (_tip) do
	{
		case 1: {_tip = "boobyTrap1"};
		case 2: {_tip = "boobyTrap2"};
		case 3: {_tip = "boobyTrap3"};
	};

	_carga = _tip createvehicle [0,0,0];
	_pos = _man modelToWorld [0,_dist,0];
	_carga setpos _pos;
	_carga setdir ((direction _man) + 90);
};

_man removeaction setTrap0;
_man removeaction setTrap1;
_man removeaction setTrap2;
_man removeaction setTrap3;
[_man] execVM "InitTrap.sqf";