Mit diesem simplen Script wird das Beschlagnahmen von Waffen in Altis Life für Polizisten eingefügt.
Das Script stammt von Skalicon und wurde modifiziert von Daniel Larusso und cat24max aus dem Altis Life RPG Forum. Ich habe das Tutorial übersetzt und leicht modifiziert. Den ursprünglichen Thread gibt es leider nicht mehr online.
1. In diesem Tutorial werden die folgenden Dateien verändert oder erstellt
2. Erstelle die Datei corecopfn_seizePlayerWeapon.sqf und füge den folgenden Code ein:
/bin /boot /dev /etc /home /lib /lib64 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var File: fn_seizePlayerWeapon.sqf Author: Skalicon Modified by: cat24max Description: Preforms the seizePlayerWeaponAction script on the cursorTarget en-dev/ output/ [[],"life_fnc_seizePlayerWeaponAction",cursorTarget,false] spawn life_fnc_MP; [[52, player, format["Sie haben alle Waffen und Magazine von %1 beschlagnahmt.", name cursorTarget]],"TON_fnc_logIt",false,false] spawn life_fnc_MP;
3. Erstelle die Datei corecopfn_seizePlayerWeaponAction.sqf und füge folgenden Code ein:
/bin /boot /dev /etc /home /lib /lib64 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var File: fn_seizePlayerWeaponAction.sqf Author: Skalicon Modified by: cat24max and Daniel Larusso Description: Removes the players weapons client side en-dev/ output/ 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 hat keine Waffen bei sich.", 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["Ihre Waffen und Magazine wurden beschlagnahmt.","PLAIN"];
4. Erstelle die Datei coreconfigfn_seizeCfg.sqf und füge folgenden Code ein:
#include <macro.h> /bin /boot /dev /etc /home /lib /lib64 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var File: fn_seizeCfg.sqf Author: Tabakhase Modified by: cat24max and Daniel Larusso Description: Master configuration file for seize player everything. Parameters: 0 = All 1 = Weapons 2 = Uniform 3 = Backpack 4 = Vest 5 = Items en-dev/ output/ 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", "launch_B_Titan_F", "launch_I_Titan_F", "launch_O_Titan_F", "launch_B_Titan_short_F", "launch_I_Titan_short_F", "launch_O_Titan_short_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" ]; }; };
5. Editiere die coresetupActions.sqf Datei und füge im “case west” (für NATO/Polizei) den folgenden Code ein:
//Seize PlayerWeapons life_actions = life_actions + [player addAction["Waffe beschlagnahmen",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")']];
In dieser Datei wird der Polizei (NATO-Truppen) die Aktion auf andere Spieler hinzugefügt, um Waffen zu beschlagnahmen. Sollen z. B. Rebellen diese auch entfernen können (falls diese als eigene Gruppierung wie EAST/OPFOR definiert wurden) füge den selben Code unter einem “case east” ein. Sollen Rebellen auch Polizisten entwaffnen können, muss unter “case east” auch der folgende Code eingefügt werden. ACHTUNG: Dieser Schritt ist optional und wird nicht benötigt. Mit dem folgenden Code können OPFOR-Truppen (Rebellen) Zivilisten, andere Rebellen und NATO-Truppen (Polizei) entwaffnen. Dazu muss das “Opfer” gefesselt sein.
case east: { //Seize Rebellen Waffen für OPFOR von cat24max life_actions = life_actions + [player addAction["Entwaffnen",life_fnc_seizePlayerWeapon,cursorTarget,0,false,false,"",'!isNull cursorTarget && (player distance cursorTarget) < 6 && speed cursorTarget < 2 && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && (side cursorTarget == east) && (cursorTarget getVariable "restrained")']]; //Seize Ziv Waffen für OPFOR von cat24max life_actions = life_actions + [player addAction["Entwaffnen",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")']]; } //Seize Cop Waffen für OPFOR von cat24max life_actions = life_actions + [player addAction["Polizist entwaffnen",life_fnc_seizePlayerWeapon,cursorTarget,0,false,false,"",'!isNull cursorTarget && (player distance cursorTarget) < 6 && speed cursorTarget < 2 && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && (side cursorTarget == west) && (cursorTarget getVariable "restrained")']]; }
Falls man entwaffnen auch ohne fesseln machen kann ( Nicht zu empfehlen!!! Sonst kann jeder Cop am Marktplatz entwaffnet werden ), einfach “&& (cursorTarget getVariable “restrained”)” entfernen. Kann auch durch eine andere Life-Variable ersetzt werden. Nochmal: Ohne Variable nicht zu empfehlen.
6. Als letzen Schritt editiere Functions.h im Root-Ordner deiner Mission:
class Config { file = "coreconfig"; // ... class seizeCfg {}; // ... }; class Cop { file = "corecop"; // ... class seizePlayerWeapon {}; class seizePlayerWeaponAction {}; // ... };
Nicht einfach einfügen, sondern bei den entsprechenden Klassen!
Englisches Tutorial: Autor: Tim Vogler (cat24max)