[TUTO] Saisir Armes et Vetements.


#1

Bonjour aujourd’hui se sera deux tuto en un.

C’est a dire vous aurez la possibilité de choisir votre mode pour saisir armes et vêtements illégales.

La première c’est de les enlever directement sur le joueur.

1 | Saisir les armes et vêtements directement sur le joueur.

source : http://www.altisliferpg.com/topic/5149-tutorial-seizeweapon-3145/

core\cop\fn_seizePlayerWeapon.sqf

/*  
	File: fn_seizePlayerWeapon.sqf  
	Author: Skalicon  

	Description:  
	Preforms the seizePlayerWeaponAction script on the cursorTarget  
*/  
[[],"life_fnc_seizePlayerWeaponAction",cursorTarget,false] spawn life_fnc_MP;  
[[52, player, format["Un Gendarme a saisi armes et chargeurs de %1", name cursorTarget]],"TON_fnc_logIt",false,false] spawn life_fnc_MP;  

core\cop\fn_seizePlayerWeaponAction.sqf

/*  
	File: fn_seizePlayerWeaponAction.sqf  
	Author: Skalicon  
	Slightly adapted by Daniel Larusso (Keep Calm and Roleplay)  

	Description:  
	Removes the players weapons client side  
*/  
private["_blacklist", "_itemArray","_primary","_handgun","_magazines","_uniform","_vest","_backpack","_items","_primitems","_secitems","_handgunitems","_uitems","_vitems","_bitems","_handle"];  

_blacklist = [1] call life_fnc_seizeCfg;  

[] call life_fnc_saveGear;  

_itemArray = life_gear;  
if(count _itemArray == 0) exitWith {  
	[[52, player, format["%1 abc.", name cursorTarget]],"TON_fnc_logIt",false,false] spawn life_fnc_MP;  
};  

_uniform = [_itemArray,0,"",[""]] call BIS_fnc_param;  
_vest = [_itemArray,1,"",[""]] call BIS_fnc_param;  
_backpack = [_itemArray,2,"",[""]] call BIS_fnc_param;  
_goggles = [_itemArray,3,"",[""]] call BIS_fnc_param;  
_headgear = [_itemArray,4,"",[""]] call BIS_fnc_param;  
_items = [_itemArray,5,[],[[]]] call BIS_fnc_param;  
_prim = [_itemArray,6,"",[""]] call BIS_fnc_param;  
_seco = [_itemArray,7,"",[""]] call BIS_fnc_param;  
_uItems = [_itemArray,8,[],[[]]] call BIS_fnc_param;  
_uMags = [_itemArray,9,[],[[]]] call BIS_fnc_param;  
_bItems = [_itemArray,10,[],[[]]] call BIS_fnc_param;  
_bMags = [_itemArray,11,[],[[]]] call BIS_fnc_param;  
_vItems = [_itemArray,12,[],[[]]] call BIS_fnc_param;  
_vMags = [_itemArray,13,[],[[]]] call BIS_fnc_param;  
_pItems = [_itemArray,14,[],[[]]] call BIS_fnc_param;  
_hItems = [_itemArray,15,[],[[]]] call BIS_fnc_param;  
_yItems = [_itemArray,16,[],[[]]] call BIS_fnc_param;  

if(_prim in _blacklist) then { _prim = ""; };  
if(_seco in _blacklist) then { _seco = ""; };  
{if(_x in _blacklist) then { _uMags = _uMags - [_x]; }; } foreach _uMags;  
{if(_x in _blacklist) then { _vMags = _vMags - [_x]; }; } foreach _vMags;  
{if(_x in _blacklist) then { _bMags = _bMags - [_x]; }; } foreach _bMags;  

life_gear = [_uniform,_vest,_backpack,_goggles,_headgear,_items,_prim,_seco,_uItems,_uMags,_bItems,_bMags,_vItems,_vMags,_pItems,_hItems,_yItems];  

