Jump to content

Schatten

Member
  • Content Count

    782
  • Joined

  • Last visited

  • Medals

Everything posted by Schatten

  1. @LoOni3r, well, your code generally works. The problem is that 64-bit version of iniDBI2 for some reason isn't loading. Don't know why. But you can use 32-bit version of A3 server, in this case 32-bit version of iniDBI2 will be used -- it works.
  2. @LoOni3r, provide your code please.
  3. @DanJohn, http://killzonekid.com/tag/gui/
  4. @LoOni3r, I wrote this comment: You read player data, but you didn't form playerData variable. You try read variables on client side from mission namespace, but this will not work on dedicated server! As I wrote you need to form playerData variable: playerData = [ ["read", ["GENERAL", "DIR"]] call _inidbi, ["read", ["GENERAL", "POS"]] call _inidbi ]; Next you send playerData variable to client and use applyPlayerData function: applyPlayerData = { params ["_playerdir", "_playerpos"]; player setDir _playerdir; player setPos _playerpos; };
  5. No if your mission is hosted on dedicated server. Here is extended example, that works both on player's host or dedicated server. initPlayerLocal.sqf: applyPlayerData = {...}; waitUntil {time > 0}; playerDataRequest = [player]; if (isServer) then { ["playerDataRequest", playerDataRequest] call playerDataRequestHandler; } else { publicVariableServer "playerDataRequest"; playerDataRequest = nil; }; _time = time + 10; waitUntil {!(isNil "playerData") or {_time >= time}}; if (!(isNil "playerData")) then { playerData call applyPlayerData; playerData = nil; }; initServer.sqf: playerDataRequestHandler = { params ["_varName", "_varValue"]; missionNamespace setVariable [_varName, nil]; _varValue params ["_player"]; _inidbi = ["new", getPlayerUID _player] call OO_INIDBI; // Read player data and form playerData variable ["delete", _inidbi] call OO_INIDBI; if (_player == player) then { playerData call applyPlayerData; } else { (owner _player) publicVariableClient "playerData"; }; playerData = nil; }; "playerDataRequest" addPublicVariableEventHandler {call playerDataRequestHandler};
  6. @LoOni3r, your problem is that client and server has separated mission namespaces when mission hosted on dedicated server (but shared when hosted server).So I used publicVariableXXX commands to send data to/from client/server.
  7. Yes, I use startup parameter: But this does not affect accessibility to missionNamespace. Player sends request to server (using publicVariableServer command), server retrieves data from database and sends them to player (using publicVariableClient command).
  8. @iV - Ghost, try this: waitUntil { _subtasks = _taskId call BIS_fnc_taskChildren; ({_x call BIS_fnc_taskCompleted} count _subtasks) == (count _subtasks) };
  9. ["write", [_side, "loadout", _loadout]] call _inidbi; where _loadout is array returned by getUnitLoadout command. In INI file it looks like loadout="[...]" So, I don't convert array (loadout) to string.
  10. Schatten

    Check client mods

    Just list required mods in mission.sqf file.
  11. Schatten

    Check client mods

    @gc8, not sure that it is possible. AFAIK, if mods are listed in mission.sqf, then players who don't have requred mods, will not able to connect to server; if mods are not listed in mission.sqf, then game of players who don't have requred mods, will simply crash.
  12. Schatten

    Check client mods

    If you use -serverMod startup parameter, then players can't see mods that server uses, if -mod one -- they can.
  13. Cool. Didn't know this. Very strange -- it works for me.
  14. @LoOni3r, iniDBI2 is simple solution. If you need more complex one -- use databases.
  15. @LoOni3r, you already use different files to store players data -- _datenbaseplayer variable value is used as file name. But file name is wrong -- it can't contain slashes.
  16. This is extended version of my example for initServer.sqf file: "playerDataRequest" addPublicVariableEventHandler { params ["_varName", "_varValue"]; missionNamespace setVariable [_varName, nil]; _varValue params ["_player"]; _inidbi = ["new", getPlayerUID _player] call OO_INIDBI; // Read player data and form playerData variable ["delete", _inidbi] call OO_INIDBI; (owner _player) publicVariableClient "playerData"; playerData = nil; }; In this example player UID is used as DB (file) name.
  17. initPlayerLocal.sqf: waitUntil {time > 0}; playerDataRequest = [player]; publicVariableServer "playerDataRequest"; playerDataRequest = nil; _time = time + 10; waitUntil {!(isNil "playerData") or {_time >= time}}; if (!(isNil "playerData")) then { // Apply player data }; initServer.sqf: "playerDataRequest" addPublicVariableEventHandler { params ["_varName", "_varValue"]; missionNamespace setVariable [_varName, nil]; _varValue params ["_player"]; // Read player data (e.g. by UID) from DB, file, etc. and form playerData variable (owner _player) publicVariableClient "playerData"; playerData = nil; }; But it is very unreliable solution. I suggest you to use remoteExec command. Sure. DB name is given in second argument to OO_INIDBI function. Full documentation can be found here.
  18. For handling of transferring of global variable from server to client, obviously.
  19. @LoOni3r, on client side you need to use addPublicVariableEventHandler command.
  20. @pappagoat, how do you call BIS_fnc_randomPos function? call BIS_fnc_randomPos; ? If so, try [] call BIS_fnc_randomPos;
  21. @atmo, use this function to check for presence of event handler of given type: params [ ["_object", objNull, [objNull]], ["_type", "", [""]] ]; if ((isNull _object) or {_type == ""}) exitWith {false}; private _index = _object addEventHandler [_type, ""]; _object removeEventHandler [_type, _index]; _index > 0
  22. Schatten

    Arrays and addaction problem

    It is because vehicles command doesn't return unfolded sleeping bags. You can use allMissionObjects command.
  23. Schatten

    Random Date help?!

    @pappagoat, you can't use equality operator to check if value is in array. You can use in command.
  24. Schatten

    Random Date help?!

    @pappagoat, _year = selectRandom [1967, 1968]; _months = if (_year == 1967) then {[4, 12]} else {[1, 12]}; setDate [ _year, _months call BIS_fnc_randomInt, [1, 28] call BIS_fnc_randomInt, 15, 45 ];
×