Epoch/Sources/epoch_code/compile/functions/EPOCH_pushCustomVar.sqf

24 lines
939 B
Plaintext
Raw Normal View History

2015-09-14 20:55:36 +00:00
private ["_tempVars","_tempVal","_tempIndex","_time"];
_time = if (_this) then [{15},{80}];
_EPOCH_lastSave = missionNamespace getVariable["EPOCH_lastSave", diag_tickTime];
if ((diag_tickTime - _EPOCH_lastSave) >= _time) then {
2015-11-08 15:26:38 +00:00
// manually set hitpoints array
EPOCH_playerHitPoints = ((getAllHitPointsDamage player) param [2,[]]);
// Get all custom variables
_customVars = [];
_customVarsInit = ["CfgEpochClient", "customVarsDefaults", missionNamespace getVariable["EPOCH_customVarsDefaults", []]] call EPOCH_fnc_returnConfigEntryV2;
{
_customVars pushBack (missionNamespace getVariable format["EPOCH_player%1",_x select 0]);
} forEach _customVarsInit;
2015-09-14 20:55:36 +00:00
2015-11-08 15:26:38 +00:00
// TODO: use remoteExec here
missionNamespace setVariable ["EPOCH_pushPlayer_PVS",[player,_customVars,missionNamespace getVariable "Epoch_personalToken"]];
2015-09-14 20:55:36 +00:00
publicVariableServer "EPOCH_pushPlayer_PVS";
2015-11-08 15:26:38 +00:00
missionNamespace setVariable["EPOCH_lastSave", diag_tickTime];
};