Jump to content

[Tutorial] Patdown Player + Seize Objects


!TS JORDAN
 Share

Recommended Posts

4 hours ago, Dark said:

Alright well GJ then - I prefer the pat down to the seize anyways - it's more realistic.

I have coded a few things and helped out on quite a bit - so I do understand which is why I went out of my way to state his name etc.

Anyways, like I said, apologies and GJ.

The 2 codes are completely different. 

Link to comment
Share on other sites

  • 2 weeks later...
Just now, !TS JORDAN said:

because i was testing, i deleted the soundfile after i made the script, if you want one go find one i aint spoonfeeding you everything

I have found one, why are you so rude to everyone? No need to be a dick, I asked a simple question

Link to comment
Share on other sites

  • 2 weeks later...
18 hours ago, ToxicRageTv said:

@!TS JORDAN

How would i add it so it would drop the clothing as well. on another post @IceEagle132 said to put 

removeUniform player;

but im not sure where

 

Try: 

/*
	Author: !TS JORDAN
	For: AltisLifeRPG Community
	Description: Takes a players weapons and mags, then drops them on the ground.
*/
private["_hgItems","_holder","_items","_pwItems","_safeItems","_swItems","_weps","_unit"];

_safeItems = ["FirstAidKit","ItemRadio","ItemMap","ItemCompass","ItemGPS","ItemWatch","NVGoggles","Rangefinder","Binocular"];
_unit = player;

[_unit,"patdown"] remoteExec ["life_fnc_say3D",RANY];	

titleText[localize "Your weapons are removed.","PLAIN"];

_weps = [];

_pwItems = primaryWeaponItems player;
_swItems = secondaryWeaponItems player;
_hgitems = handGunItems player;

_mags = magazinesAmmoFull player;

{player removeMagazine _x} foreach (magazines player);

if(primaryWeapon player != "") then
{
	_weps pushBack (primaryWeapon player);
	player removeWeapon (primaryWeapon player);

};

if(uniform player != "") then
{
	_weps pushBack (uniform player);
	player removeUniform player;

};

if(backpack player != "") then
{
	_weps pushBack (backpack player);
	player removeBackpack player;

};

if(vest player != "") then
{
	_weps pushBack (vest player);
	player removeVest player;

};

		
if(secondaryWeapon player != "") then
{
	_weps pushBack (secondaryWeapon player);
	player removeWeapon (secondaryWeapon player);

};
		
if(handgunWeapon player != "") then
{
	_weps pushBack (handgunWeapon player);
	player removeWeapon (handgunWeapon player);
};

{
	_items = _x;
	{
		player unassignItem _x;
		player removeItem _x;
	}forEach _items;
	
}forEach [_hgItems, _pwItems, _swItems]; 

{
	if (!(_x in _safeItems)) then
	{
		player removeItem _x;
		_weps pushBack _x;
	};

}forEach (weapons player);

 _holder = createVehicle [ "GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE" ];
 
{
	_holder addWeaponCargoGlobal [_x,1];
}forEach _weps;

{
	_holder addMagazineCargoGlobal [_x select 0,1];
}forEach _mags;

{
	_items = _x;
	{
		_holder addItemCargoGlobal [_x,1];
	}forEach _items;
}forEach [_hgItems, _pwItems, _swItems];

call life_fnc_saveGear;

 

Link to comment
Share on other sites

On 2017-02-03 at 1:37 PM, !TS JORDAN said:

Try: 

/*
	Author: !TS JORDAN
	For: AltisLifeRPG Community
	Description: Takes a players weapons and mags, then drops them on the ground.
*/
private["_hgItems","_holder","_items","_pwItems","_safeItems","_swItems","_weps","_unit"];

_safeItems = ["FirstAidKit","ItemRadio","ItemMap","ItemCompass","ItemGPS","ItemWatch","NVGoggles","Rangefinder","Binocular"];
_unit = player;

[_unit,"patdown"] remoteExec ["life_fnc_say3D",RANY];	

titleText[localize "Your weapons are removed.","PLAIN"];

_weps = [];

_pwItems = primaryWeaponItems player;
_swItems = secondaryWeaponItems player;
_hgitems = handGunItems player;

_mags = magazinesAmmoFull player;

{player removeMagazine _x} foreach (magazines player);

if(primaryWeapon player != "") then
{
	_weps pushBack (primaryWeapon player);
	player removeWeapon (primaryWeapon player);

};

if(uniform player != "") then
{
	_weps pushBack (uniform player);
	player removeUniform player;

};

if(backpack player != "") then
{
	_weps pushBack (backpack player);
	player removeBackpack player;

};

if(vest player != "") then
{
	_weps pushBack (vest player);
	player removeVest player;

};

		
if(secondaryWeapon player != "") then
{
	_weps pushBack (secondaryWeapon player);
	player removeWeapon (secondaryWeapon player);

};
		
if(handgunWeapon player != "") then
{
	_weps pushBack (handgunWeapon player);
	player removeWeapon (handgunWeapon player);
};

{
	_items = _x;
	{
		player unassignItem _x;
		player removeItem _x;
	}forEach _items;
	
}forEach [_hgItems, _pwItems, _swItems]; 