[] call life_fnc_loadGear;  
titleText["La Gendarmerie vous enleve vos affaires.","PLAIN"];  

core\config\fn_seizeCfg.sqf (Vous pouvez modifier ce que vous voulez comme armes et vetement c’est ce fichier la)

#include <macro.h>  
/*  
	File: fn_seizeCfg.sqf  
	Author: Tabakhase  
	Slightly adapted by Daniel Larusso (Keep Calm and Roleplay)  

	Description:  
	Master configuration file for seize player everything.  

	Parameters:  
	0 = All  
	1 = Weapons  
	2 = Uniform  
	3 = Backpack  
	4 = Vest  
	5 = Items  

	ToDo:  
	Adding list 0,2,3,4&5  
*/  
private["_mode"];  
_mode = [_this,0,objNull,[""]] call BIS_fnc_param;  

switch(_mode) do  
{  
	case 1:   
	{  
		[  
			// Weapons  
			"srifle_EBR_F",  
			"srifle_GM6_F",  
			"srifle_LRR_F",  
			"LMG_Mk200_F",  
			"hgun_P07_F",  
			"hgun_Rook40_F",  
			"hgun_ACPC2_F",  
			"hgun_Pistol_heavy_01_F",  
			"hgun_Pistol_heavy_01_snds_F",  
			"hgun_Pistol_heavy_02_F",  
			"hgun_PDW2000_F",  
			"hgun_Pistol_Signal_F",  
			"arifle_Katiba_F",  
			"arifle_Katiba_C_F",  
			"arifle_Katiba_GL_F",  
			"arifle_MXC_F",  
			"arifle_MXC_Black_F",  
			"arifle_MX_F",  
			"arifle_MX_Black_F",  
			"arifle_MX_GL_F",  
			"arifle_MX_GL_Black_F",  
			"arifle_MX_SW_F",  
			"arifle_MX_SW_Black_F",  
			"arifle_MXM_F",  
			"arifle_MXM_Black_F",  
			"arifle_SDAR_F",  
			"arifle_TRG21_F",  
			"arifle_TRG20_F",  
			"arifle_TRG21_GL_F",  
			"arifle_Mk20_F",  
			"arifle_Mk20_plain_F",  
			"arifle_Mk20C_F",  
			"arifle_Mk20C_plain_F",  
			"arifle_Mk20_GL_F",  
			"arifle_Mk20_GL_plain_F",  
			"LMG_Zafir_F",  
			"SMG_01_F",  
			"SMG_02_F",  
			"srifle_DMR_01_F",  

			// Mags  
			"30Rnd_556x45_Stanag",  
			"20Rnd_556x45_UW_mag",  
			"30Rnd_65x39_caseless_mag",  
			"30Rnd_65x39_caseless_green",  
			"20Rnd_762x51_Mag",  
			"7Rnd_408_Mag",  
			"5Rnd_127x108_Mag",  
			"100Rnd_65x39_caseless_mag",  
			"200Rnd_65x39_cased_Box",  
			"30Rnd_9x21_Mag",  
			"16Rnd_9x21_Mag",  
			"RPG32_F",  
			"RPG32_HE_F",  
			"1Rnd_Smoke_Grenade_shell",  
			"1Rnd_Smoke_Grenade_shell",  
			"1Rnd_SmokeGreen_Grenade_shell",  
			"3Rnd_SmokeGreen_Grenade_shell",  
			"HandGrenade_Stone",  
			"SmokeShell",  
			"SmokeShellGreen",  
			"200Rnd_65x39_Belt",  
			"ATMine_Range_Mag",  
			"APERSMine_Range_Mag",  
			"APERSBoundingMine_Range_Mag",  
			"SLAMDirectionalMine_Wire_Mag",  
			"APERSTripMine_Wire_Mag",  
			"ClaymoreDirectionalMine_Remote_Mag",  
			"SatchelCharge_Remote_Mag",  
			"DemoCharge_Remote_Mag",  
			"30Rnd_45ACP_Mag_SMG_01",  
			"9Rnd_45ACP_Mag",  
			"150Rnd_762x51_Box",  
			"11Rnd_45ACP_Mag",  
			"6Rnd_45ACP_Cylinder",  
			"10Rnd_762x51_Mag",  
			"5Rnd_127x108_APDS_Mag",  
			"6Rnd_GreenSignal_F",  
			"6Rnd_RedSignal_F"  
		];  
	};  

	case 2:   
	{  
		[  
			//Vetement  
			"U_IG_Guerilla1_1",  
			"U_I_G_resistanceLeader_F",  
			"U_IG_Guerilla3_1",  
			"U_IG_Guerilla3_2",  
			"U_IG_leader",  
			"U_O_CombatUniform_oucamo",  
			"U_O_SpecopsUniform_ocamo",  
			"U_O_OfficerUniform_ocamo",  
			"U_I_CombatUniform",  
			"U_O_CombatUniform_oucamo",  
			"U_I_OfficerUniform",  
			"U_I_GhillieSuit",  

			//Chapeau  
			"H_Booniehat_dgtl",  
			"H_Cap_brn_SPECOPS",  
			"H_Cap_blk_Raven",  
			"H_HelmetO_ocamo",  
			"H_MilCap_ocamo",  
			"H_HelmetO_oucamo",  
			"H_Bandanna_camo",  
			"H_Shemag_khk",  
			"H_Shemag_tan",  
			"H_Shemag_olive",  
			"H_Shemag_olive_hs",  
			"H_ShemagOpen_khk",  
			"H_ShemagOpen_tan",  
			"H_Watchcap_sgg",  
			"H_Hat_camo",  

			//Lunette  
			"G_Combat",  
			"G_Bandanna_aviator",  
			"G_Bandanna_beast",  
			"G_Bandanna_blkt",  
			"G_Bandanna_oli",  
			"G_Bandanna_shades",  
			"G_Bandanna_sport"  
		];  
	};  

	case 4:   
	{	  
		[  
			//Vest  
			"V_Chestrig_khk",  
			"V_Chestrig_rgr",  
			"V_Chestrig_blk",  
			"V_Chestrig_oli",  
			"V_TacVest_khk",  
			"V_TacVest_brn",  
			"V_TacVest_oli",  
			"V_HarnessO_brn",  
			"V_HarnessO_gry",  
			"V_PlateCarrierIA1_dgtl",  
			"V_PlateCarrierIA2_dgtl",  
			"V_HarnessOGL_gry"  
		];  
	};  
};  

