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

    Save food,water and damage

    • SlimRF
    • 28. Oktober 2016 um 15:00
    • Geschlossen
    • Erledigt
    • SlimRF
      Anfänger
      Reaktionen
      7
      Trophäen
      10
      Beiträge
      48
      • 28. Oktober 2016 um 15:00
      • #1

      Hello. Im finding script for save food, water and damage. For 3.1.4.8 or there is a way to convert from 4.5 to 3.1.4.8? Thanks

    • SlimRF
      Anfänger
      Reaktionen
      7
      Trophäen
      10
      Beiträge
      48
      • 28. Oktober 2016 um 15:44
      • #2

      mission files

      CASE WEST

      fn_requestReceived.sqf

      Code
      #include <macro.h>
      /*
      	File: fn_requestReceived.sqf
      	Author: Bryan "Tonic" Boardwine
      	Description:
      	Called by the server saying that we have a response so let's 
      	sort through the information, validate it and if all valid 
      	set the client up.
      */
      life_session_tries = life_session_tries + 1;
      if(life_session_completed) exitWith {}; //Why did this get executed when the client already initialized? Fung arma...
      if(life_session_tries > 3) exitWith {cutText[localize "STR_Session_Error","BLACK FADED"]; 0 cutFadeOut 999999999;};
      
      
      
      
      0 cutText [localize "STR_Session_Received","BLACK FADED"];
      0 cutFadeOut 9999999;
      
      
      
      
      //Error handling and  junk..
      if(isNil "_this") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
      if(typeName _this == "STRING") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
      if(count _this == 0) exitWith {[] call SOCK_fnc_insertPlayerInfo;};
      if((_this select 0) == "Error") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
      if((getPlayerUID player) != _this select 0) exitWith {[] call SOCK_fnc_dataQuery;};
      
      
      
      
      //Lets make sure some vars are not set before hand.. If they are get rid of them, hopefully the engine purges past variables but meh who cares.
      if(!isServer && (!isNil "life_adminlevel" OR !isNil "life_coplevel" OR !isNil "life_donator")) exitWith {
      	[[profileName,getPlayerUID player,"VariablesAlreadySet"],"SPY_fnc_cookieJar",false,false] spawn life_fnc_MP;
      	[[profileName,format["Variables set before client initialization...\nlife_adminlevel: %1\nlife_coplevel: %2\nlife_donator: %3",life_adminlevel,life_coplevel,life_donator]],"SPY_fnc_notifyAdmins",true,false] spawn life_fnc_MP;
      	sleep 0.9;
      	["SpyGlass",false,false] execVM "\a3\functions_f\Misc\fn_endMission.sqf";
      };
      
      
      
      
      //Parse basic player information.
      life_cash = parseNumber (_this select 2);
      life_atmcash = parseNumber (_this select 3);
      __CONST__(life_adminlevel,parseNumber(_this select 4));
      life_donator = parseNumber(_this select 5); //донат
      
      
      
      
      
      
      
      //Loop through licenses
      if(count (_this select 6) > 0) then {
      	{missionNamespace setVariable [(_x select 0),(_x select 1)];} foreach (_this select 6);
      };
      
      
      
      
      life_gear = _this select 8;
      [] call life_fnc_loadGear;
      
      
      
      
      //Parse side specific information.  
      switch(playerSide) do {  
      	case west: {  
      		__CONST__(life_coplevel, parseNumber(_this select 7));  
      		__CONST__(life_medicLevel,0);  
      		life_blacklisted = _this select 10;
      		life_hunger = ((_this select 9) select 0);
      		life_thirst = ((_this select 9) select 1);	
      	};
      
      
      
      
      
      
      
      	case civilian: {  
      		life_is_arrested = _this select 7;  
      		__CONST__(life_coplevel, 0);  
      		__CONST__(life_medicLevel, 0);  
      		life_houses = _this select 9;  
      		{  
      			_house = nearestBuilding (call compile format["%1", _x select 0]);  
      			life_vehicles pushBack _house;  
      		} foreach life_houses;  
      
      
      
      
      		life_gangData = _This select 10;  
      		if(count life_gangData != 0) then {  
      			[] spawn life_fnc_initGang;  
      		};  
      		[] spawn life_fnc_initHouses;  
      	};  
      
      
      
      
      	case independent: {  
      		__CONST__(life_medicLevel, parseNumber(_this select 7));  
      		__CONST__(life_coplevel,0);  
      	};  
      };  
      
      
      
      
      if(count (_this select 12) > 0) then {  
      	{life_vehicles pushBack _x;} foreach (_this select 12);  
      };  
      
      
      
      
      life_session_completed = true;
      Alles anzeigen


      fn_updateRequest.sqf

      Code
      /*  
      	File: fn_updateRequest.sqf  
      	Author: Tonic  
      */  
      private["_packet","_array","_flag"];  
      _packet = [getPlayerUID player,(profileName),playerSide,life_cash,life_atmcash];  
      _array = [];  
      _flag = switch(playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"};};  
      {  
      	if(_x select 1 == _flag) then  
      	{  
      		_array pushBack [_x select 0,(missionNamespace getVariable (_x select 0))];  
      	};  
      } foreach life_licenses;  
      _packet pushBack _array;  
      
      
      
      
      [] call life_fnc_saveGear;  
      _packet pushBack life_gear;
      
      
      
      
      _array = [];
      _array pushBack life_hunger;
      _array pushBack life_thirst;
      _packet pushBack _array;
      switch (playerSide) do {  
      	case civilian: {  
      		_packet pushBack life_is_arrested;   
      	};  
      };  
      
      
      
      
      [_packet,"DB_fnc_updateRequest",false,false] spawn life_fnc_MP;
      Alles anzeigen


      Life_server.pbo

      fn_queryRequest.sqf

      Code
      /*
      	File: fn_queryRequest.sqf
      	Author: Bryan "Tonic" Boardwine
      	Description:
      	Handles the incoming request and sends an asynchronous query 
      	request to the database.
      	Return:
      	ARRAY - If array has 0 elements it should be handled as an error in client-side files.
      	STRING - The request had invalid handles or an unknown error and is logged to the RPT.
      */
      private["_uid","_side","_query","_return","_queryResult","_qResult","_handler","_thread","_tickTime","_loops","_returnCount"];
      _uid = [_this,0,"",[""]] call BIS_fnc_param;
      _side = [_this,1,sideUnknown,[civilian]] call BIS_fnc_param;
      _ownerID = [_this,2,ObjNull,[ObjNull]] call BIS_fnc_param;
      
      
      
      
      if(isNull _ownerID) exitWith {};
      _ownerID = owner _ownerID;
      
      
      
      
      /*
      	_returnCount is the count of entries we are expecting back from the async call.
      	The other part is well the SQL statement.
      */
      _query = switch(_side) do {
      	case west: {_returnCount = 11; format["SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, cop_licenses, coplevel, cop_gear, cop_stats, blacklist FROM players WHERE playerid='%1'",_uid];};
      	//case west: {format ["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime FROM players WHERE playerid='%1'",_uid];};
      	case civilian: {_returnCount = 9; format["SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, civ_licenses, arrested, civ_gear FROM players WHERE playerid='%1'",_uid];};
      	case independent: {_returnCount = 9; format["SELECT playerid, name, cash, bankacc, adminlevel, donatorlvl, med_licenses, mediclevel, med_gear FROM players WHERE playerid='%1'",_uid];};
      };
      
      
      
      
      waitUntil{sleep (random 0.3); !DB_Async_Active};
      _tickTime = diag_tickTime;
      _queryResult = [_query,2] call DB_fnc_asyncCall;
      
      
      
      
      diag_log "------------- Client Query Request -------------";
      diag_log format["QUERY: %1",_query];
      diag_log format["Time to complete: %1 (in seconds)",(diag_tickTime - _tickTime)];
      diag_log format["Result: %1",_queryResult];
      diag_log "------------------------------------------------";
      
      
      
      
      if(typeName _queryResult == "STRING") exitWith {
      	[[],"SOCK_fnc_insertPlayerInfo",_ownerID,false,true] spawn life_fnc_MP;
      };
      
      
      
      
      if(count _queryResult == 0) exitWith {
      	[[],"SOCK_fnc_insertPlayerInfo",_ownerID,false,true] spawn life_fnc_MP;
      };
      
      
      
      
      //Blah conversion thing from a2net->extdb
      private["_tmp"];
      _tmp = _queryResult select 2;
      _queryResult set[2,[_tmp] call DB_fnc_numberSafe];
      _tmp = _queryResult select 3;
      _queryResult set[3,[_tmp] call DB_fnc_numberSafe];
      
      
      
      
      //Parse licenses (Always index 6)
      _new = [(_queryResult select 6)] call DB_fnc_mresToArray;
      if(typeName _new == "STRING") then {_new = call compile format["%1", _new];};
      _queryResult set[6,_new];
      
      
      
      
      //Convert tinyint to boolean
      _old = _queryResult select 6;
      for "_i" from 0 to (count _old)-1 do
      {
      	_data = _old select _i;
      	_old set[_i,[_data select 0, ([_data select 1,1] call DB_fnc_bool)]];
      };
      
      
      
      
      _queryResult set[6,_old];
      
      
      
      
      _new = [(_queryResult select 8)] call DB_fnc_mresToArray;
      if(typeName _new == "STRING") then {_new = call compile format["%1", _new];};
      _queryResult set[8,_new];
      //Parse data for specific side.
      switch (_side) do {
      	case west: {
      		_queryResult set[10,([_queryResult select 10,1] call DB_fnc_bool)];
      	};
      	//Parse Stats
              _new = [(_queryResult select 9)] call DB_fnc_mresToArray;
              if (_new isEqualType "") then {_new = call compile format ["%1", _new];};
              _queryResult set[9,_new];
      	case civilian: {
      		_queryResult set[7,([_queryResult select 7,1] call DB_fnc_bool)];
      		_houseData = _uid spawn TON_fnc_fetchPlayerHouses;
      		waitUntil {scriptDone _houseData};
      		_queryResult pushBack (missionNamespace getVariable[format["houses_%1",_uid],[]]);
      		_gangData = _uid spawn TON_fnc_queryPlayerGang;
      		waitUntil{scriptDone _gangData};
      		_queryResult pushBack (missionNamespace getVariable[format["gang_%1",_uid],[]]);
      	};
      };
      
      
      
      
      _keyArr = missionNamespace getVariable [format["%1_KEYS_%2",_uid,_side],[]];
      _queryResult set[12,_keyArr];
      
      
      
      
      [_queryResult,"SOCK_fnc_requestReceived",_ownerID,false] spawn life_fnc_MP;
      Alles anzeigen


      fn_updateRequest.sqf


      Code
      /*
      	File: fn_updateRequest.sqf
      	Author: Bryan "Tonic" Boardwine
      	Description:
      	Ain't got time to describe it, READ THE FILE NAME!
      */
      private["_uid","_side","_cash","_bank","_licenses","_gear","_name","_query","_thread"];
      _uid = [_this,0,"",[""]] call BIS_fnc_param;
      _name = [_this,1,"",[""]] call BIS_fnc_param;
      _side = [_this,2,sideUnknown,[civilian]] call BIS_fnc_param;
      _cash = [_this,3,0,[0]] call BIS_fnc_param;
      _bank = [_this,4,5000,[0]] call BIS_fnc_param;
      _licenses = [_this,5,[],[[]]] call BIS_fnc_param;
      _gear = [_this,6,[],[[]]] call BIS_fnc_param;
      _stats = [_this,7,[100,100],[[]]] call BIS_fnc_param;
      
      
      
      
      //Get to those error checks.
      if((_uid == "") OR (_name == "")) exitWith {};
      
      
      
      
      //Parse and setup some data.
      _name = [_name] call DB_fnc_mresString;
      _gear = [_gear] call DB_fnc_mresArray;
      _stats = [_stats] call DB_fnc_mresArray;
      _cash = [_cash] call DB_fnc_numberSafe;
      _bank = [_bank] call DB_fnc_numberSafe;
      
      
      
      
      //Does something license related but I can't remember I only know it's important?
      for "_i" from 0 to count(_licenses)-1 do {
      	_bool = [(_licenses select _i) select 1] call DB_fnc_bool;
      	_licenses set[_i,[(_licenses select _i) select 0,_bool]];
      };
      
      
      
      
      _licenses = [_licenses] call DB_fnc_mresArray;
      
      
      
      
      switch (_side) do {
      	case west: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', cop_gear='%4', cop_licenses='%5', cop_stats='%7', WHERE playerid='%6'",_name,_cash,_bank,_gear,_licenses,_uid];};
      	case civilian: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', civ_licenses='%4', civ_gear='%6', arrested='%7' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear,[_this select 7] call DB_fnc_bool];};
      	case independent: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', med_licenses='%4', med_gear='%6' WHERE playerid='%5'",_name,_cash,_bank,_licenses,_uid,_gear];};
      };
      
      
      
      
      waitUntil {sleep (random 0.3); !DB_Async_Active};
      _queryResult = [_query,1] call DB_fnc_asyncCall;
      Alles anzeigen

      LOG

      Code
      16:32:24 "------------------------------------------------------------------------------------------------------"
      16:32:24 "--------------------------------- Starting Altis Life Client Init ----------------------------------"
      16:32:24 "------------------------------------------------------------------------------------------------------"
      16:32:24 "::Life Client:: Initialization Variables"
      16:32:24 "::Life Client:: Variables initialized"
      16:32:24 "::Life Client:: Setting up Eventhandlers"
      16:32:24 "::Life Client:: Eventhandlers completed"
      16:32:24 "::Life Client:: Setting up user actions"
      16:32:24 "::Life Client:: User actions completed"
      16:32:24 "::Life Client:: Waiting for server functions to transfer.."
      16:32:24 "::Life Client:: Emptying all world fuel pumps.."
      16:32:24 "::Life Client:: Emptying all world fuel pumps Done."
      16:32:24 "::Life Client:: Received server functions."
      16:32:24 "::Life Client:: Waiting for the server to be ready.."
      16:32:24  Mission id: a8a34b5709f84d645963254cbf5a46640d4577d2
      16:32:24 Error in expression <lect 9;
      life_hunger = ((_this select 9) select 0);
      life_thirst = ((_this select >
      16:32:24   Error position: <select 0);
      life_thirst = ((_this select >
      16:32:24   Error Общая ошибка в выражении
      16:32:24 File mpmissions\__CUR_MP.Altis\core\session\fn_requestReceived.sqf, line 54
      Alles anzeigen
    • SlimRF
      Anfänger
      Reaktionen
      7
      Trophäen
      10
      Beiträge
      48
      • 28. Oktober 2016 um 18:31
      • #3

      I did it. But when I eat no added value

    • SlimRF
      Anfänger
      Reaktionen
      7
      Trophäen
      10
      Beiträge
      48
      • 4. November 2016 um 11:18
      • #4

      ok everything works

    Registrieren oder Einloggen

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

    Registrieren

    Ähnliche Themen

    • Waffen speichern nicht

      • MrRetroxX
      • 16. April 2017 um 11:39
      • Hilfeforum
    • I-Inventar wird nicht gespeichert

      • Nickel Komet
      • 4. März 2017 um 14:43
      • Hilfeforum
    • Items Am Markt V.4.4 R4

      • Natic
      • 28. Januar 2017 um 22:03
      • Hilfeforum
    • Spieler spawnen auch nach dem Restart noch an der Normalen Postion

      • Flintbeker
      • 30. Dezember 2016 um 23:11
      • Hilfeforum
    • Hauspreis

      • Roy Hawk
      • 6. Oktober 2016 um 19:35
      • Hilfeforum

    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™