initial files
This commit is contained in:
40
kp_liberation.brf_sumava/functions/fn_doSave.sqf
Normal file
40
kp_liberation.brf_sumava/functions/fn_doSave.sqf
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
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
|
||||
Reference in New Issue
Block a user