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
Sa: 17 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

    Car shop Life_RscXListBox

      • Altis Life
    • _Josh_
    • 25. April 2021 um 19:12
    • Erledigt
    • _Josh_
      Schüler
      Trophäen
      8
      Beiträge
      37
      Bilder
      41
      • 25. April 2021 um 19:12
      • #1

      Moin kann mir vielleicht einer helfen oder sagen wie ich das anstatt der item liste einbaue ? https://community.bistudio.com/wikidata/image…_ctXListBox.png das man damit die Autos durchschalten kann

    • Deathman
      Profi
      Reaktionen
      259
      Trophäen
      10
      Beiträge
      676
      Dateien
      12
      Bilder
      106
      • 26. April 2021 um 06:00
      • #2

      https://forums.bohemia.net/forums/topic/1…istbox-working/

      Da geht es um das gleiche Problem ich empfehle dir das erstmal alles auf einer Lokalen Mission zu versuchen weil es erspart dir Server Starten Server Stopen usw.

    • _Josh_
      Schüler
      Trophäen
      8
      Beiträge
      37
      Bilder
      41
      • 26. April 2021 um 17:35
      • #3

      hab das so wie im tutorial gemacht aber sieht jetzt so aus https://gyazo.com/9c9afa72d31962232f52727928f2bd04

    • Basti0208
      Schüler
      Reaktionen
      58
      Trophäen
      10
      Beiträge
      138
      Dateien
      1
      • 26. April 2021 um 17:55
      • #4

      Es ist schön und gut, dass du uns zeigst, wie es aussieht und dass du dem Tutorial gefolgt bist, jedoch bräuchte man auch den Code dazu, damit man sieht, was falsch ist...

      Mit freundlichen Grüßen

      Basti

    • _Josh_
      Schüler
      Trophäen
      8
      Beiträge
      37
      Bilder
      41
      • 26. April 2021 um 18:04
      • #5
      Code
      class Life_Vehicle_Shop_v2_3D {
       idd = 2300;
       name = "life_vehicle_shop";
       movingEnable = 0;
       enableSimulation = 1;
       onLoad = "call life_fnc_3dPreviewInit; ctrlShow [2330,false];";
       onUnLoad = "call life_fnc_3dPreviewExit;";
      class controlsBackground {
       class MainBackground: Life_RscText {
       colorBackground[] = {0,0,0,0.7};
       idc = -1;
       x = 0.0204687 * safezoneW + safezoneX;
       y = 0.06 * safezoneH + safezoneY;
       w = 0.149531 * safezoneW;
       h = 0.638 * safezoneH;
       };
      class SecondBackground: Life_RscText {
       colorBackground[] = {0,0,0,0.7};
       idc = -1;
       x = 0.809375 * safezoneW + safezoneX;
       y = 0.06 * safezoneH + safezoneY;
       w = 0.190781 * safezoneW;
       h = 0.341 * safezoneH;
       };
      class Title: Life_RscTitle {
       idc = 2301;
       text = "";
       x = 0.0204687 * safezoneW + safezoneX;
       y = 0.027 * safezoneH + safezoneY;
       w = 0.144375 * safezoneW;
       h = 0.033 * safezoneH;
       };
      class VehicleTitleBox: Life_RscText {
       idc = -1;
       text = "$STR_GUI_ShopStock";
       colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
       x = 0.0204687 * safezoneW + safezoneX;
       y = 0.06 * safezoneH + safezoneY;
       w = 0.149531 * safezoneW;
       h = 0.033 * safezoneH;
       };
      class VehicleInfoHeader: Life_RscText {
       idc = 2330;
       text = "$STR_GUI_VehInfo";
       colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
       x = 0.809375 * safezoneW + safezoneX;
       y = 0.058 * safezoneH + safezoneY;
       w = 0.190781 * safezoneW;
       h = 0.022 * safezoneH;
       };
      class CloseBtn: Life_RscButtonMenu {
       idc = -1;
       text = "$STR_Global_Close";
       onButtonClick = "closeDialog 0;";
       x = 0.0204687 * safezoneW + safezoneX;
       y = 0.669387 * safezoneH + safezoneY;
       w = 0.0721724 * safezoneW;
       h = 0.0219957 * safezoneH;
       };
      class RentCar: Life_RscButtonMenu {
       idc = -1;
       text = "$STR_Global_RentVeh";
       onButtonClick = "[false] spawn life_fnc_vehicleShopBuy;";
       x = 0.0964687 * safezoneW + safezoneX;
       y = 0.636393 * safezoneH + safezoneY;
       w = 0.0721724 * safezoneW;
       h = 0.0219957 * safezoneH;
       };
      class BuyCar: Life_RscButtonMenu {
       idc = 2309;
       text = "$STR_Global_Buy";
       onButtonClick = "[true] spawn life_fnc_vehicleShopBuy;";
       x = 0.0204687 * safezoneW + safezoneX;
       y = 0.636393 * safezoneH + safezoneY;
       w = 0.0721724 * safezoneW;
       h = 0.0219957 * safezoneH;
       };
       };
      class controls {
       /*
       class VehicleList: Life_RscListBox {
       idc = 2302;
       text = "";
       sizeEx = 0.08; //0.04
       onLBSelChanged = "_this call life_fnc_vehicleShopLBChange";
       x = 0.12 * safezoneW + safezoneX;
       y = 0.17 * safezoneH + safezoneY;
       w = 0.10 * safezoneW;
       h = 0.01 * safezoneH;
       };
       */
       
       class VehicleList: Life_RscXListBox {
       idc = 2302;
       text = "";
       type = CT_XLISTBOX;
       sizeEx = 0.04; //0.04
       onLBSelChanged = "_this call life_fnc_vehicleShopLBChange";
       x = 0.2 * safezoneW + safezoneX;
       y = 0.44 * safezoneH + safezoneY;
       w = 0.575 * safezoneW;
       h = 0.08 * safezoneH;
       };
      class ColorList: Life_RscCombo {
       idc = 2304;
       onLBSelChanged = "call life_fnc_vehicleColor3DRefresh;";
       x = 0.0204687 * safezoneW + safezoneX;
       y = 0.6034 * safezoneH + safezoneY;
       w = 0.149531 * safezoneW;
       h = 0.0219957 * safezoneH;
       };
      class vehicleInfomationList: Life_RscStructuredText {
       idc = 2303;
       text = "";
       sizeEx = 0.035;
       x = 0.819688 * safezoneW + safezoneX;
       y = 0.104 * safezoneH + safezoneY;
       w = 0.175313 * safezoneW;
       h = 0.275 * safezoneH;
       };
       };
      };
      Alles anzeigen

      Codetag Edit durch Barbaro

    • Basti0208
      Schüler
      Reaktionen
      58
      Trophäen
      10
      Beiträge
      138
      Dateien
      1
      • 26. April 2021 um 18:24
      • #6

      Hast du Life_RscXListBox in deiner common.hpp deklariert und existiert CT_XLISTBOX?

      Ich stelle dir einfach mal meinen Code zur Verfügung

      Code
      class Life_RscXListBox
      {
          deletable = 0;
          fade = 0;
          idc = -1;
          type = 42;
          x = 0.1;
          y = 0.1;
          color[] = {0,0,0,1};
          colorActive[] = {0,0,0,1};
          colorDisabled[] = {0,0,0,0.5};
          colorSelect[] = {0,0,0.7,0.8};
          colorText[] = {0,0,0,1};
          soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1};
          colorPicture[] = {0,0,0,1};
          colorPictureSelected[] = {0,0,0,1};
          colorPictureDisabled[] = {0,0,0,0.5};
          colorPictureRight[] = {0,0,0,1};
          colorPictureRightSelected[] = {0,0,0,1};
          colorPictureRightDisabled[] = {0,0,0,0.5};
          tooltipColorText[] = {0,0,0,1};
          tooltipColorBox[] = {0,0,0,1};
          tooltipColorShade[] = {0,0,0,0.65};
          style = 2 + 16 + 1024;
          shadow = 2;
          arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa";
          arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa";
          border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa";
          w = 0.14706;
          h = 0.039216;
          font = "PuristaMedium";
          sizeEx = 0.032;
      };
      Alles anzeigen

      Ich würde dann im Shop bei der Listbox den Type noch entfernen und dann sollte es eigentlich klappen.

      Mit freundlichen Grüßen

      Basti

    • _Josh_
      Schüler
      Trophäen
      8
      Beiträge
      37
      Bilder
      41
      • 26. April 2021 um 19:38
      • #7
      Zitat von Basti0208

      Hast du Life_RscXListBox in deiner common.hpp deklariert und existiert CT_XLISTBOX?

      Ich stelle dir einfach mal meinen Code zur Verfügung

      Code
      class Life_RscXListBox
      {
          deletable = 0;
          fade = 0;
          idc = -1;
          type = 42;
          x = 0.1;
          y = 0.1;
          color[] = {0,0,0,1};
          colorActive[] = {0,0,0,1};
          colorDisabled[] = {0,0,0,0.5};
          colorSelect[] = {0,0,0.7,0.8};
          colorText[] = {0,0,0,1};
          soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1};
          colorPicture[] = {0,0,0,1};
          colorPictureSelected[] = {0,0,0,1};
          colorPictureDisabled[] = {0,0,0,0.5};
          colorPictureRight[] = {0,0,0,1};
          colorPictureRightSelected[] = {0,0,0,1};
          colorPictureRightDisabled[] = {0,0,0,0.5};
          tooltipColorText[] = {0,0,0,1};
          tooltipColorBox[] = {0,0,0,1};
          tooltipColorShade[] = {0,0,0,0.65};
          style = 2 + 16 + 1024;
          shadow = 2;
          arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa";
          arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa";
          border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa";
          w = 0.14706;
          h = 0.039216;
          font = "PuristaMedium";
          sizeEx = 0.032;
      };
      Alles anzeigen

      Ich würde dann im Shop bei der Listbox den Type noch entfernen und dann sollte es eigentlich klappen.

      Perfekt danke dir das hat geklappt nur wenn ich jetzt das Auto auswähle und auf kaufen drücke dann kommt "Du hast kein Fahrzeug ausgewählt" weist du was das sein könnte ?

    • Basti0208
      Schüler
      Reaktionen
      58
      Trophäen
      10
      Beiträge
      138
      Dateien
      1
      • 26. April 2021 um 20:17
      • #8

      Insofern die IDC gleich ist, wüsste ich nicht, woran das liegt. Dafür müsstest du das Kauf-Script und den fertigen Dialog nochmal schicken, dann kann ich nachschauen.

      Mit freundlichen Grüßen

      Basti

    • _Josh_
      Schüler
      Trophäen
      8
      Beiträge
      37
      Bilder
      41
      • 26. April 2021 um 20:28
      • #9

      Das ist die vehicleShop3D.hpp

      Code
      class Life_Vehicle_Shop_v2_3D {
          idd = 2300;
          name = "life_vehicle_shop";
          movingEnable = 0;
          enableSimulation = 1;
          onLoad = "call life_fnc_3dPreviewInit; ctrlShow [2330,false];";
          onUnLoad = "call life_fnc_3dPreviewExit;";
      
          class controlsBackground {
              class MainBackground: Life_RscText {
                  colorBackground[] = {0,0,0,0.7};
                  idc = -1;
                  x = 0.0204687 * safezoneW + safezoneX;
                  y = 0.06 * safezoneH + safezoneY;
                  w = 0.149531 * safezoneW;
                  h = 0.638 * safezoneH;
              };
      
              class SecondBackground: Life_RscText {
                  colorBackground[] = {0,0,0,0.7};
                  idc = -1;
                  x = 0.809375 * safezoneW + safezoneX;
                  y = 0.06 * safezoneH + safezoneY;
                  w = 0.190781 * safezoneW;
                  h = 0.341 * safezoneH;
              };
      
              class Title: Life_RscTitle {
                  idc = 2301;
                  text = "";
                  x = 0.0204687 * safezoneW + safezoneX;
                  y = 0.027 * safezoneH + safezoneY;
                  w = 0.144375 * safezoneW;
                  h = 0.033 * safezoneH;
              };
      
              class VehicleTitleBox: Life_RscText    {
                  idc = -1;
                  text = "$STR_GUI_ShopStock";
                  colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
                  x = 0.0204687 * safezoneW + safezoneX;
                  y = 0.06 * safezoneH + safezoneY;
                  w = 0.149531 * safezoneW;
                  h = 0.033 * safezoneH;
              };
      
              class VehicleInfoHeader: Life_RscText {
                  idc = 2330;
                  text = "$STR_GUI_VehInfo";
                  colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
                  x = 0.809375 * safezoneW + safezoneX;
                  y = 0.058 * safezoneH + safezoneY;
                  w = 0.190781 * safezoneW;
                  h = 0.022 * safezoneH;
              };
      
              class CloseBtn: Life_RscButtonMenu {
                  idc = -1;
                  text = "$STR_Global_Close";
                  onButtonClick = "closeDialog 0;";
                  x = 0.0204687 * safezoneW + safezoneX;
                  y = 0.669387 * safezoneH + safezoneY;
                  w = 0.0721724 * safezoneW;
                  h = 0.0219957 * safezoneH;
              };
      
              class RentCar: Life_RscButtonMenu {
                  idc = -1;
                  text = "$STR_Global_RentVeh";
                  onButtonClick = "[false] spawn life_fnc_vehicleShopBuy;";
                  x = 0.0964687 * safezoneW + safezoneX;
                  y = 0.636393 * safezoneH + safezoneY;
                  w = 0.0721724 * safezoneW;
                  h = 0.0219957 * safezoneH;
              };
      
              class BuyCar: Life_RscButtonMenu {
                  idc = 2309;
                  text = "$STR_Global_Buy";
                  onButtonClick = "[true] spawn life_fnc_vehicleShopBuy;";
                  x = 0.0204687 * safezoneW + safezoneX;
                  y = 0.636393 * safezoneH + safezoneY;
                  w = 0.0721724 * safezoneW;
                  h = 0.0219957 * safezoneH;
              };
          };
      
          class controls {
              /*
              class VehicleList: Life_RscListBox {
                  idc = 2302;
                  text = "";
                  sizeEx = 0.08; //0.04
                  onLBSelChanged = "_this call life_fnc_vehicleShopLBChange";
                  x = 0.12 * safezoneW + safezoneX;
                  y = 0.17 * safezoneH + safezoneY;
                  w = 0.10 * safezoneW;
                  h = 0.01 * safezoneH;
              };
              */
              
              class VehicleList: Life_RscXListBox {
                  idc = 2302;
                  text = "";
                  sizeEx = 0.04; //0.04
                  onLBSelChanged = "_this call life_fnc_vehicleShopLBChange";
                  x = 0.2 * safezoneW + safezoneX;
                  y = 0.44 * safezoneH + safezoneY;
                  w = 0.575 * safezoneW;
                  h = 0.08 * safezoneH;
              };
      
              class ColorList: Life_RscCombo {
                  idc = 2304;
                  onLBSelChanged = "call life_fnc_vehicleColor3DRefresh;";
                  x = 0.0204687 * safezoneW + safezoneX;
                  y = 0.6034 * safezoneH + safezoneY;
                  w = 0.149531 * safezoneW;
                  h = 0.0219957 * safezoneH;
              };
      
              class vehicleInfomationList: Life_RscStructuredText {
                  idc = 2303;
                  text = "";
                  sizeEx = 0.035;
                  x = 0.819688 * safezoneW + safezoneX;
                  y = 0.104 * safezoneH + safezoneY;
                  w = 0.175313 * safezoneW;
                  h = 0.275 * safezoneH;
              };
          };
      };
      Alles anzeigen

      Dann haben wir noch die fn_vehicleShopBuy.sqf

      Code
      #include "..\..\script_macros.hpp"
      /*
          File: fn_vehicleShopBuy.sqf
          Author: Bryan "Tonic" Boardwine
      
          Description:
          Does something with vehicle purchasing.
      */
      
      params [["_mode",true,[true]]];
      
      if ((lbCurSel 2302) isEqualTo -1) exitWith {hint localize "STR_Shop_Veh_DidntPick";closeDialog 0;};
      if ((time - life_action_delay) < 0.2) exitWith {hint localize "STR_NOTF_ActionDelay";};
      life_action_delay = time;
      
      private _className = lbData[2302,(lbCurSel 2302)];
      private _vIndex = lbValue[2302,(lbCurSel 2302)];
      private _vehicleList = M_CONFIG(getArray,"CarShops",(life_veh_shop select 0),"vehicles");
      private _shopSide = M_CONFIG(getText,"CarShops",(life_veh_shop select 0),"side");
      
      
      private _initalPrice = M_CONFIG(getNumber,"LifeCfgVehicles",_className,"price");
      
      private "_buyMultiplier";
      private "_rentMultiplier";
      
      switch (playerSide) do {
          case civilian: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_CIVILIAN");
          };
          case west: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_COP");
          };
          case independent: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_MEDIC");
          };
          case east: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_OPFOR");
          };
      };
      
      private "_purchasePrice";
      
      if (_mode) then {
          _purchasePrice = round(_initalPrice * _buyMultiplier);
      } else {
          _purchasePrice = round(_initalPrice * _rentMultiplier);
      };
      
      private _conditions = M_CONFIG(getText,"LifeCfgVehicles",_className,"conditions");
      
      if !([_conditions] call life_fnc_levelCheck) exitWith {hint localize "STR_Shop_Veh_NoLicense";};
      
      private _colorIndex = lbValue[2304,(lbCurSel 2304)];
      
      if (_purchasePrice < 0) exitWith {closeDialog 0;}; //Bad price entry
      if (CASH < _purchasePrice) exitWith {hint format [localize "STR_Shop_Veh_NotEnough",[_purchasePrice - CASH] call life_fnc_numberText];closeDialog 0;};
      
      private _spawnPoints = life_veh_shop select 1;
      private _spawnPoint = "";
      
      if ((life_veh_shop select 0) == "med_air_hs") then {
          if (nearestObjects[(getMarkerPos _spawnPoints),["Air"],35] isEqualTo []) exitWith {_spawnPoint = _spawnPoints};
      } else {
          //Check if there is multiple spawn points and find a suitable spawnpoint.
          if (_spawnPoints isEqualType []) then {
              //Find an available spawn point.
              {
                  if ((nearestObjects[(getMarkerPos _x),["Car","Ship","Air"],5]) isEqualTo []) exitWith {_spawnPoint = _x};
                  true
              } count _spawnPoints;
          } else {
              if (nearestObjects[(getMarkerPos _spawnPoints),["Car","Ship","Air"],5] isEqualTo []) exitWith {_spawnPoint = _spawnPoints};
          };
      };
      
      
      if (_spawnPoint isEqualTo "") exitWith {hint localize "STR_Shop_Veh_Block"; closeDialog 0;};
      CASH = CASH - _purchasePrice;
      [0] call SOCK_fnc_updatePartial;
      if (_mode) then {
          hint format [localize "STR_Shop_Veh_Bought",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_purchasePrice] call life_fnc_numberText];
      } else {
          hint format [localize "STR_Shop_Veh_Rented",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_purchasePrice] call life_fnc_numberText];
      };
      
      //Spawn the vehicle and prep it.
      
      private "_vehicle";
      
      if ((life_veh_shop select 0) == "med_air_hs") then {
          _vehicle = createVehicle [_className,[0,0,999],[], 0, "NONE"];
          waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait?
          _vehicle allowDamage false;
          _hs = nearestObjects[getMarkerPos _spawnPoint,["Land_Hospital_side2_F"],50] select 0;
          _vehicle setPosATL (_hs modelToWorld [-0.4,-4,12.65]);
          sleep 0.6;
      } else {
          _vehicle = createVehicle [_className, (getMarkerPos _spawnPoint), [], 0, "NONE"];
          waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait?
          _vehicle allowDamage false; //Temp disable damage handling..
          _vehicle setPos (getMarkerPos _spawnPoint);
          _vehicle setVectorUp (surfaceNormal (getMarkerPos _spawnPoint));
          _vehicle setDir (markerDir _spawnPoint);
      };
      
      _vehicle lock 2;
      
      [_vehicle,_colorIndex] call life_fnc_colorVehicle;
      [_vehicle] call life_fnc_clearVehicleAmmo;
      
      _vehicle setVariable ["trunk_in_use",false,true];
      _vehicle setVariable ["vehicle_info_owners",[[getPlayerUID player,profileName]],true];
      
      _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive.
      
      //Side Specific actions.
      switch (playerSide) do {
          case west: {
              [_vehicle,"cop_offroad",true] spawn life_fnc_vehicleAnimate;
          };
          case civilian: {
              if ((life_veh_shop select 2) isEqualTo "civ" && {_className == "B_Heli_Light_01_F"}) then {
                  [_vehicle,"civ_littlebird",true] spawn life_fnc_vehicleAnimate;
              };
          };
          case independent: {
              [_vehicle,"med_offroad",true] spawn life_fnc_vehicleAnimate;
          };
      };
      
      _vehicle allowDamage true;
      
      life_vehicles pushBack _vehicle;
      
      //Always handle key management by the server
      [getPlayerUID player,playerSide,_vehicle,1] remoteExecCall ["TON_fnc_keyManagement",RSERV];
      
      if (_mode) then {
          if !(_className in LIFE_SETTINGS(getArray,"vehicleShop_rentalOnly")) then {
              if (life_HC_isActive) then {
                  [(getPlayerUID player),playerSide,_vehicle,_colorIndex] remoteExecCall ["HC_fnc_vehicleCreate",HC_Life];
              } else {
                  [(getPlayerUID player),playerSide,_vehicle,_colorIndex] remoteExecCall ["TON_fnc_vehicleCreate",RSERV];
              };
          };
      };
      
      if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then {
          if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then {
              advanced_log = format [localize "STR_DL_AL_boughtVehicle_BEF",_className,[_purchasePrice] call life_fnc_numberText,[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText];
          } else {
              advanced_log = format [localize "STR_DL_AL_boughtVehicle",profileName,(getPlayerUID player),_className,[_purchasePrice] call life_fnc_numberText,[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText];
          };
          publicVariableServer "advanced_log";
      };
      
      closeDialog 0; //Exit the menu.
      true;
      Alles anzeigen

      dann noch die fn_vehicleShopLBChange.sqf

      Code
      #include "..\..\script_macros.hpp"
      /*
          File: fn_vehicleShopLBChange.sqf
          Author: Bryan "Tonic" Boardwine
          Modified : NiiRoZz
      
          Description:
          Called when a new selection is made in the list box and
          displays various bits of information about the vehicle.
      */
      disableSerialization;
      private ["_className","_classNameLife","_initalPrice","_buyMultiplier","_rentMultiplier","_vehicleInfo","_colorArray","_ctrl","_trunkSpace","_maxspeed","_horsepower","_passengerseats","_fuel","_armor"];
      
      //Fetch some information.
      _className = (_this select 0) lbData (_this select 1);
      _classNameLife = _className;
      _vIndex = (_this select 0) lbValue (_this select 1);
      
      _initalPrice = M_CONFIG(getNumber,"LifeCfgVehicles",_classNameLife,"price");
      
      switch (playerSide) do {
          case civilian: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_CIVILIAN");
          };
          case west: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_COP");
          };
          case independent: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_MEDIC");
          };
          case east: {
              _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR");
              _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_OPFOR");
          };
      };
      
      _vehicleInfo = [_className] call life_fnc_fetchVehInfo;
      _trunkSpace = [_className] call life_fnc_vehicleWeightCfg;
      _maxspeed = (_vehicleInfo select 8);
      _horsepower = (_vehicleInfo select 11);
      _passengerseats = (_vehicleInfo select 10);
      _fuel = (_vehicleInfo select 12);
      _armor = (_vehicleInfo select 9);
      [_className] call life_fnc_3dPreviewDisplay;
      
      ctrlShow [2330,true];
      (CONTROL(2300,2303)) ctrlSetStructuredText parseText format [
          (localize "STR_Shop_Veh_UI_Rental")+ " <t color='#8cff9b'>$%1</t><br/>" +
          (localize "STR_Shop_Veh_UI_Ownership")+ " <t color='#8cff9b'>$%2</t><br/>" +
          (localize "STR_Shop_Veh_UI_MaxSpeed")+ " %3 km/h<br/>" +
          (localize "STR_Shop_Veh_UI_HPower")+ " %4<br/>" +
          (localize "STR_Shop_Veh_UI_PSeats")+ " %5<br/>" +
          (localize "STR_Shop_Veh_UI_Trunk")+ " %6<br/>" +
          (localize "STR_Shop_Veh_UI_Fuel")+ " %7<br/>" +
          (localize "STR_Shop_Veh_UI_Armor")+ " %8",
          [round(_initalPrice * _rentMultiplier)] call life_fnc_numberText,
          [round(_initalPrice * _buyMultiplier)] call life_fnc_numberText,
          _maxspeed,
          _horsepower,
          _passengerseats,
          if (_trunkSpace isEqualTo -1) then {"None"} else {_trunkSpace},
          _fuel,
          _armor
      ];
      
      _ctrl = CONTROL(2300,2304);
      lbClear _ctrl;
      
      if (!isClass (missionConfigFile >> "LifeCfgVehicles" >> _classNameLife)) then {
          _classNameLife = "Default"; //Use Default class if it doesn't exist
          diag_log format ["%1: LifeCfgVehicles class doesn't exist",_className];
      };
      _colorArray = M_CONFIG(getArray,"LifeCfgVehicles",_classNameLife,"textures");
      
      {
          _flag = (_x select 1);
          _textureName = (_x select 0);
          if ((life_veh_shop select 2) isEqualTo _flag) then {
              _x params ["_texture"];
              private _toShow = [_x] call life_fnc_levelCheck;
              if (_toShow) then {
                  _ctrl lbAdd _textureName;
                  _ctrl lbSetValue [(lbSize _ctrl)-1,_forEachIndex];
              };
          };
      } forEach _colorArray;
      
      _numberindexcolorarray = [];
      for "_i" from 0 to (count(_colorArray) - 1) do {
          _numberindexcolorarray pushBack _i;
      };
      _indexrandom = _numberindexcolorarray call BIS_fnc_selectRandom;
      _ctrl lbSetCurSel _indexrandom;
      
      if (_className in (LIFE_SETTINGS(getArray,"vehicleShop_rentalOnly"))) then {
          ctrlEnable [2309,false];
      } else {
          if (!(life_veh_shop select 3)) then {
              ctrlEnable [2309,true];
          };
      };
      
      if !((lbSize _ctrl)-1 isEqualTo -1) then {
          ctrlShow[2304,true];
      } else {
          ctrlShow[2304,false];
      };
      
      true;
      Alles anzeigen

      und die fn_vehicleShopMenu.sqf

      Code
      #include "..\..\script_macros.hpp"
      /*
          File: fn_vehicleShopMenu.sqf
          Author: Bryan "Tonic" Boardwine
      
          Description:
          Blah
      */
      
      (_this select 3) params [
          ["_shop","",[""]],
          ["_sideCheck",sideUnknown,[civilian]],
          ["_spawnPoints","",["",[]]],
          ["_shopFlag","",[""]],
          ["_shopTitle","",[""]],
          ["_disableBuy",false,[true]]
      ];
      
      disableSerialization;
      
      //Long boring series of checks
      if (dialog) exitWith {};
      if (_shop isEqualTo "") exitWith {};
      if (!(_sideCheck isEqualTo sideUnknown) && {!(playerSide isEqualTo _sideCheck)}) exitWith {hint localize "STR_Shop_Veh_NotAllowed"};
      
      private _conditions = M_CONFIG(getText,"CarShops",_shop,"conditions");
      if !([_conditions] call life_fnc_levelCheck) exitWith {hint localize "STR_Shop_Veh_NotAllowed"};
      
      if (LIFE_SETTINGS(getNumber,"vehicleShop_3D") isEqualTo 1) then {
        createDialog "Life_Vehicle_Shop_v2_3D";
      } else {
        createDialog "Life_Vehicle_Shop_v2";
      };
      
      life_veh_shop = [_shop,_spawnpoints,_shopFlag,_disableBuy]; //Store it so so other parts of the system can access it.
      
      ctrlSetText [2301,_shopTitle];
      
      if (_disableBuy) then {
          //Disable the buy button.
          ctrlEnable [2309,false];
      };
      
      //Fetch the shop config.
      _vehicleList = M_CONFIG(getArray,"CarShops",_shop,"vehicles");
      
      private _control = CONTROL(2300,2302);
      lbClear _control; //Flush the list.
      ctrlShow [2330,false];
      ctrlShow [2304,false];
      
      //Loop through
      {
          _x params["_className"];
      
          private _toShow = [_x] call life_fnc_levelCheck;
      
          if (_toShow) then {
              _vehicleInfo = [_className] call life_fnc_fetchVehInfo;
              _control lbAdd (_vehicleInfo select 3);
              _control lbSetPicture [(lbSize _control)-1,(_vehicleInfo select 2)];
              _control lbSetData [(lbSize _control)-1,_className];
              _control lbSetValue [(lbSize _control)-1,_forEachIndex];
          };
      } forEach _vehicleList;
      
      ((findDisplay 2300) displayCtrl 2302) lbSetCurSel 0;
      Alles anzeigen
    • Basti0208
      Schüler
      Reaktionen
      58
      Trophäen
      10
      Beiträge
      138
      Dateien
      1
      • 26. April 2021 um 22:27
      • #10

      Also ich sehe da direkt erstmal keinen Fehler, also sollte so glaube ich funktionieren

      Mit freundlichen Grüßen

      Basti

    • _Josh_
      Schüler
      Trophäen
      8
      Beiträge
      37
      Bilder
      41
      • 27. April 2021 um 19:45
      • #11

      kann es sein das es daran liegt ? onLBSelChanged = "_this call life_fnc_vehicleShopLBChange";

    • Deathman
      Profi
      Reaktionen
      259
      Trophäen
      10
      Beiträge
      676
      Dateien
      12
      Bilder
      106
      • 27. April 2021 um 20:08
      • #12

      Eigentlich nicht weil das ja dafür da das er das Auto Swicht ich bin mir jetzt aber nicht ganz sicher ob er das Wirklich macht kannst du mal bitte Client Log Hochladen

    • _Josh_
      Schüler
      Trophäen
      8
      Beiträge
      37
      Bilder
      41
      • 27. April 2021 um 21:18
      • #13
      Zitat von Deathman

      Eigentlich nicht weil das ja dafür da das er das Auto Swicht ich bin mir jetzt aber nicht ganz sicher ob er das Wirklich macht kannst du mal bitte Client Log Hochladen

      Hier einmal der client log

      Dateien

      Arma3_x64_2021-04-27_21-13-23.rpt 137,06 kB – 154 Downloads

    Registrieren oder Einloggen

    Du bist noch kein Mitglied von Native-Servers.com? Registriere dich kostenlos und werde Teil einer großartigen Community!

    Benutzerkonto erstellen

    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™