1. Dashboard
  2. Forum
    1. Unerledigte Themen
  3. Downloads
  4. Galerie
    1. Alben
  5. Toolbox
    1. Passwort Generator
    2. Portchecker
  6. Mitglieder
    1. Mitgliedersuche
    2. Benutzer online
    3. Trophäen
    4. Team
Mi: 21 Mai 2025
  • Anmelden oder registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Forum
  • Dateien
  • Seiten
  • Bilder
  • Erweiterte Suche

Schön, dass du den Weg zu NodeZone.net gefunden hast! Aktuell bist du nicht angemeldet und kannst deshalb nur eingeschränkt auf unsere Community zugreifen. Um alle Funktionen freizuschalten, spannende Inhalte zu entdecken und dich aktiv einzubringen, registriere dich jetzt kostenlos oder melde dich mit deinem Account an.

Anmelden oder registrieren
    1. Nodezone.net Community
    2. Forum
    3. Gameserver & Hosting
    4. ArmA Series - ArmA 3 / Reforger
    5. Hilfeforum

    Gang Container Problem

      • Altis Life
    • Frenzy
    • 17. August 2022 um 14:06
    • Erledigt
    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 17. August 2022 um 14:06
      • #1

      I added a container to the gang zone to store weapons and gear. And I made this container available only as a gang member. So far everything is working fine. However, when I put equipment in it, the equipment disappears and is deleted after restarting the server. Is there a solution for this?

      Or what script should I check?

      Thanks for help.

    • Abgaswert
      Frischling
      Trophäen
      7
      Beiträge
      16
      • 17. August 2022 um 15:15
      • #2

      The equipment is stored temporarly on the server. If you want the contents of any container to remain even after restarting the server, you have to save the inventory in a database. I'd recommend you to just create a new table and work with it in the "init" file of the @life_server server mod or the mission itself.

      Another thing to call to mind: if you spawn the container with a script that is executed when a player is nearby or when the server starts, you can interact with the database from there with remoteExec. You can then add an EventHandler onto the container that's executed as soon as the inventory of the contrainer is closed. WIthin this EventHandler you can again interact with the database to store all the contents of the container.

      I hope, I was able to help!

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 17. August 2022 um 16:36
      • #3
      Zitat von Abgaswert

      The equipment is stored temporarly on the server. If you want the contents of any container to remain even after restarting the server, you have to save the inventory in a database. I'd recommend you to just create a new table and work with it in the "init" file of the @life_server server mod or the mission itself.

      Another thing to call to mind: if you spawn the container with a script that is executed when a player is nearby or when the server starts, you can interact with the database from there with remoteExec. You can then add an EventHandler onto the container that's executed as soon as the inventory of the contrainer is closed. WIthin this EventHandler you can again interact with the database to store all the contents of the container.

      I hope, I was able to help!

      Can you show as an example?

      Dateien

      fn_fetchPlayerGangCont.sqf 2,06 kB – 49 Downloads fn_updateGangContainers.sqf 905 Byte – 66 Downloads fn_updateGangTrunk.sqf 698 Byte – 57 Downloads
    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 17. August 2022 um 17:28
      • #4

      These are my scripts.

      Code
      #include "\life_server\script_macros.hpp"
      /*
          File : fn_fetchPlayerGangCont.sqf
          Author: Bryan "Tonic" Boardwine
          Modified : NiiRoZz
      
          Description:
          1. Fetches all the players houses and sets them up.
          2. Fetches all the players containers and sets them up.
      
      */
      private _containerss = [con_b,con_d,con_a,con_e,con_h];
      
      {
          _query = format ["SELECT inventory, gear FROM gangcontainers WHERE id='%1'",_forEachIndex + 1];
          _containers = [_query,2,true] call DB_fnc_asyncCall;
          diag_log format ["gangs containers loded:: %1", _containers];
          diag_log format ["gangs containers loded:: %1", _x];
          
          _trunk = [(_containers select 0) select 0] call DB_fnc_mresToArray;
          if (_trunk isEqualType "") then {_trunk = call compile format ["%1", _trunk];};
          _gear = [(_containers select 0) select 1] call DB_fnc_mresToArray;
          if (_gear isEqualType "") then {_gear = call compile format ["%1", _gear];};
          
          _x setVariable ["Trunk",_trunk,true];
          
          clearWeaponCargoGlobal _x;
          clearItemCargoGlobal _x;
          clearMagazineCargoGlobal _x;
          clearBackpackCargoGlobal _x;
          
          if (count _gear > 0) then {
              _items = _gear select 0;
              _mags = _gear select 1;
              _weapons = _gear select 2;
              _backpacks = _gear select 3;
              for "_i" from 0 to ((count (_items select 0)) - 1) do {
                  _x addItemCargoGlobal [((_items select 0) select _i), ((_items select 1) select _i)];
              };
              for "_i" from 0 to ((count (_mags select 0)) - 1) do{
                  _x addMagazineCargoGlobal [((_mags select 0) select _i), ((_mags select 1) select _i)];
              };
              for "_i" from 0 to ((count (_weapons select 0)) - 1) do{
                  _x addWeaponCargoGlobal [((_weapons select 0) select _i), ((_weapons select 1) select _i)];
              };
              for "_i" from 0 to ((count (_backpacks select 0)) - 1) do {
                  _x addBackpackCargoGlobal [((_backpacks select 0) select _i), ((_backpacks select 1) select _i)];
              };
          };
      } forEach _containerss;
      Alles anzeigen
      Code
      /*
          File : fn_updateGangContainers.sqf
          Author: NiiRoZz
      
          Description:
          Update inventory "i" in container
      */
      private _container = [_this,0,objNull,[objNull]] call BIS_fnc_param;
      if (isNull _container) exitWith {};
      private _containerID = switch (_container) do {
          case con_b: {1};
          case con_d: {2};
          case con_a: {3};
          case con_e: {4};
          case con_h: {5};
          default {-1};
      };
      if (_containerID isEqualTo -1) exitWith {};
      
      
      private _vehItems = getItemCargo _container;
      private _vehMags = getMagazineCargo _container;
      private _vehWeapons = getWeaponCargo _container;
      private _vehBackpacks = getBackpackCargo _container;
      private _cargo = [_vehItems,_vehMags,_vehWeapons,_vehBackpacks];
      
      _cargo = [_cargo] call DB_fnc_mresArray;
      
      private _query = format ["UPDATE gangcontainers SET gear='%1' WHERE id='%2'",_cargo,_containerID];
      
      [_query,1] call DB_fnc_asyncCall;
      Alles anzeigen
      Code
      /*
          File : fn_updateGangTrunk.sqf
          Author: NiiRoZz
      
          Description:
          Update inventory "y" in container
      */
      _container = [_this,0,objNull,[objNull]] call BIS_fnc_param;
      if (isNull _container) exitWith {};
      
      _trunkData = _container getVariable ["Trunk",[[],0]];
      private _containerID = switch (_container) do {
          case con_b: {1};
          case con_d: {2};
          case con_a: {3};
          case con_e: {4};
          case con_h: {5};
          default {-1};
      };
      
      if (_containerID isEqualTo -1) exitWith {}; //Dafuq?
      
      _trunkData = [_trunkData] call DB_fnc_mresArray;
      _query = format ["UPDATE gangcontainers SET inventory='%1' WHERE id='%2'",_trunkData,_containerID];
      
      [_query,1] call DB_fnc_asyncCall;
      Alles anzeigen

      Bilder

      • 20220817182425_1.jpg
        • 164,45 kB
        • 1.366 × 768
        • 123
    • Abgaswert
      Frischling
      Trophäen
      7
      Beiträge
      16
      • 18. August 2022 um 22:49
      • #5

      Sorry for my late response, but please ensure you have setup the database table as required. You MUST have a table called "gangcontainers" in order for those scripts to work. The rest of the files look fine to me.

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 20. August 2022 um 00:18
      • #6
      Zitat von Abgaswert

      Sorry for my late response, but please ensure you have setup the database table as required. You MUST have a table called "gangcontainers" in order for those scripts to work. The rest of the files look fine to me.

      I have the following codes in my database.

      Code
      --
      -- Tablo için tablo yapısı `gangcontainers`
      --
      
      CREATE TABLE `gangcontainers` (
        `id` int(6) NOT NULL,
        `classname` varchar(32) NOT NULL,
        `pos` varchar(64) DEFAULT NULL,
        `inventory` text NOT NULL,
        `gear` text NOT NULL,
        `dir` varchar(128) DEFAULT NULL,
        `active` tinyint(1) NOT NULL DEFAULT 0,
        `owned` tinyint(1) DEFAULT 0,
        `insert_time` timestamp NOT NULL DEFAULT current_timestamp()
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
      
      
      --
      -- Tablo için indeksler `gangcontainers`
      --
      ALTER TABLE `gangcontainers`
        ADD PRIMARY KEY (`id`);
        
        
      --
      -- Tablo için AUTO_INCREMENT değeri `gangcontainers`
      --
      ALTER TABLE `gangcontainers`
        MODIFY `id` int(6) NOT NULL AUTO_INCREMENT;
      Alles anzeigen
    • Abgaswert
      Frischling
      Trophäen
      7
      Beiträge
      16
      • 20. August 2022 um 13:00
      • #7

      Have you got any errors in the log files? Especially extDB and .rpt logs

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 20. August 2022 um 20:39
      • #8
      Zitat von Abgaswert

      Have you got any errors in the log files? Especially extDB and .rpt logs

      I am sharing my log files.

      Code
      extDB3: https://bitbucket.org/torndeco/extdb3/wiki/Home
      extDB3: Version: 1.032
      extDB3: Windows Version
      Message: All development for extDB3 is done on a Linux Dedicated Server
      Message: If you would like to Donate to extDB3 Development
      Message: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2SUEFTGABTAM2
      Message: Also leave a message if there is any particular feature you would like to see added.
      Message: Thanks for all the people that have donated.
      Message: Torndeco: 18/05/15
      
      
      extDB3: Found extdb3-conf.ini
      extDB3: Detected 8 Cores, Setting up 6 Worker Threads
      extDB3: ...
      extDB3: ...
      extDB3: ...
      extDB3: ...
      extDB3: ...
      extDB3: ...
      
      
      [02:57:08:139096 +03:00] [Thread 21252] extDB3: SQL: Initialized: Add Quotes around TEXT Datatypes mode: 2
      [02:57:08:139438 +03:00] [Thread 21252] extDB3: SQL: Initialized: NULL = ""
      [02:57:08:139517 +03:00] [Thread 21252] extDB3: Locked
      Alles anzeigen

      Dateien

      arma3server_x64_2022-08-21_02-55-59.rpt 68,2 kB – 84 Downloads

      Einmal editiert, zuletzt von Frenzy (21. August 2022 um 02:00)

    • Abgaswert
      Frischling
      Trophäen
      7
      Beiträge
      16
      • 21. August 2022 um 14:20
      • #9

      Your extDB3 is working fine. The problem has to be found in your life_server mod. Looking through your .rpt log, I can read, that your containers (con_a, con_b, ...) cannot be found. Usually this means that there are no containers in your mission.sqm file. Please make sure you got a correct mission file loaded.

      You could also try to change your startup parameters. You're running @life_server and @extDB3 as a -mod. Try to run them as a -servermod.

      Since it can't find your containers, you could also try to give those containers as a parameter to the script. This would mean, that you'd have to change the line

      private _containerss = [con_b,con_d,con_a,con_e,con_h];

      ans instead use something like

      private _containerss = _this;

      Using the magic variable _this means you'd have to change the script that calls the fetchGangCont script. Instead of

      call TON_fnc_fetchGangCont;

      you would need

      [con_b, con_d, con_a, con_e, con_h] call TON_fnc_fetchGangCont;

      This should do the trick.

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 23. August 2022 um 00:26
      • #10
      Zitat von Abgaswert

      Your extDB3 is working fine. The problem has to be found in your life_server mod. Looking through your .rpt log, I can read, that your containers (con_a, con_b, ...) cannot be found. Usually this means that there are no containers in your mission.sqm file. Please make sure you got a correct mission file loaded.

      You could also try to change your startup parameters. You're running @life_server and @extDB3 as a -mod. Try to run them as a -servermod.

      Since it can't find your containers, you could also try to give those containers as a parameter to the script. This would mean, that you'd have to change the line

      private _containerss = [con_b,con_d,con_a,con_e,con_h];

      ans instead use something like

      private _containerss = _this;

      Using the magic variable _this means you'd have to change the script that calls the fetchGangCont script. Instead of

      call TON_fnc_fetchGangCont;

      you would need

      [con_b, con_d, con_a, con_e, con_h] call TON_fnc_fetchGangCont;

      This should do the trick.

      Alles anzeigen

      I am unhappy. No matter what I do I still can't fix the problem. Can you edit the file if I send it to you?

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 30. Oktober 2022 um 09:09
      • #11

      No matter what I did. When I put weapons or gear in the container it is deleted after the server restarts.

      Although I have gang containers in my database, they are deleted when I put Weapons and Equipment in the containers. And it doesn't register in the database.

      I would be glad if you help. I've been trying for weeks but it's not working.

    Registrieren oder Einloggen

    Du bist noch kein Mitglied von NodeZone.net? Registriere dich kostenlos und werde Teil einer großartigen Community!

    Registrieren

    Benutzer online in diesem Thema

    • 1 Besucher

    Wichtige Links & Informationen

    Server & Hosting-Ressourcen

      Server Administration & Hosting Basics

      Windows Server Support & Guides

      Linux Server Configuration & Help

      Setting up TeamSpeak 3 & VoIP Servers

      Domains & Web Hosting for Beginners & Professionals

      Cloud Hosting, Docker & Kubernetes Tutorials

    Gameserver & Modding-Ressourcen

      ArmA 3 Tutorials & Script Collection

      Renting & Operating Gameservers

      DayZ Server Management & Help

      FiveM (GTA V) Server & Script Development

      Rust Server Modding & Administration

      Setting up & Optimizing ARK Survival Servers

    NodeZone.net – Deine Community für Gameserver, Server-Hosting & Modding

      NodeZone.net ist dein Forum für Gameserver-Hosting, Rootserver, vServer, Webhosting und Modding. Seit 2015 bietet unsere Community eine zentrale Anlaufstelle für Server-Admins, Gamer und Technikbegeisterte, die sich über Server-Management, Hosting-Lösungen und Spielemodding austauschen möchten.


      Ob Anleitungen für eigene Gameserver, Hilfe bei Root- und vServer-Konfigurationen oder Tipps zu Modding & Scripting – bei uns findest du fundiertes Wissen und praxisnahe Tutorials. Mit einer stetig wachsenden Community findest du hier Antworten auf deine Fragen, Projektpartner und Gleichgesinnte für deine Gaming- und Serverprojekte. Schließe dich NodeZone.net an und werde Teil einer aktiven Community rund um Server-Hosting, Gameserver-Management und Modding-Ressourcen.

    Wer jetzt nicht teilt ist selber Schuld:
    1. Nutzungsbestimmungen
    2. Datenschutzerklärung
    3. Impressum
    4. Urheberrechts- oder Lizenzverstoß melden
  • Trimax Design coded & layout by Gino Zantarelli 2023-2025©
    Community-Software: WoltLab Suite™