Jump to content

Grenadier ITF

Member
  • Content Count

    32
  • Joined

  • Last visited

  • Medals

Posts posted by Grenadier ITF


  1. Just now, Grenadier ITF said:

    I created a simple test.
    locally it works, but on the server it works to halfway
    loading climate, time and player data.
    The former are invoked in an initserver.sqf file and it works,
    the seconds, player data, are not loaded.
    Where am I wrong?

    initserver.sqf

      Reveal hidden contents

    call compile preprocessFileLineNumbers "oo_extdb3.sqf";

     

        sleep 2;

     

            //SQL CLASSIC QUERY

     

            private _extdb3 = "new" call OO_EXTDB3;

            ["setIniSectionDatabase", "itf_database"] call _extdb3;

            ["setDatabaseName", "extdb3"] call _extdb3;

            ["setQueryType", "SQL"] call _extdb3;

            _result = "connect" call _extdb3;

            private _query_data = "SELECT * FROM condizioni";

     

            _result = ["executeQuery", _query_data] call _extdb3;

     

    if (_result isequalto [])then {

     

            private _query_data = "INSERT INTO condizioni (data, clima) VALUES" + format ["('%1', '%2')",date, overcast];

            _result = ["executeQuery", _query_data] call _extdb3;

     

    }else{

     

            _data       = call compile (_result select 0 select 1);

            _clima      =  (_result select 0 select 2);

     

            [_data] remoteExec ["setDate"];

            [[], {setDate _data}] remoteExec ["call",0,"JIP_id_setDate"];

            //setDate _date;                        // data e ora

            0 setOvercast _clima; 

            forceWeatherChange;

     

    };

     

    [[], "initplayer.sqf"] remoteExec ["BIS_fnc_execVM",0,true];  // call data player


    initplayer.sqf
     

      Reveal hidden contents

    if (! hasInterface ) exitWith {}; 
     

    _UID        = getPlayerUID player;

     

            private _extdb3 = "new" call OO_EXTDB3;

            ["setIniSectionDatabase", "itf_database"] call _extdb3;

            ["setDatabaseName", "extdb3"] call _extdb3;

            ["setQueryType", "SQL"] call _extdb3;

            _result = "connect" call _extdb3;

            private _query = "SELECT * FROM players WHERE clientID =" + format ["'%1'",_UID];

     

            _result = ["executeQuery", _query] call _extdb3;

     

    _pos        = call compile (_result select 0 select 3);

    _uncons     = call compile (_result select 0 select 4);

    _inventory  = (_result select 0 select 5);

    _bullet_1   = call compile (_result select 0 select 6);

    _bullet_2   = call compile (_result select 0 select 7);

    _bullet_3   = call compile (_result select 0 select 8);

     

            player setPosATL _pos;

     

    removeAllWeapons        player;

    removeAllItems          player;

    removeAllAssignedItems  player;

    removeUniform           player;

    removeVest              player;

    removeBackpack          player;

    removeHeadgear          player;

    removeGoggles           player;

     

    player setUnitLoadout   _inventory;     

    player setAmmo [primaryWeapon player, _bullet_1];

    player setAmmo [secondaryWeapon player, _bullet_2];

    player setAmmo [handgunWeapon player, _bullet_3];

     

    _damageVar = call compile (_result select 0 select 9);

     

     

    • Thanks 1

  2. I created a simple test.
    loading climate, time and player data.
    The former are invoked in an initserver.sqf file and it works,
    the seconds, player data, are not loaded.
    Where am I wrong?

    initserver.sqf

    Spoiler

    call compile preprocessFileLineNumbers "oo_extdb3.sqf";

     

        sleep 2;

     

            //SQL CLASSIC QUERY

     

            private _extdb3 = "new" call OO_EXTDB3;

            ["setIniSectionDatabase", "itf_database"] call _extdb3;

            ["setDatabaseName", "extdb3"] call _extdb3;

            ["setQueryType", "SQL"] call _extdb3;

            _result = "connect" call _extdb3;

            private _query_data = "SELECT * FROM condizioni";

     

            _result = ["executeQuery", _query_data] call _extdb3;

     

    if (_result isequalto [])then {

     

            private _query_data = "INSERT INTO condizioni (data, clima) VALUES" + format ["('%1', '%2')",date, overcast];

            _result = ["executeQuery", _query_data] call _extdb3;

     

    }else{

     

            _data       = call compile (_result select 0 select 1);

            _clima      =  (_result select 0 select 2);

     

            [_data] remoteExec ["setDate"];

            [[], {setDate _data}] remoteExec ["call",0,"JIP_id_setDate"];

            //setDate _date;                        // data e ora

            0 setOvercast _clima; 

            forceWeatherChange;

     

    };

     

    [[], "initplayer.sqf"] remoteExec ["BIS_fnc_execVM",0,true];  // call data player


    initplayer.sqf
     

    Spoiler

    if (! hasInterface ) exitWith {}; 
     

    _UID        = getPlayerUID player;

     

            private _extdb3 = "new" call OO_EXTDB3;

            ["setIniSectionDatabase", "itf_database"] call _extdb3;

            ["setDatabaseName", "extdb3"] call _extdb3;

            ["setQueryType", "SQL"] call _extdb3;

            _result = "connect" call _extdb3;

            private _query = "SELECT * FROM players WHERE clientID =" + format ["'%1'",_UID];

     

            _result = ["executeQuery", _query] call _extdb3;

     

    _pos        = call compile (_result select 0 select 3);

    _uncons     = call compile (_result select 0 select 4);

    _inventory  = (_result select 0 select 5);

    _bullet_1   = call compile (_result select 0 select 6);

    _bullet_2   = call compile (_result select 0 select 7);

    _bullet_3   = call compile (_result select 0 select 8);

     

            player setPosATL _pos;

     

    removeAllWeapons        player;

    removeAllItems          player;

    removeAllAssignedItems  player;

    removeUniform           player;

    removeVest              player;

    removeBackpack          player;

    removeHeadgear          player;

    removeGoggles           player;

     

    player setUnitLoadout   _inventory;     

    player setAmmo [primaryWeapon player, _bullet_1];

    player setAmmo [secondaryWeapon player, _bullet_2];

    player setAmmo [handgunWeapon player, _bullet_3];

     

    _damageVar = call compile (_result select 0 select 9);

     


  3. tried but there is an error

    waitUntil{!(missionNamespace getVariable "BIS_fnc_eventTimeline_playing")};

    then at the end of the presentation endMission "END1";
    the mission ends, not the presentation.


    If I remove last code, the screen remains black and it is not possible to change it with fade.

    if I touch a button, the message appears, hold it down to continue.

    how to solve these 3 problems?

    Thanks


  4. Resolved. thank you guys

    _target = _this select 0;

    missionNamespace setVariable ["YourString",_target];

       

       _id=(findDisplay 46) displayAddEventHandler ["KeyDown", 

       

       "if(_this select 1==22)then {
           _target = missionNamespace getVariable 'YourString';

           _nul =[_target] execVM 'koc.sqf'};"];

    DONE!


  5. 16 minutes ago, Larrow said:

    Or store _target on the display using setVariable, then retrieve it from the display inside the EH. Rather than using a global variable.

      Hide contents
    
    
    _target = _this select 0;
    findDisplay 46 setVariable[ "TAG_target", _target ];ÔĽŅ
    
    _id = findDisplay 46 displayAddEventHandler[ "KeyDown", {
    	params[ "_display", "_keyCode", "_shft", "_ctr", "_alt" ];ÔĽŅÔĽŅÔĽŅÔĽŅ
    	
    	if ( _keyCode == 22 ) then {
    		_target = _display ÔĽŅgetVariable "TAG_target";ÔĽŅ
    		_nul = [ _target ] execVM 'koc.sqf';
    	};
    }];ÔĽŅ

     

     

    thanks.  tried but without success.
    from the koc.sqf file
    variable not defined 


  6.  

    I have a question to ask.
    why did you put this limitation in your personal code inidbi?

     

    -----------------------------------------------------------------------------------------------

     

    if(count (toarray(format["%1", _data])) > 8095) then {

    _data = false;

    _log = format["IniDBI: write failed %1 %2 data too big > 8K", _section, _key];

    [_log] call iniDB_log....

     

    ---------------------------------------------------------------------------------------------------

     

    Wouldn't it be possible to increase it?
    Thanks for the reply.


  7. 48 minutes ago, CapShawns said:

    Ho già lavorato con gli script, sono molto un dilettante. Tuttavia, personalmente non riesco a trovare alcuna informazione sul salvataggio della missione con iniDB2. Ho trovato molte informazioni sul salvataggio delle informazioni sui clienti e sui personaggi, il che non mi preoccupa molto. Il salvataggio di informazioni sui personaggi / client è simile al salvataggio delle informazioni sulla missione?

    Devo usare lo spazio profile profile per salvare la missione? o è un metodo diverso da iniDB2? 

    saving is similar to that done for players but has a different concept.
    For example if you decide to save the position of a vehicle you have to do it on the server side and not on the client side.
    Take a cue from the tutorial made by the author to understand the mechanisms, it is well done and very clear. but as mentioned in the previous post the work is very long, you need to be patient.


  8. the database is designed precisely for this and provides a great help to create files where the information is saved.
    But you have to know that inidb2 is the starting base ba the rest you have to create it by code. If you need to save the position of an object, a vehicle or something else you have to script it to make sure that everything is saved at the right time and reloaded the next time. It is a huge job and always depends on what you want to do.

    Sorry for my english

√ó