2015-12-07 16:24:52 +00:00
|
|
|
/*
|
|
|
|
Author: Aaron Clark - EpochMod.com
|
|
|
|
|
|
|
|
Contributors:
|
|
|
|
|
|
|
|
Description:
|
|
|
|
Sends message server to save custom variables from player
|
|
|
|
|
|
|
|
Licence:
|
|
|
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
|
|
|
|
|
|
|
Github:
|
2016-06-13 16:54:19 +00:00
|
|
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_pushCustomVar.sqf
|
2015-12-07 16:24:52 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
true call EPOCH_pushCustomVar;
|
|
|
|
|
|
|
|
Parameter(s):
|
|
|
|
_this: BOOL - true = fast save, false = slow save window
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
NOTHING
|
|
|
|
*/
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[cog import generate_private_arrays ]]]
|
|
|
|
private ["_customVars","_lastSave","_time"];
|
|
|
|
//[[[end]]]
|
2015-09-14 20:55:36 +00:00
|
|
|
_time = if (_this) then [{15},{80}];
|
2016-04-08 20:21:46 +00:00
|
|
|
_lastSave = missionNamespace getVariable["EPOCH_lastSave", diag_tickTime];
|
|
|
|
if ((diag_tickTime - _lastSave) >= _time) then {
|
2015-11-08 15:26:38 +00:00
|
|
|
EPOCH_playerHitPoints = ((getAllHitPointsDamage player) param [2,[]]);
|
|
|
|
_customVars = [];
|
|
|
|
{
|
2016-04-08 20:21:46 +00:00
|
|
|
_customVars pushBack (missionNamespace getVariable format["EPOCH_player%1",_x]);
|
|
|
|
} forEach (missionNamespace getVariable["EPOCH_customVars", []]);
|
2016-01-03 01:20:40 +00:00
|
|
|
[player,_customVars,missionNamespace getVariable "Epoch_personalToken"] remoteExec ["EPOCH_fnc_savePlayer",2];
|
2015-11-08 15:26:38 +00:00
|
|
|
missionNamespace setVariable["EPOCH_lastSave", diag_tickTime];
|
|
|
|
};
|