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
Mo: 19 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

    Einbruch Nachricht kommt nicht

    • AmaZiinG
    • 11. Juni 2017 um 11:47
    • Geschlossen
    • Erledigt
    • Rom
      Kenner
      Reaktionen
      156
      Beiträge
      533
      • 13. Juni 2017 um 10:26
      • #21
      Code
      private _uid = call compile["%1",(_building getVariable "house_owner")]; // Setzen der Variable _uid

      Der Befehl "compile" benötigt einen String und keinen Array.

      Wenn fehlt hier der "format" Zusatz zu deinem Array, damit daraus ein String wird

      Code
      private _uid = call compile format["%1",(_building getVariable "house_owner")]; // Setzen der Variable _uid

      Aber ist die Eigentümer-Variable eh nicht ein String? Du kannst ja eigentlich nicht mit einer so großen Zahl arbeiten, oder täusche ich mich?

      Wenn ich etwas missverstanden habe, hoppala

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 13. Juni 2017 um 10:55
      • #22

      Eigentlich muss das Array in ein Object umgewandelt werden. Im Zweifelsfall mach einfach noch ein str davor

      Code
      private _uid = call compile format["%1",str(_building getVariable "house_owner")];

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 13. Juni 2017 um 12:42
      • #23

      Ich habe jetzt gemerkt das mein Haus nicht abgespeichert wird.

      Code
      [12:39:58:637064 +02:00] [Thread 3108] extDB3: SQL: Error MariaDBQueryException: Unknown column 'security' in 'field list'
      [12:39:58:637282 +02:00] [Thread 3108] extDB3: SQL: Error MariaDBQueryException: Input: SELECT pid, pos, classname, inventory, gear, dir, id, security FROM containers WHERE pid='76561198111029548' AND owned='1'
      [12:40:21:176210 +02:00] [Thread 1028] extDB3: SQL: Error MariaDBQueryException: Column count doesn't match value count at row 1
      [12:40:21:176417 +02:00] [Thread 1028] extDB3: SQL: Error MariaDBQueryException: Input: INSERT INTO houses (pid, pos, owned, security) VALUES('76561198111029548', '[8393.19,6397.36,-9.53674e-007]', '1')

      Security gehört zum Alarmsystem

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 13. Juni 2017 um 13:02
      • #24

      AmaZiinG na du musst das DB Feld in der DB auch anlegen

      Code
      ALTER TABLE houses ADD security int(5) NOT NULL DEFAULT '0';

      oder

      Code
      ALTER TABLE houses ADD security enum('0','1','2') NOT NULL DEFAULT '0';

      Gruß,

      moeck

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 13. Juni 2017 um 13:19
      • #25

      Ja es ist ja drinnen aber der Fehler kommt immer noch

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 13. Juni 2017 um 13:40
      • #26

      du hast vergessen security zu setzen ^^

      SQL
      INSERT INTO houses (pid, pos, owned, security) VALUES('76561198111029548','[8393.19,6397.36,-9.53674e-007]', '1','1')

      oder halt ohne alarmanlage

      SQL
      INSERT INTO houses (pid, pos, owned, security) VALUES('76561198111029548','[8393.19,6397.36,-9.53674e-007]', '1','0')

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 13. Juni 2017 um 17:29
      • #27

      Wenn jemand mal über das System darüberschauen kann wäre super :thumbup:

      Hier sind noch neue Fehler wo ich leider nicht mehr weiter weiß

      Code
      17:20:09 Error in expression <t localize "STR_ISTR_Box_NotinHouse"};
      
      if(_house getVariable["Secured",false]) >
      17:20:09   Error position: <if(_house getVariable["Secured",false]) >
      17:20:09   Error if: Typ Zahl, erwartet Bool
      17:20:09 File core\housing\fn_houseAlarm.sqf [life_fnc_houseAlarm], line 71
      17:20:25 Error in expression <alize "STR_House_Raid_DoorUnlocked"};
      
      
      if(_building getVariable["Secured",false>
      17:20:25   Error position: <if(_building getVariable["Secured",false>
      17:20:25   Error if: Typ Zahl, erwartet Bool
      17:20:25 File core\items\fn_boltcutter.sqf [life_fnc_boltcutter], line 95
      17:20:30 Generating ST on the fly is very slow
      Alles anzeigen

      Ich schicke jetzt mal alle Dateien die bearbeitet habe.

      Code
      #include "..\..\script_macros.hpp"
      /* 
      ----------------------------------------------|
      Author: Backer
      Edit by AmaZiinG
      Description: Place the Security System in a House!
      ----------------------------------------------|
      */
      private["_house","_uid","_housePos","_houseName"];
      _house = nearestBuilding (getPosATL player);
      _uid = getPlayerUID player;
      _housePos = getPos _house;
      _houseName = getText(configFile >> "CfgVehicles" >> (typeOf _house) >> "displayName");
      if(!(_house in life_vehicles)) exitWith {hint localize "STR_ISTR_Box_NotinHouse"};
      
      if(_house getVariable["Secured",false]) exitWith {hint "Das Haus ist bereits Gesichert";};
      
      if(([false,"housealarm",1] call life_fnc_handleInv)) then {
      _house setVariable["Secured",true,true];
      hint "Sicherheitssystem installiert und aktiviert";
      closeDialog 0;
      [_uid,_house] remoteExec ["TON_fnc_houseAlarm",2];
      
      deleteMarkerLocal format["house_%1",(_house getVariable "uid")];
      
      _marker = createMarkerLocal [format["house_%1",(_house getVariable "uid")],_housePos];
      _marker setMarkerTextLocal format["%1 [alarmgesichert]",_houseName];
      _marker setMarkerColorLocal "ColorBlue";
      _marker setMarkerTypeLocal "loc_Lighthouse"
      
      };
      Alles anzeigen
      Code
      #include "..\..\script_macros.hpp"
      /* 
      ----------------------------------------------|
      Author: Backer
      Description: Turn off the Housealarm and delete the Marker
      ----------------------------------------------|
      */
      private["_building"];
      _building = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
      
      _building setVariable["HouseRob",false,true];
      deleteMarkerLocal "HouseMarker";
      Alles anzeigen
      Code
      /*
          File: fn_initHouses.sqf
          Author: Bryan "Tonic" Boardwine
      
          Description:
          Initializes the players houses, mainly throwing down markers.
      */
      if (life_houses isEqualTo []) exitWith {}; //Nothing to do.
      
      {
          _position = call compile format ["%1",_x select 0];
          _house = nearestObject [_position, "House"];
          _house setVariable ["uid",round(random 99999),true];
          _houseName = getText(configFile >> "CfgVehicles" >> (typeOf _house) >> "displayName");
      
          _marker = createMarkerLocal [format ["house_%1",(_house getVariable "uid")],_position];
          if(_house getVariable["Secured",false]) then {
          _marker setMarkerTextLocal format["%1 [alarmgesichert]",_houseName];
          } else {
          _marker setMarkerTextLocal _houseName;
          };
          _marker setMarkerColorLocal "ColorBlue";
          _marker setMarkerTypeLocal "loc_Lighthouse";
      
      } forEach life_houses;
      Alles anzeigen
      Code
      #include "..\..\script_macros.hpp"
      /*
       File: fn_boltcutter.sqf
       Author: Bryan "Tonic" Boardwine
      
       Description:
       Breaks the lock on a single door (Closet door to the player).
      */
      private ["_building","_door","_doors","_cpRate","_title","_progressBar","_titleText","_cp","_ui"];
      _building = param [0,objNull,[objNull]];
      
      private _vaultHouse = [[["Altis", "Land_Research_house_V1_F"], ["Tanoa", "Land_Medevac_house_V1_F"], ["Jackson_County", "Land_Medevac_house_V1_F"]]] call TON_fnc_terrainSort;
      private _altisArray = [16019.5,16952.9,0];
      private _tanoaArray = [11074.2,11501.5,0.00137329];
      private _Jackson_CountyArray = [11074.2,11501.5,0.00137329];
      private _pos = [[["Altis", _altisArray], ["Tanoa", _tanoaArray], ["Jackson_County", _Jackson_CountyArray]]] call TON_fnc_terrainSort;
      
      if (isNull _building) exitWith {};
      if (!(_building isKindOf "House_F")) exitWith {hint localize "STR_ISTR_Bolt_NotNear";};
      if(isNil {(_building getVariable "house_owner")}) exitWith {hint "Der Besitzer ist gerade nicht auf der Insel"}; //Eigentümer nicht Online
      private _uid = call compile format["%1",(_building getVariable "house_owner")]; // Setzen der Variable _uid
      if (((nearestObject [_pos,"Land_Dome_Big_F"]) == _building || (nearestObject [_pos,_vaultHouse]) == _building) && (west countSide playableUnits < (LIFE_SETTINGS(getNumber,"minimum_cops")))) exitWith {
       hint format [localize "STR_Civ_NotEnoughCops",(LIFE_SETTINGS(getNumber,"minimum_cops"))];
      };
      if ((typeOf _building) == _vaultHouse && (nearestObject [_pos,"Land_Dome_Big_F"]) getVariable ["locked",true]) exitWith {hint localize "STR_ISTR_Bolt_Exploit"};
      if (isNil "life_boltcutter_uses") then {life_boltcutter_uses = 0;};
      
      _doors = FETCH_CONFIG2(getNumber,"CfgVehicles",(typeOf _building),"numberOfDoors");
      _door = 0;
      //Find the nearest door
      for "_i" from 1 to _doors do {
       _selPos = _building selectionPosition format ["Door_%1_trigger",_i];
       _worldSpace = _building modelToWorld _selPos;
       if (player distance _worldSpace < 2) exitWith {_door = _i;};
      };
      if (_door isEqualTo 0) exitWith {hint localize "STR_Cop_NotaDoor"}; //Not near a door to be broken into.
      if ((_building getVariable [format ["bis_disabled_Door_%1",_door],0]) isEqualTo 0) exitWith {hint localize "STR_House_Raid_DoorUnlocked"};
      
      //Alarm System 
      if(_building getVariable["Secured",false]) then {
       if(!(_building getVariable["HouseRob",false])) then {
       _house = getPos _building;
       [_house,name player,1] remoteExec ["TON_fnc_clientMessage",_uid];
       _building setVariable["HouseRob",true,true]; 
       };
      };
      
      if ((nearestObject [_pos,"Land_Dome_Big_F"]) == _building || (nearestObject [_pos,_vaultHouse]) == _building) then {
       [[1,2],"STR_ISTR_Bolt_AlertFed",true,[]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
      } else {
       [0,"STR_ISTR_Bolt_AlertHouse",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
      };
      
      life_action_inUse = true;
      //Setup the progress bar
      disableSerialization;
      _title = localize "STR_ISTR_Bolt_Process";
      "progressBar" cutRsc ["life_progress","PLAIN"];
      _ui = uiNamespace getVariable "life_progress";
      _progressBar = _ui displayCtrl 38201;
      _titleText = _ui displayCtrl 38202;
      _titleText ctrlSetText format ["%2 (1%1)...","%",_title];
      _progressBar progressSetPosition 0.01;
      _cP = 0.01;
      
      switch (typeOf _building) do {
       case "Land_Dome_Big_F": {_cpRate = 0.003;};
       case "Land_Medevac_house_V1_F";
       case "Land_Research_house_V1_F": {_cpRate = 0.0015;};
       default {_cpRate = 0.08;}
      };
      
      for "_i" from 0 to 1 step 0 do {
       if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
       [player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
       player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
       player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
       };
       sleep 0.26;
       if (isNull _ui) then {
       "progressBar" cutRsc ["life_progress","PLAIN"];
       _ui = uiNamespace getVariable "life_progress";
       _progressBar = _ui displayCtrl 38201;
       _titleText = _ui displayCtrl 38202;
       };
       _cP = _cP + _cpRate;
       _progressBar progressSetPosition _cP;
       _titleText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_title];
       if (_cP >= 1 || !alive player) exitWith {};
       if (life_istazed) exitWith {}; //Tazed
       if (life_isknocked) exitWith {}; //Knocked
       if (life_interrupted) exitWith {};
      };
      
      //Kill the UI display and check for various states
      "progressBar" cutText ["","PLAIN"];
      player playActionNow "stop";
      if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
      if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;};
      if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
      life_boltcutter_uses = life_boltcutter_uses + 1;
      life_action_inUse = false;
      
      if (life_boltcutter_uses >= 5) then {
       [false,"boltcutter",1] call life_fnc_handleInv;
       life_boltcutter_uses = 0;
      };
      
      _building setVariable [format ["bis_disabled_Door_%1",_door],0,true]; //Unlock the door.
      _building setVariable ["locked",false,true];
      
      if (life_HC_isActive) then {
       [getPlayerUID player,profileName,"459"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
      } else {
       [getPlayerUID player,profileName,"459"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
      };
      Alles anzeigen

      Life_Server:

      Code
      #include "\life_server\script_macros.hpp"
      /*
          File: fn_addHouse.sqf
          Author: Bryan "Tonic" Boardwine
      
          Description:
          Inserts the players newly bought house in the database.
      */
      private ["_housePos","_query"];
      params [
          ["_uid","",[""]],
          ["_house",objNull,[objNull]]
      ];
      if (isNull _house || _uid isEqualTo "") exitWith {};
      
      _housePos = getPosATL _house;
      
      _query = format ["INSERT INTO houses (pid, pos, owned, security) VALUES('%1', '%2', '1')",_uid,_housePos];
      if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
          diag_log format ["Query: %1",_query];
      };
      
      [_query,1] call DB_fnc_asyncCall;
      
      if (typeOf _house == "Land_FuelStation_Build_F") then {
          _nextBat = nearestObject [_house, "HeliH"];    
           _query = format ["UPDATE fuel_stations SET owner='%2', fuel_super ='27',fuel_benzin='22',fiel_diesel='17', tank ='10000' ,money ='0'
           WHERE batterie='%1'",_nextBat,_uid];
      };
      
      _query = format ["SELECT id FROM houses WHERE pos='%1' AND pid='%2' AND owned='1'",_housePos,_uid];
      _queryResult = [_query,2] call DB_fnc_asyncCall;
      //systemChat format ["House ID assigned: %1",_queryResult select 0];
      _house setVariable ["house_id",(_queryResult select 0),true];
      _house setVariable["Secured",false,true];
      Alles anzeigen
      Code
      #include "\life_server\script_macros.hpp"
      /*
          File : fn_fetchPlayerHouses.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 ["_query","_containers","_containerss","_houses","_furnituress"];
      params [
          ["_uid","",[""]]
      ];
      if (_uid isEqualTo "") exitWith {};
      
      _query = format ["SELECT pid, pos, classname, inventory, gear, dir, id, security FROM containers WHERE pid='%1' AND owned='1'",_uid];
      _containers = [_query,2,true] call DB_fnc_asyncCall;
      
      _containerss = [];
      _furnituress = [];
      {
          _position = call compile format ["%1",_x select 1];
          _house = nearestObject [_position, "House"];
          _direction = call compile format ["%1",_x select 5];
          _trunk = [_x select 3] call DB_fnc_mresToArray;
          if (_trunk isEqualType "") then {_trunk = call compile format ["%1", _trunk];};
          _gear = [_x select 4] call DB_fnc_mresToArray;
          if (_gear isEqualType "") then {_gear = call compile format ["%1", _gear];};
          //furniture and container split
          _className = _x select 2;
          _type = getText(missionConfigFile >> "CfgDonkeyPunchCustoms" >> _className);
          _isFurniture = getNumber(missionConfigFile >> "VirtualItems" >> _type >> "furniture") isEqualTo 1;
          _container = createVehicle[_x select 2,[0,0,999],[],0,"NONE"];
          waitUntil {!isNil "_container" && {!isNull _container}};
          if!(_isFurniture)then{
              _containerss pushBack _container;
          }else{
              _furnituress pushBack _container;
              _container enableSimulationGlobal false;
          };
          _container allowDamage false;
          _container setPosATL _position;
          _container setVectorDirAndUp _direction;
          //Fix position for more accurate positioning
          _posX = _position select 0;
          _posY = _position select 1;
          _posZ = _position select 2;
          _currentPos = getPosATL _container;
          _fixX = (_currentPos select 0) - _posX;
          _fixY = (_currentPos select 1) - _posY;
          _fixZ = (_currentPos select 2) - _posZ;
          _container setPosATL [(_posX - _fixX), (_posY - _fixY), (_posZ - _fixZ)];
          _container setVectorDirAndUp _direction;
          _container setVariable ["Trunk",_trunk,true];
          _container setVariable ["container_owner",[_x select 0],true];
          _container setVariable ["container_id",_x select 6,true];
          clearWeaponCargoGlobal _container;
          clearItemCargoGlobal _container;
          clearMagazineCargoGlobal _container;
          clearBackpackCargoGlobal _container;
          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 {
                  _container addItemCargoGlobal [((_items select 0) select _i), ((_items select 1) select _i)];
              };
              for "_i" from 0 to ((count (_mags select 0)) - 1) do{
                  _container addMagazineCargoGlobal [((_mags select 0) select _i), ((_mags select 1) select _i)];
              };
              for "_i" from 0 to ((count (_weapons select 0)) - 1) do{
                  _container addWeaponCargoGlobal [((_weapons select 0) select _i), ((_weapons select 1) select _i)];
              };
              for "_i" from 0 to ((count (_backpacks select 0)) - 1) do{
                  _container addBackpackCargoGlobal [((_backpacks select 0) select _i), ((_backpacks select 1) select _i)];
              };
          };
          _house setVariable ["containers",_containerss,true];
          _house setVariable["Secured",_x select 4,true];
      } forEach _containers;
      
      _query = format ["SELECT pid, pos FROM houses WHERE pid='%1' AND owned='1'",_uid];
      _houses = [_query,2,true] call DB_fnc_asyncCall;
      
      _return = [];
      {
          _pos = call compile format ["%1",_x select 1];
          _house = nearestObject [_pos, "House"];
          _house allowDamage false;
          _return pushBack [_x select 1,_containerss];
      } forEach _houses;
      
      missionNamespace setVariable [format ["houses_%1",_uid],_return];
      Alles anzeigen
      Code
      #include "\life_server\script_macros.hpp"
      /*
          File: fn_housealarm.sqf
          Edit by AmaZiinG
          
          Description:
          Updated die Datenbank 
      */
      private["_house","_uid","_query","_housePos"];
      _uid = [_this,0,"",[""]] call BIS_fnc_param;
      _house = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
      
      if(isNull _house OR _uid == "") exitWith {hint "Problem bei Update"};
      
      _housePos = getPosATL _house;
      
      _query = format["UPDATE houses SET security='true' WHERE pid='%1' AND pos='%2' AND owned='1'",_uid,_housePos];
      diag_log format["HouseAlarm: %1",_query];
      [_query,1] call DB_fnc_asyncCall;
      Alles anzeigen
      Code
      /*
          File: fn_houseCleanup.sqf
          Author: NiiRoZz
      
          Description:
          Cleans up containers inside in house of player.
      */
      private ["_query","_containers","_container"];
      _query = format ["SELECT pid, pos FROM containers WHERE pid='%1' AND owned='1'",_this];
      
      _containers = [_query,2,true] call DB_fnc_asyncCall;
      
      if (count _containers isEqualTo 0) exitWith {};
      {
          _pos = call compile format ["%1",_x select 1];
          _lifeContainers = getArray(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "LifeContainers");
          _lifeFurniture = getArray(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "BuildableFurniture");
          _lifeContainers = _lifeContainers + _lifeFurniture;
          {
              deleteVehicle _x;
              _house setVariable["Secured",nil,true]; //Ka wo das ihn soll 
          } forEach _container;
      } forEach _containers;
      Alles anzeigen
      Code
      /*
          File: fn_initHouses.sqf
          Author: Bryan "Tonic" Boardwine
          Description:
          Initalizes house setup when player joins the server.
      */
      private ["_queryResult","_query","_count","_blacklistedHouses","_blacklistedGarages"];
      _count = (["SELECT COUNT(*) FROM houses WHERE owned='1'",2] call DB_fnc_asyncCall) select 0;
      
      for [{_x=0},{_x<=_count},{_x=_x+10}] do {
          _query = format ["SELECT houses.id, houses.pid, houses.pos, players.name, houses.garage FROM houses INNER JOIN players WHERE houses.owned='1' AND houses.pid = players.pid LIMIT %1,10",_x];
          _queryResult = [_query,2,true] call DB_fnc_asyncCall;
          if (count _queryResult isEqualTo 0) exitWith {};
          {
              _pos = call compile format ["%1",_x select 2];
              _house = nearestObject [_pos, "House"];
              _house setVariable ["house_owner",[_x select 1,_x select 3],true];
              _house setVariable ["house_id",_x select 0,true];
              _house setVariable["Secured",_x select 4,true];
              _house setVariable ["locked",true,true]; //Lock up all the stuff.
              if (_x select 4 isEqualTo 1) then {
                  _house setVariable ["garageBought",true,true];
              };
              _numOfDoors = getNumber(configFile >> "CfgVehicles" >> (typeOf _house) >> "numberOfDoors");
              for "_i" from 1 to _numOfDoors do {
                  _house setVariable [format ["bis_disabled_Door_%1",_i],1,true];
              };
          } forEach _queryResult;
      };
      
      _blacklistedHouses = "count (getArray (_x >> 'garageBlacklists')) > 0" configClasses (missionconfigFile >> "Housing" >> worldName);
      _blacklistedGarages = "count (getArray (_x >> 'garageBlacklists')) > 0" configClasses (missionconfigFile >> "Garages" >> worldName);
      _blacklistedHouses = _blacklistedHouses apply {configName _x};
      _blacklistedGarages = _blacklistedGarages apply {configName _x};
      
      for "_i" from 0 to count(_blacklistedHouses)-1 do {
          _className = _blacklistedHouses select _i;
          _positions = getArray(missionConfigFile >> "Housing" >> worldName >> _className >> "garageBlacklists");
          {
              _obj = nearestObject [_x,_className];
              if (isNull _obj) then {
                  _obj setVariable ["blacklistedGarage",true,true];
              };
          } forEach _positions;
      };
      
      for "_i" from 0 to count(_blacklistedGarages)-1 do {
          _className = _blacklistedGarages select _i;
          _positions = getArray(missionConfigFile >> "Garages" >> worldName >> _className >> "garageBlacklists");
          {
              _obj = nearestObject [_x,_className];
              if (isNull _obj) then {
                  _obj setVariable ["blacklistedGarage",true,true];
              };
          } forEach _positions;
      };
      Alles anzeigen

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 13. Juni 2017 um 17:48
      • #28

      Moin,

      ich schaue mir das später mal an. Der Fehler der kommt wegen der Prüfung. Da steht eine Zahl drin und nicht true bzw. false. Zeile 16 2. Datei

      Code
      if(_house getVariable["Secured",false]) exitWith {hint "Das Haus ist bereits Gesichert";};

      ändern in

      Code
      if((_house getVariable["Secured",0] isEqualTo 1) exitWith {hint "Das Haus ist bereits Gesichert";};

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 13. Juni 2017 um 17:50
      • #29

      Okay werde ich gleich mal testen danke dir schon mal für dein Support :thumbup:

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 13. Juni 2017 um 17:54
      • #30

      kein Ding, kann aber passieren, dass wir da noch ein bissel was umschreiben müssen ^^ , ansonsten schreibe mir mal eine PN wann du erreichbar bist. Ich denke das sprengt definitiv den Rahmen des Forums. Die Lösung kann man ja dann als TUT hier wieder verpacken.

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 13. Juni 2017 um 18:06
      • #31

      jo :D

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 14. Juni 2017 um 08:58
      • #32

      AmaZiinG bitte das nächste mal in der Beschreibung der Files auch den Namen mit reinpacken. Das macht es einfacher :D. Ach und welchen Datentyp hat das Feld "Security" in der DB?

      Des Weiteren habe ich den Eindruck, dass hier noch so einiges getan werden muss. Ich bin gerade dabei mir jede einzelne Datei durchzuschauen und habe schon ein paar Sachen entdeckt. Hier mal ein oder zwei Beispiele

      C: fn_boltcutter.sqf
      if(_building getVariable["Secured",false]) then {
          if(!(_building getVariable["HouseRob",false])) then {
              _house = getPos _building;
              _msg =format ["Dein Haus an der Position %1 wird gerade von %2 aufgebrochen",_house,name player]; //ToDo edit Stringtable and add a new entry for the house stuff, then change it here
              [_msg,name player,0] remoteExec ["TON_fnc_clientMessage",_uid]; //Changed from 1 to 0. 1 are police messages! Do you really want to send the name of the robber?
              _building setVariable["HouseRob",true,true]; 
          };
      };

      weiteres Beispiel

      C: fn_initHouses.sqf (life_server)
      //added the field security to the statement
      _query = format ["SELECT houses.id, houses.pid, houses.pos, players.name, houses.garage, houses.security FROM houses INNER JOIN players WHERE houses.owned='1' AND houses.pid = players.pid LIMIT %1,10",_x];
      //added the debug stuff
      if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
             diag_log format ["HouseInit: %1",_query];
      };

      in der selben Datei gibt es dann noch die folgende Stelle

      C: fn_initHouses (life_server)
      _house setVariable["Secured",_x select 5,true]; // Changed from 4 to 5 because of the sql query

      Ich werde mal versuchen weiter zu machen allerdings bin ich nur noch heute und morgen anwesend. Danach gehts erstmal in den Urlaub.

      Gruß,

      moeck

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

      Einmal editiert, zuletzt von moeck (14. Juni 2017 um 10:51)

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 14. Juni 2017 um 11:08
      • #33
      Zitat von moeck

      Ach und welchen Datentyp hat das Feld "Security" in der DB?

      Sorry was meinst du genau mit Datentyp ? Wo es hin soll oder wie ?

      Zitat von moeck

      AmaZiinG bitte das nächste mal in der Beschreibung der Files auch den Namen mit reinpacken. Das macht es einfacher :D. Ach und welchen Datentyp hat das Feld "Security" in der DB?

      Des Weiteren habe ich den Eindruck, dass hier noch so einiges getan werden muss. Ich bin gerade dabei mir jede einzelne Datei durchzuschauen und habe schon ein paar Sachen entdeckt. Hier mal ein oder zwei Beispiele

      C: fn_boltcutter.sqf
      if(_building getVariable["Secured",false]) then {
          if(!(_building getVariable["HouseRob",false])) then {
              _house = getPos _building;
              _msg =format ["Dein Haus an der Position %1 wird gerade von %2 aufgebrochen",_house,name player]; //ToDo edit Stringtable and add a new entry for the house stuff, then change it here
              [_msg,name player,0] remoteExec ["TON_fnc_clientMessage",_uid]; //Changed from 1 to 0. 1 are police messages! Do you really want to send the name of the robber?
              _building setVariable["HouseRob",true,true]; 
          };
      };

      weiteres Beispiel

      C: fn_initHouses.sqf (life_server)
      //added the field security to the statement
      _query = format ["SELECT houses.id, houses.pid, houses.pos, players.name, houses.garage, houses.security FROM houses INNER JOIN players WHERE houses.owned='1' AND houses.pid = players.pid LIMIT %1,10",_x];
      //added the debug stuff
      if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
             diag_log format ["HouseInit: %1",_query];
      };

      in der selben Datei gibt es dann noch die folgende Stelle

      C: fn_initHouses (life_server)
      _house setVariable["Secured",_x select 5,true]; // Changed from 4 to 5 because of the sql query

      Ich werde mal versuchen weiter zu machen allerdings bin ich nur noch heute und morgen anwesend. Danach gehts erstmal in den Urlaub.

      Gruß,

      moeck

      Alles anzeigen

      Das Script ist schon ein bisschen älter (3.1.4.8). Ich habe es halt einfach mal mein bestes gegeben das ding zum laufen zu bringen. Leider nur mit wenig erfolg.

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 14. Juni 2017 um 11:28
      • #34

      Moin,

      Zitat von AmaZiinG

      Sorry was meinst du genau mit Datentyp ? Wo es hin soll oder wie ?

      gucke mal bitte in der DB ob das Feld security vom Typ int oder bool ist. Das wäre wichtig. Je nachdem muss man nämlich das Script umschreiben. Ich habe jetzt schon einiges geändert und würde das dann hier mal posten.

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 14. Juni 2017 um 11:37
      • #35

      Also der Standard SQL Eintrag von dem Backer ist Text. Ich hatte in meiner int stehen.

      Hier der originale:

      Code
      ALTER TABLE  `houses` ADD (
      `security` TEXT  NOT NULL
      );
      
      
      /*
      Vergesst nicht eure bissher gekauften Häuser in der Datenbank mit false im security fenster zu Updaten
      */

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 14. Juni 2017 um 12:01
      • #36

      also du nutzt int richtig?

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 14. Juni 2017 um 12:17
      • #37

      so dann wollen wir mal hier mal meine änderungen. ich poste nur die geänderten Dateien

      C: fn_boltcutter.sqf
      #include "..\..\script_macros.hpp"
      /*
       File: fn_boltcutter.sqf
       Author: Bryan "Tonic" Boardwine
      
       Description:
       Breaks the lock on a single door (Closet door to the player).
      */
      private ["_building","_door","_doors","_cpRate","_title","_progressBar","_titleText","_cp","_ui"];
      _building = param [0,objNull,[objNull]];
      
      private _vaultHouse = [[["Altis", "Land_Research_house_V1_F"], ["Tanoa", "Land_Medevac_house_V1_F"], ["Jackson_County", "Land_Medevac_house_V1_F"]]] call TON_fnc_terrainSort;
      private _altisArray = [16019.5,16952.9,0];
      private _tanoaArray = [11074.2,11501.5,0.00137329];
      private _Jackson_CountyArray = [11074.2,11501.5,0.00137329];
      private _pos = [[["Altis", _altisArray], ["Tanoa", _tanoaArray], ["Jackson_County", _Jackson_CountyArray]]] call TON_fnc_terrainSort;
      
      if (isNull _building) exitWith {};
      if (!(_building isKindOf "House_F")) exitWith {hint localize "STR_ISTR_Bolt_NotNear";};
      if(isNil {(_building getVariable "house_owner")}) exitWith {hint "Der Besitzer ist gerade nicht auf der Insel"}; //Eigentümer nicht Online
      private _uid = owner _building; // Setzen der Variable _uid
      if (((nearestObject [_pos,"Land_Dome_Big_F"]) == _building || (nearestObject [_pos,_vaultHouse]) isEqualTo _building) && (west countSide playableUnits < (LIFE_SETTINGS(getNumber,"minimum_cops")))) exitWith {
       hint format [localize "STR_Civ_NotEnoughCops",(LIFE_SETTINGS(getNumber,"minimum_cops"))];
      };
      if ((typeOf _building) == _vaultHouse && (nearestObject [_pos,"Land_Dome_Big_F"]) getVariable ["locked",true]) exitWith {hint localize "STR_ISTR_Bolt_Exploit"};
      if (isNil "life_boltcutter_uses") then {life_boltcutter_uses = 0;};
      
      _doors = FETCH_CONFIG2(getNumber,"CfgVehicles",(typeOf _building),"numberOfDoors");
      _door = 0;
      //Find the nearest door
      for "_i" from 1 to _doors do {
       _selPos = _building selectionPosition format ["Door_%1_trigger",_i];
       _worldSpace = _building modelToWorld _selPos;
       if (player distance _worldSpace < 2) exitWith {_door = _i;};
      };
      if (_door isEqualTo 0) exitWith {hint localize "STR_Cop_NotaDoor"}; //Not near a door to be broken into.
      if ((_building getVariable [format ["bis_disabled_Door_%1",_door],0]) isEqualTo 0) exitWith {hint localize "STR_House_Raid_DoorUnlocked"};
      
      //Alarm System 
      if(_building getVariable["Secured",false]) then {
          if(!(_building getVariable["HouseRob",false])) then {
              _house = getPos _building;
              _msg =format ["Dein Haus an der Position %1 wird gerade von %2 aufgebrochen",_house,name player]; //ToDo edit Stringtable and add a new entry for the house stuff, then change it here
              [_msg,name player,0] remoteExec ["TON_fnc_clientMessage",_uid]; //Changed from 1 to 0. 1 are police messages!
              _building setVariable["HouseRob",true,true]; 
          };
      };
      
      if ((nearestObject [_pos,"Land_Dome_Big_F"]) isEqualTo _building || (nearestObject [_pos,_vaultHouse]) isEqualTo _building) then {
       [[1,2],"STR_ISTR_Bolt_AlertFed",true,[]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
      } else {
       [0,"STR_ISTR_Bolt_AlertHouse",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
      };
      
      life_action_inUse = true;
      //Setup the progress bar
      disableSerialization;
      _title = localize "STR_ISTR_Bolt_Process";
      "progressBar" cutRsc ["life_progress","PLAIN"];
      _ui = uiNamespace getVariable "life_progress";
      _progressBar = _ui displayCtrl 38201;
      _titleText = _ui displayCtrl 38202;
      _titleText ctrlSetText format ["%2 (1%1)...","%",_title];
      _progressBar progressSetPosition 0.01;
      _cP = 0.01;
      
      switch (typeOf _building) do {
       case "Land_Dome_Big_F": {_cpRate = 0.003;};
       case "Land_Medevac_house_V1_F";
       case "Land_Research_house_V1_F": {_cpRate = 0.0015;};
       default {_cpRate = 0.08;}
      };
      
      for "_i" from 0 to 1 step 0 do {
       if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
       [player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
       player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
       player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
       };
       sleep 0.26;
       if (isNull _ui) then {
       "progressBar" cutRsc ["life_progress","PLAIN"];
       _ui = uiNamespace getVariable "life_progress";
       _progressBar = _ui displayCtrl 38201;
       _titleText = _ui displayCtrl 38202;
       };
       _cP = _cP + _cpRate;
       _progressBar progressSetPosition _cP;
       _titleText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_title];
       if (_cP >= 1 || !alive player) exitWith {};
       if (life_istazed) exitWith {}; //Tazed
       if (life_isknocked) exitWith {}; //Knocked
       if (life_interrupted) exitWith {};
      };
      
      //Kill the UI display and check for various states
      "progressBar" cutText ["","PLAIN"];
      player playActionNow "stop";
      if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
      if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;};
      if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
      life_boltcutter_uses = life_boltcutter_uses + 1;
      life_action_inUse = false;
      
      if (life_boltcutter_uses >= 5) then {
       [false,"boltcutter",1] call life_fnc_handleInv;
       life_boltcutter_uses = 0;
      };
      
      _building setVariable [format ["bis_disabled_Door_%1",_door],0,true]; //Unlock the door.
      _building setVariable ["locked",false,true];
      
      if (life_HC_isActive) then {
       [getPlayerUID player,profileName,"459"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
      } else {
       [getPlayerUID player,profileName,"459"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
      };
      Alles anzeigen

      so und nun die Dateien aus dem life_server

      C: fn_addHouse.sqf
      #include "\life_server\script_macros.hpp"
      /*
       File: fn_addHouse.sqf
       Author: Bryan "Tonic" Boardwine
      
       Description:
       Inserts the players newly bought house in the database.
      */
      private ["_housePos","_query"];
      params [
       ["_uid","",[""]],
       ["_house",objNull,[objNull]]
      ];
      if (isNull _house || _uid isEqualTo "") exitWith {};
      
      _housePos = getPosATL _house;
      
      _query = format ["INSERT INTO houses (pid, pos, owned, security) VALUES('%1', '%2', '1','0')",_uid,_housePos]; //zu klären welcher Datentyp in der DB verwendet wird bei bool aus der 0 ein false machen
      if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
       diag_log format ["Query: %1",_query];
      };
      
      [_query,1] call DB_fnc_asyncCall;
      
      if (typeOf _house == "Land_FuelStation_Build_F") then {
       _nextBat = nearestObject [_house, "HeliH"]; 
       _query = format ["UPDATE fuel_stations SET owner='%2', fuel_super ='27',fuel_benzin='22',fiel_diesel='17', tank ='10000' ,money ='0'
       WHERE batterie='%1'",_nextBat,_uid];
      };
      
      _query = format ["SELECT id FROM houses WHERE pos='%1' AND pid='%2' AND owned='1'",_housePos,_uid];
      _queryResult = [_query,2] call DB_fnc_asyncCall;
      //systemChat format ["House ID assigned: %1",_queryResult select 0];
      _house setVariable ["house_id",(_queryResult select 0),true];
      _house setVariable["Secured",false,true];
      Alles anzeigen
      C: fn_fetchPlayerHouses.sqf
      #include "\life_server\script_macros.hpp"
      /*
       File : fn_fetchPlayerHouses.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 ["_query","_containers","_containerss","_houses","_furnituress"];
      params [
       ["_uid","",[""]]
      ];
      if (_uid isEqualTo "") exitWith {};
      
      _query = format ["SELECT pid, pos, classname, inventory, gear, dir, id, security FROM containers WHERE pid='%1' AND owned='1'",_uid];
      _containers = [_query,2,true] call DB_fnc_asyncCall;
      
      _containerss = [];
      _furnituress = [];
      {
       _position = call compile format ["%1",_x select 1];
       _house = nearestObject [_position, "House"];
       _direction = call compile format ["%1",_x select 5];
       _trunk = [_x select 3] call DB_fnc_mresToArray;
       if (_trunk isEqualType "") then {_trunk = call compile format ["%1", _trunk];};
       _gear = [_x select 4] call DB_fnc_mresToArray;
       if (_gear isEqualType "") then {_gear = call compile format ["%1", _gear];};
       //furniture and container split
       _className = _x select 2;
       _type = getText(missionConfigFile >> "CfgDonkeyPunchCustoms" >> _className);
       _isFurniture = getNumber(missionConfigFile >> "VirtualItems" >> _type >> "furniture") isEqualTo 1;
       _container = createVehicle[_x select 2,[0,0,999],[],0,"NONE"];
       waitUntil {!isNil "_container" && {!isNull _container}};
       if!(_isFurniture)then{
       _containerss pushBack _container;
       }else{
       _furnituress pushBack _container;
       _container enableSimulationGlobal false;
       };
       _container allowDamage false;
       _container setPosATL _position;
       _container setVectorDirAndUp _direction;
       //Fix position for more accurate positioning
       _posX = _position select 0;
       _posY = _position select 1;
       _posZ = _position select 2;
       _currentPos = getPosATL _container;
       _fixX = (_currentPos select 0) - _posX;
       _fixY = (_currentPos select 1) - _posY;
       _fixZ = (_currentPos select 2) - _posZ;
       _container setPosATL [(_posX - _fixX), (_posY - _fixY), (_posZ - _fixZ)];
       _container setVectorDirAndUp _direction;
       _container setVariable ["Trunk",_trunk,true];
       _container setVariable ["container_owner",[_x select 0],true];
       _container setVariable ["container_id",_x select 6,true];
       clearWeaponCargoGlobal _container;
       clearItemCargoGlobal _container;
       clearMagazineCargoGlobal _container;
       clearBackpackCargoGlobal _container;
       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 {
       _container addItemCargoGlobal [((_items select 0) select _i), ((_items select 1) select _i)];
       };
       for "_i" from 0 to ((count (_mags select 0)) - 1) do{
       _container addMagazineCargoGlobal [((_mags select 0) select _i), ((_mags select 1) select _i)];
       };
       for "_i" from 0 to ((count (_weapons select 0)) - 1) do{
       _container addWeaponCargoGlobal [((_weapons select 0) select _i), ((_weapons select 1) select _i)];
       };
       for "_i" from 0 to ((count (_backpacks select 0)) - 1) do{
       _container addBackpackCargoGlobal [((_backpacks select 0) select _i), ((_backpacks select 1) select _i)];
       };
       };
       _house setVariable ["containers",_containerss,true];
       _house setVariable["Secured",_x select 4,true];
      } forEach _containers;
      
      _query = format ["SELECT pid, pos FROM houses WHERE pid='%1' AND owned='1'",_uid];
      _houses = [_query,2,true] call DB_fnc_asyncCall;
      
      _return = [];
      {
       _pos = call compile format ["%1",_x select 1];
       _house = nearestObject [_pos, "House"];
       _house allowDamage false;
       _return pushBack [_x select 1,_containerss];
      } forEach _houses;
      
      missionNamespace setVariable [format ["houses_%1",_uid],_return];
      Alles anzeigen
      C: fn_houseAlarm.sqf
      #include "\life_server\script_macros.hpp"
      /*
       File: fn_housealarm.sqf
       Edit by AmaZiinG, moeck (2017-06-14)
       
       Description:
       Updated die Datenbank 
      */
      private["_house","_uid","_query","_housePos"];
      _uid = [_this,0,"",[""]] call BIS_fnc_param;
      _house = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
      
      if(isNull _house OR _uid isEqualTo "") exitWith {hint "Problem bei Update"};
      
      _housePos = getPosATL _house;
      
      _query = format["UPDATE houses SET security='1' WHERE pid='%1' AND pos='%2' AND owned='1'",_uid,_housePos];
      //Added the Debug stuff
      if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
          diag_log format ["HouseAlarm: %1",_query];
      };
      [_query,1] call DB_fnc_asyncCall;
      
      //nothing to do? should be checked!
      Alles anzeigen
      C: fn_housCleanup.sqf
      /*
       File: fn_houseCleanup.sqf
       Author: NiiRoZz
      
       Description:
       Cleans up containers inside in house of player.
      */
      private ["_query","_containers","_container"];
      _query = format ["SELECT pid, pos FROM containers WHERE pid='%1' AND owned='1'",_this];
      
      _containers = [_query,2,true] call DB_fnc_asyncCall;
      
      if (count _containers isEqualTo 0) exitWith {};
      {
       _pos = call compile format ["%1",_x select 1];
       _lifeContainers = getArray(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "LifeContainers");
       _lifeFurniture = getArray(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "BuildableFurniture");
       _lifeContainers = _lifeContainers + _lifeFurniture;
       {
       deleteVehicle _x;
       //_house setVariable["Secured",nil,true]; //Ka wo das ihn soll. Gehört hier nicht rein
       } forEach _container;
      } forEach _containers;
      Alles anzeigen

      und zu guter letzt

      C: fn_initHouses.sqf
      /*
       File: fn_initHouses.sqf
       Author: Bryan "Tonic" Boardwine 
       Modified: moeck 2017-06-14
       Description:
       Initalizes house setup when player joins the server.
      */
      private ["_queryResult","_query","_count","_blacklistedHouses","_blacklistedGarages"];
      _count = (["SELECT COUNT(*) FROM houses WHERE owned='1'",2] call DB_fnc_asyncCall) select 0;
      
      for [{_x=0},{_x<=_count},{_x=_x+10}] do {
          //added the field security to the statement
          _query = format ["SELECT houses.id, houses.pid, houses.pos, players.name, houses.garage, houses.security FROM houses INNER JOIN players WHERE houses.owned='1' AND houses.pid = players.pid LIMIT %1,10",_x];
          //added the debug stuff
          if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
              diag_log format ["HouseInit: %1",_query];
          };
          _queryResult = [_query,2,true] call DB_fnc_asyncCall;
          if (count _queryResult isEqualTo 0) exitWith {};
          {
              _pos = call compile format ["%1",_x select 2];
              _house = nearestObject [_pos, "House"];
              _house setVariable ["house_owner",[_x select 1,_x select 3],true];
              _house setVariable ["house_id",_x select 0,true];
              _house setVariable["Secured",false,true];        // Changed from 4 to 5 because of the sql query
              if ((_x select 5) isEqualTo 1) then { _house setVariable["Secured",true,true];};
              _house setVariable ["locked",true,true]; //Lock up all the stuff.
              if (_x select 4 isEqualTo 1) then {
                  _house setVariable ["garageBought",true,true];
              };
              _numOfDoors = getNumber(configFile >> "CfgVehicles" >> (typeOf _house) >> "numberOfDoors");
              for "_i" from 1 to _numOfDoors do {
                  _house setVariable [format ["bis_disabled_Door_%1",_i],1,true];
              };
          } forEach _queryResult;
      };
      
      _blacklistedHouses = "count (getArray (_x >> 'garageBlacklists')) > 0" configClasses (missionconfigFile >> "Housing" >> worldName);
      _blacklistedGarages = "count (getArray (_x >> 'garageBlacklists')) > 0" configClasses (missionconfigFile >> "Garages" >> worldName);
      _blacklistedHouses = _blacklistedHouses apply {configName _x};
      _blacklistedGarages = _blacklistedGarages apply {configName _x};
      
      for "_i" from 0 to count(_blacklistedHouses)-1 do {
       _className = _blacklistedHouses select _i;
       _positions = getArray(missionConfigFile >> "Housing" >> worldName >> _className >> "garageBlacklists");
       {
       _obj = nearestObject [_x,_className];
       if (isNull _obj) then {
       _obj setVariable ["blacklistedGarage",true,true];
       };
       } forEach _positions;
      };
      
      for "_i" from 0 to count(_blacklistedGarages)-1 do {
       _className = _blacklistedGarages select _i;
       _positions = getArray(missionConfigFile >> "Garages" >> worldName >> _className >> "garageBlacklists");
       {
       _obj = nearestObject [_x,_className];
       if (isNull _obj) then {
       _obj setVariable ["blacklistedGarage",true,true];
       };
       } forEach _positions;
      };
      Alles anzeigen

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 14. Juni 2017 um 12:36
      • #38

      moeck Danke dir werde ich jetzt gleich mal testen

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • AmaZiinG
      Profi
      Reaktionen
      496
      Beiträge
      798
      Dateien
      4
      Bilder
      46
      • 14. Juni 2017 um 12:51
      • #39

      Ich habe 2 Fehler gefunden noch in der houseAlarm.sqf

      Server Log:

      Code
      12:45:15 Error in expression <{hint "Das Haus ist bereits Gesichert";};
      
      
      if(([false,"housealarm",1] call life>
      12:45:15   Error position: <;
      
      
      if(([false,"housealarm",1] call life>
      12:45:15   Error Fehlende )
      12:45:15 File core\housing\fn_houseAlarm.sqf [life_fnc_houseAlarm], line 71
      12:45:15 Error in expression <{hint "Das Haus ist bereits Gesichert";};
      
      
      if(([false,"housealarm",1] call life>
      12:45:15   Error position: <;
      
      
      if(([false,"housealarm",1] call life>
      12:45:15   Error Fehlende )
      12:45:15 File core\housing\fn_houseAlarm.sqf [life_fnc_houseAlarm], line 71
      Alles anzeigen

      Client Log:

      Code
      12:46:11 Error in expression <e getVariable["Secured",0] isEqualTo 1) exitWith {hint "Das Haus ist bereits Ges>
      12:46:11   Error position: <exitWith {hint "Das Haus ist bereits Ges>
      12:46:11   Error exitwith: Typ Bool, erwartet if
      12:46:11 File core\housing\fn_houseAlarm.sqf [life_fnc_houseAlarm], line 71

      Mein Discord:
      https://discord.gg/4UMWmpfDet

    • moeck
      Erleuchteter
      Reaktionen
      632
      Trophäen
      9
      Beiträge
      3.160
      Bilder
      9
      • 14. Juni 2017 um 13:03
      • #40

      ja hatte ich bereits geändert ^^. kommt sofort stimmt hatte ich vergessen zu posten :whistling:

      C: fn_houseAlarm.sqf
      #include "..\..\script_macros.hpp"
      /* 
      ----------------------------------------------|
      Author: Backer
      Edit by AmaZiinG
      Description: Place the Security System in a House!
      ----------------------------------------------|
      */
      private["_house","_uid","_housePos","_houseName"];
      _house = nearestBuilding (getPosATL player);
      _uid = getPlayerUID player;
      _housePos = getPos _house;
      _houseName = getText(configFile >> "CfgVehicles" >> (typeOf _house) >> "displayName");
      if(!(_house in life_vehicles)) exitWith {hint localize "STR_ISTR_Box_NotinHouse"};
      
      if(_house getVariable["Secured",false]) exitWith {hint "Das Haus ist bereits Gesichert";};
      
      if(([false,"housealarm",1] call life_fnc_handleInv)) then {
      _house setVariable["Secured",true,true];
      hint "Sicherheitssystem installiert und aktiviert";
      closeDialog 0;
      [_uid,_house] remoteExec ["TON_fnc_houseAlarm",2];
      
      deleteMarkerLocal format["house_%1",(_house getVariable "uid")];
      
      _marker = createMarkerLocal [format["house_%1",(_house getVariable "uid")],_housePos];
      _marker setMarkerTextLocal format["%1 [alarmgesichert]",_houseName];
      _marker setMarkerColorLocal "ColorBlue";
      _marker setMarkerTypeLocal "loc_Lighthouse"
      
      };
      Alles anzeigen

      bzw. habe ich es auf die orginale version zurückgebaut. kann das hier gerade nicht testen, sondern mir nur anschauen und versuchen keine fehler reinzubauen

      Signatur? Was ist eine Signatur? Kann man das essen?

      Bitte beachten: Ich gebe keinen Support über private Nachrichten!


      Ganz wichtig: [Leitfaden] Wie frage Ich richtig um Hilfe?

      Nicht zu vergessen [Tutorial/Selbst-Test] Sollte ich einen Life Server eröffnen ?

    Registrieren oder Einloggen

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

    Benutzerkonto erstellen

    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™