// ---------------------------------------------------------------------------- // script for checking whats the playerID and sets the insignia for him // ---------------------------------------------------------------------------- // code snipplet for pasing into init of unit // player addEventHandler [ "InventoryClosed", { execVM "scripts\insigniacheck.sqf"; } ]; // defines the groups with uids for insignias in a multidimensional array _gruppen = [ // gruppe-fuchs 0 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-kobra 1 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-baer 2 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-marder 3 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-wolf 4 [ //playerID-1 "76561197965415722", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-panther 5 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-leopard 6 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-puma 7 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-hornisse 8 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ], // gruppe-reserve 9 [ //playerID-1 "", //playerID-2 "", //playerID-3 "", //playerID-4 "", //playerID-5 "", //playerID-6 "", //playerID-7 "", //playerID-8 "" ] ]; //get the player unique ID _uid = getPlayerUID player; // check in which group the player (playerid) is in // break up multidimensional array in parts _gruppe-fuchs = _gruppen select 0; _gruppe-kobra = _gruppen select 1; _gruppe-baer = _gruppen select 2; _gruppe-marder = _gruppen select 3; _gruppe-wolf = _gruppen select 4; _gruppe-panther = _gruppen select 5; _gruppe-leopard = _gruppen select 6; _gruppe-puma = _gruppen select 7; _gruppe-hornisse = _gruppen select 8; _gruppe-reserve = _gruppen select 9; _is-gruppe-fuchs = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-fuchs; _is-gruppe-kobra = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-kobra; _is-gruppe-baer = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-baer; _is-gruppe-marder = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-marder; _is-gruppe-wolf = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-wolf; _is-gruppe-panther = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-panther; _is-gruppe-leopard = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-leopard; _is-gruppe-puma = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-puma; _is-gruppe-hornisse = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-hornisse; _is-gruppe-reserve = { if (_x isEqualTo _uid) exitWith {1} } forEach _gruppe-reserve; _is-group = { if (_is-gruppe-fuchs == 1) then {Gruppe-Fuchs}; if (_is-gruppe-kobra == 1) then {Gruppe-Kobra}; if (_is-gruppe-baer == 1) then {Gruppe-Bär}; if (_is-gruppe-marder == 1) then {Gruppe-Marder}; if (_is-gruppe-wolf == 1) then {Gruppe-Wolf}; if (_is-gruppe-panther == 1) then {Gruppe-Panther}; if (_is-gruppe-leopard == 1) then {Gruppe-Leopard}; if (_is-gruppe-puma == 1) then {Gruppe-Puma}; if (_is-gruppe-hornisse == 1) then {Gruppe-Hornisse}; if (_is-gruppe-reserve == 1) then {Gruppe-Reserve}; } // setting the correct insignia for the player by (_groupname) switch (_is-group) do //compare the player unique ID against... { case Gruppe-Fuchs: // player is in "Gruppe-Fuchs" { [player,"fuchs"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Kobra: // player is in "Gruppe-Kobra" { [player,"kobra"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Bär: // player is in "Gruppe-Bär" { [player,"baer"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Marder: // player is in "Gruppe-Marder" { [player,"marder"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Wolf: // player is in "Gruppe-Wolf" { [player,"wolf"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Panther: // player is in "Gruppe-Panther" { [player,"panther"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Leopard: // player is in "Gruppe-Leopard" { [player,"leopard"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Puma: // player is in "Gruppe-Puma" { [player,"puma"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Hornisse: // player is in "Gruppe-Hornisse" { [player,"hornisse"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; case Gruppe-Reserve: // player is in "Gruppe-Reserve" { [player,"reserve"] call bis_fnc_setUnitInsignia; // ...give him this insignia if it matches }; default // what to do if no ID matches? { // Nothing! No insignia for you! // optional! if not needed just remove // the next line // hintC "Werde ein Mitglied der 4. JgKp um eine Insignia zu bekommen!"; //..give an annoying message to make them feel bad }; };