core\setupActions.sqf

//Saisir Armes et Chargeurs  
life_actions = life_actions + [player addAction["<t color='#ED7F10'>Saisir Armes et Uniformes</t>",life_fnc_seizePlayerWeapon,cursorTarget,0,false,false,"",'!isNull cursorTarget && (player distance cursorTarget) < 6 && speed cursorTarget < 2 && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && (side cursorTarget == civilian) && (cursorTarget getVariable "restrained")']];  

Functions.h

class Config  
{  
	file = "core\config";  
	// …  
	class seizeCfg {};  
	// ...  
};  

class Cop  
{  
	file = "core\cop";  
	// ...  
	class seizePlayerWeapon {};  
	class seizePlayerWeaponAction {};  
	// ...  
};  

2 | Maintenant la deuxieme methode qui consiste a posé l’arme au sol et/ou vetement au sol et que la police puisse les recuperer.

Creer un fichier nommé : ’ fn_seizeObjects.sqf ’ dans le dossier functions dans le dosseir core !

core\functions\fn_seizeObjects.sqf

/*  
        File: fn_seizeObjects.sqf  
        Author: Skalicon  

        Description:  

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

titleText[format["Tu as saisis %1 et il a été detruit.", _destroyed],"PLAIN"];  

Dans le fichier SetupAction dans le dossier core :

core\setupActions.sqf

case west:  
    {  
        //Saisir les objets au sol  
        life_actions = life_actions + [player addAction["<t color='#FF0000'>Saisir les objets au sol</t>",life_fnc_seizeObjects,cursorTarget,0,false,false,"",'(count(nearestObjects [player,["weaponholder"],3])>0)']];  
    };  

Edit : pensez a declarer le fn_seizeObjects.sqf dans le functions.h

class Functions  
	{  
		file = "core\functions";  
		class calWeightDiff {};  
		class fetchCfgDetails {};  
		class handleInv {};  
		class hudSetup {};  
		class hudUpdate {};  
		class tazeSound {};  
		class animSync {};  
		class simDisable {};  
		class keyHandler {};  
		class dropItems {};  
		class handleDamage {};  
		class numberText {};  
		class handleItem {};  
		class accType {};  
		class receiveItem {};  
		class giveDiff {};  
		class receiveMoney {};  
		class playerTags {};  
		class clearVehicleAmmo {};  
		class pullOutVeh {};  
		class nearUnits {};  
		class actionKeyHandler {};  
		class playerCount {};  
		class fetchDeadGear {};  
		class loadDeadGear {};  
		class isnumeric {};  
		class escInterupt {};  
		class onTakeItem {};  
		class fetchVehInfo {};  
		class pushObject {};  
		class onFired {};  
		class revealObjects {};  
		class nearestDoor {};  
		class inventoryClosed {};  
		class inventoryOpened {};  
		class isUIDActive {};  
		class saveGear {};  
		class loadGear {};  
		class stripDownPlayer {};  
		class emptyFuel {};  
		class randomRound {};  
		class fadeSound {};  
                class seizeObjects {}; //A ajouter dans le functions.h  
	};  

Voila maintenant a vous de choisir ce que vous vouler.

Je tien a dire que dans le 1er choix on peut prendre les vetements aussi mais pour les prendre, il faut spammer pour retirer. Un petit beugg ce qui est fort dommage.


#2

Bon tuto , mais il manque un peu d’explication je trouve , même si c’est compréhensible :wink:


#3

Dite moi ce que vous voulez que j’explique et si je le peux j’expliquerais :slight_smile:


#4

Il faut créer les ficher au début?


#5

Octor Si les fichiers n’y sont pas, c’est qu’il faut les créer.


#6

Je fais que du copier collé pour tous les fichiers?


#7

Par contre j’ai fais comme tu as dis et puis pas moyen d’accéder a notre serveur, j’ai enlever tous les fichiers et mon serveur était re là


#8

Octor Regarde dans tes logs l’erreur car si je connais pas l’erreur je pourrais pas te dire :confused:


#9

Je connais pas le logs erreur , je vais ou pour le trouver? Désolé, je ne suis pas un expert :confused:


#10

Dans le ftp, la ou il y a ton sever.cfg, il y aura plein de fichier RPT. http://prntscr.com/63b5aj


#11

Oui c’est bon j’ai trouver je prends lequel?


#12

Ba le moment ou ton serveur ne marchais pas :slight_smile:


#13

Au moment que le serv allait pas

Les console affiche rien du tout

Vu que j’étais blocker devant la carte au chargement du serveur


#14

Logiquement si, car le serveur se lance quand meme !


#15

Nan dans tout les console a partir de l’heure que je l’avais mis rien du tout


#16

Ba si tu as rien c’est que ton serveur c’est pas lancé, normalement quand tu lances le serveur il y a les logs pour cela, moi quand je lances mon serveur, et si le problème comme toi est la, j’ai les logs pour me dire pourquoi sa a pas marché.


#17

Ba moi j’ai rien :o


#18

Peut être que ton serveur c’est pas lancé ! Sinon refait le tuto et regarde les logs sinon moi je peux rien faire !


#19

Pour ton tuto , ya rien a changer , c’est que du copier collé?


#20

Oui !