Jump to content

Schatten

Member
  • Content count

    579
  • Joined

  • Last visited

  • Medals

Community Reputation

113 Excellent

2 Followers

About Schatten

  • Rank
    Gunnery Sergeant

Profile Information

  • Gender
    Male
  • Location
    Minsk, Belarus

Recent Profile Visitors

486 profile views
  1. @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; };
  2. 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};
  3. @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.
  4. 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).
  5. @iV - Ghost, try this: waitUntil { _subtasks = _taskId call BIS_fnc_taskChildren; ({_x call BIS_fnc_taskCompleted} count _subtasks) == (count _subtasks) };
  6. ["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.
  7. Check client mods

    Just list required mods in mission.sqf file.
  8. 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.
  9. Check client mods

    If you use -serverMod startup parameter, then players can't see mods that server uses, if -mod one -- they can.
  10. Cool. Didn't know this. Very strange -- it works for me.
  11. @LoOni3r, iniDBI2 is simple solution. If you need more complex one -- use databases.
  12. @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.
  13. 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.
  14. 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.
×