Files
KPLibSumava/kp_liberation.brf_sumava/functions/fn_doSave.sqf
Samuele Lorefice 9e023649ac initial files
2025-05-24 16:17:33 +02:00

41 lines
933 B
Plaintext

/*
File: fn_doSave.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2020-03-29
Last Update: 2020-05-08
License: MIT License - http://www.opensource.org/licenses/MIT
Description:
Save mission state to profileNamespace.
Parameter(s):
NONE
Returns:
Data was saved [BOOL]
*/
if (!isServer) exitWith {false};
if (!KPLIB_init) exitWith {
["Framework is not initalized, skipping save!", "SAVE"] call KPLIB_fnc_log;
false
};
if (missionNamespace getVariable ["kp_liberation_saving", false]) exitWith {
["Saving already in progress, skipping save!", "SAVE"] call KPLIB_fnc_log;
false
};
kp_liberation_saving = true;
private _saveData = [] call KPLIB_fnc_getSaveData;
// Write data in the server profileNamespace
profileNamespace setVariable [GRLIB_save_key, str _saveData];
saveProfileNamespace;
kp_liberation_saving = false;
true