{
	if (!(_x in _safeItems)) then
	{
		player removeItem _x;
		_weps pushBack _x;
	};

}forEach (weapons player);

 _holder = createVehicle [ "GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE" ];
 
{
	_holder addWeaponCargoGlobal [_x,1];
}forEach _weps;

{
	_holder addMagazineCargoGlobal [_x select 0,1];
}forEach _mags;

{
	_items = _x;
	{
		_holder addItemCargoGlobal [_x,1];
	}forEach _items;
}forEach [_hgItems, _pwItems, _swItems];

call life_fnc_saveGear;

 

Doesnt work everything stops working when i used this one

Link to comment
Share on other sites

6 hours ago, !TS JORDAN said:

Can you provide error logs please, client and server?

This is the error im getting

Quote

Error in expression <_weps pushBack (uniform player);
player removeUniform player;

};

if(backpack p>
  Error position: <removeUniform player;

};

if(backpack p>
  Error Missing ;
File mpmissions\__cur_mp.Altis\core\cop\fn_seizeClient.sqf, line 35
Error in expression <_weps pushBack (uniform player);
player removeUniform player;

};

if(backpack p>
  Error position: <removeUniform player;

};

if(backpack p>
  Error Missing ;
File mpmissions\__cur_mp.Altis\core\cop\fn_seizeClient.sqf, line 35

 

Link to comment
Share on other sites

@Hyper4u.'<3

/*
	Author: !TS JORDAN
	For: AltisLifeRPG Community
	Description: Takes a players weapons and mags, then drops them on the ground.
*/
private["_hgItems","_holder","_items","_pwItems","_safeItems","_swItems","_weps","_unit"];

_safeItems = ["FirstAidKit","ItemRadio","ItemMap","ItemCompass","ItemGPS","ItemWatch","NVGoggles","Rangefinder","Binocular"];
_unit = player;

[_unit,"patdown"] remoteExec ["life_fnc_say3D",RANY];	

titleText[localize "Your weapons are removed.","PLAIN"];

_weps = [];

_pwItems = primaryWeaponItems player;
_swItems = secondaryWeaponItems player;
_hgitems = handGunItems player;

_mags = magazinesAmmoFull player;

{player removeMagazine _x} foreach (magazines player);

if(primaryWeapon player != "") then
{
	_weps pushBack (primaryWeapon player);
	player removeWeapon (primaryWeapon player);

};

if(uniform player != "") then
{
	_weps pushBack (uniform player);
	removeUniform player;

};

if(backpack player != "") then
{
	_weps pushBack (backpack player);
	removeBackpack player;

};

if(vest player != "") then
{
	_weps pushBack (vest player);
	removeVest player;

};

		
if(secondaryWeapon player != "") then
{
	_weps pushBack (secondaryWeapon player);
	player removeWeapon (secondaryWeapon player);

};
		
if(handgunWeapon player != "") then
{
	_weps pushBack (handgunWeapon player);
	player removeWeapon (handgunWeapon player);
};

{
	_items = _x;
	{
		player unassignItem _x;
		player removeItem _x;
	}forEach _items;
	
}forEach [_hgItems, _pwItems, _swItems]; 

{
	if (!(_x in _safeItems)) then
	{
		player removeItem _x;
		_weps pushBack _x;
	};

}forEach (weapons player);

 _holder = createVehicle [ "GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE" ];
 
{
	_holder addWeaponCargoGlobal [_x,1];
}forEach _weps;

{
	_holder addMagazineCargoGlobal [_x select 0,1];
}forEach _mags;

{
	_items = _x;
	{
		_holder addItemCargoGlobal [_x,1];
	}forEach _items;
}forEach [_hgItems, _pwItems, _swItems];

call life_fnc_saveGear;

 

Link to comment
Share on other sites

On 11/30/2016 at 4:32 PM, !TS JORDAN said:

Today I will be sharing 2 scripts with the community, one I made myself, one I cannot find the original author for, If the original author for the SeizeObjects script would like to come forward I will put them as the right full owner. Many people have been asking for a patdown script so i will introduce one today.

NOTE: People on 4.4r3 will only have to edit the file "seizeClient" for the patdown. People not using 4.4r3 will have to follow all steps.

Step 1: 

Go to core>>actions and create a file called "fn_seizePlayerAction.sqf" inside

#include "..\..\script_macros.hpp"
/*
    File: fn_seizePlayerAction.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Starts the seize process..
    Based off Tonic's fn_searchAction.sqf
*/
params [
    ["_unit",objNull,[objNull]]
];
if (isNull _unit) exitWith {};
sleep 2;
if (player distance _unit > 5 || !alive player || !alive _unit) exitWith {hint localize "STR_NOTF_CannotSeizePerson"};
[player] remoteExec ["life_fnc_seizeClient",_unit];
life_action_inUse = false;

NOTE: That script is Tonics 4.4r3 framework. Just calls the patdown script. 

Step 2: 

Go to core>>cop and create a file called "fn_seizeClient.sqf" inside

/*
	Author: !TS JORDAN
	For: AltisLifeRPG Community
	Description: Takes a players weapons and mags, then drops them on the ground.
*/
private["_hgItems","_holder","_items","_pwItems","_safeItems","_swItems","_weps","_unit"];

_safeItems = ["FirstAidKit","ItemRadio","ItemMap","ItemCompass","ItemGPS","ItemWatch","NVGoggles","Rangefinder","Binocular"];
_unit = player;

[_unit,"patdown"] remoteExec ["life_fnc_say3D",RANY];	

titleText[localize "Your weapons are removed.","PLAIN"];

_weps = [];

_pwItems = primaryWeaponItems player;
_swItems = secondaryWeaponItems player;
_hgitems = handGunItems player;

_mags = magazinesAmmoFull player;

{player removeMagazine _x} foreach (magazines player);

if(primaryWeapon player != "") then
{
	_weps pushBack (primaryWeapon player);
	player removeWeapon (primaryWeapon player);

};
		
if(secondaryWeapon player != "") then
{
	_weps pushBack (secondaryWeapon player);
	player removeWeapon (secondaryWeapon player);

};
		
if(handgunWeapon player != "") then
{
	_weps pushBack (handgunWeapon player);
	player removeWeapon (handgunWeapon player);
};

{
	_items = _x;
	{
		player unassignItem _x;
		player removeItem _x;
	}forEach _items;
	
}forEach [_hgItems, _pwItems, _swItems]; 

{
	if (!(_x in _safeItems)) then
	{
		player removeItem _x;
		_weps pushBack _x;
	};

}forEach (weapons player);

 _holder = createVehicle [ "GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE" ];
 
{
	_holder addWeaponCargoGlobal [_x,1];
}forEach _weps;

{
	_holder addMagazineCargoGlobal [_x select 0,1];
}forEach _mags;

{
	_items = _x;
	{
		_holder addItemCargoGlobal [_x,1];
	}forEach _items;
}forEach [_hgItems, _pwItems, _swItems];

call life_fnc_saveGear;

 

Step 3: 

Go to core>>cop and create a file called "fn_seizeObjects.sqf" inside

/*
	BLAH
	BLAH
*/
_clear = nearestObjects [player,["weaponholder"],3];
_clear = _clear + nearestObjects [player,["GroundWeaponHolder"],3];
_clear = _clear + nearestObjects [player,["WeaponHolderSimulated"],3];
_destroyed = 0;
for "_i" from 0 to count _clear - 1 
do
{
	_destroyed = _destroyed + 1;
	deleteVehicle (_clear select _i);
};

titleText[format["Seized %1 ground objects in the vicinity.", _destroyed],"PLAIN"];

Step 4:

Go to core>>cop>>copInteractionMenu.sqf and add 

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

NOTE: Some people may already have button 8 in use. Just add the extra button in the dialog and define them further up in copInteractionMenu

Step 5:

Go to functions.hpp (root folder) add under actions class

class seizePlayerAction {};

add under cop class

class seizeObjects {};
class seizeClient {};

Step 6:

Go to CfgRemoteExec.hpp and add under client functions

 F(life_fnc_seizeClient,CLIENT)
 F(life_fnc_seizeObjects,CLIENT)

Step 7:

Go to core>>setupActions.sqf under

switch (playerSide) do {
    case civilian: {
		You're actions are here

	};

add

	case west: {
		life_actions pushBack (player addAction["Seize Objects",life_fnc_seizeObjects,cursorTarget,0,false,false,"",'((count(nearestObjects [player,["WeaponHolder"],3])>0) || (count(nearestObjects [player,["GroundWeaponHolder"],3])>0) || (count(nearestObjects [player,["WeaponHolderSimulated"],3])>0))']);
	};

Step 8: 

Go to stringtable.xml and add

        <Key ID="STR_pInAct_Seize">
            <Original>Seize Weapons</Original>
            <Czech>zabavili zbraně</Czech>
            <Spanish>Confiscar Armas</Spanish>
            <Russian></Russian>
            <German>Seize Waffen</German>
            <French>Saisir les armes</French>
            <Italian>cogliere Armi</Italian>
            <Portuguese>Apreender Armas</Portuguese>
            <Polish>Chwytaj broń</Polish>
        </Key>

And we are done. I don't think I missed anything if I did then well comment and ill fix it up. Enjoy your day.

Hey pat down doesn't come up on cop menu. But the seize objects works!

Link to comment
Share on other sites

5 hours ago, Hyper4u.'<3 said:

in 4.4r3 Seize Weapons = Pat Down

Well seize weapon only happens when the items are on the ground.  Pat down happens when the weapons are person and you pat them down to get the items on the ground to seize them.  We'll the pat down part does not work,  I can't get them off the player.  From Neon 

Link to comment
Share on other sites

1 hour ago, Aim said:

Well seize weapon only happens when the items are on the ground.  Pat down happens when the weapons are person and you pat them down to get the items on the ground to seize them.  We'll the pat down part does not work,  I can't get them off the player.  From Neon 

No in the windows menu there is a Seize Weapon thing and when your press it it will pat down the weapons in 4.4.r3

Link to comment
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.

 Share


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.