66 lines
2.2 KiB
Plaintext
66 lines
2.2 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Saves arsenal/garage unlocks to appropriate storage based on persistence mode
|
|
*
|
|
* Arguments:
|
|
* 0: Type <STRING> ("armory" or "garage")
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* ["armory"] call forge_client_arsenal_fnc_saveArsenalUnlocks
|
|
*/
|
|
|
|
params [["_type", "", [""]]];
|
|
|
|
switch (_type) do {
|
|
case "armory": {
|
|
private _default_armory_data = [[],[],[],[]];
|
|
// private _armory_data = player getVariable ["Armory_Unlocks", [[],[],[],[]]];
|
|
private _armory_data = GETVAR(player,Armory_Unlocks,_default_armory_data);
|
|
|
|
switch (GVAR(pdb_mode)) do {
|
|
case 0: {
|
|
// profileNamespace setVariable ["Armory_Unlocks", _armory_data];
|
|
SETVAR(profileNamespace,Armory_Unlocks,_armory_data);
|
|
};
|
|
case 1: {
|
|
["hsetid", getPlayerUID player, "armory_unlocks", -1, _armory_data, "", false] remoteExec ["dragonfly_db_fnc_addTask", 2, false];
|
|
};
|
|
default {
|
|
// profileNamespace setVariable ["Armory_Unlocks", _armory_data];
|
|
SETVAR(profileNamespace,Armory_Unlocks,_armory_data);
|
|
};
|
|
};
|
|
|
|
[_type, _armory_data] call FUNC(updateUnlocks);
|
|
};
|
|
|
|
case "garage": {
|
|
private _default_garage_data = [[],[],[],[],[],[]];
|
|
// private _garage_data = player getVariable ["Garage_Unlocks", [[],[],[],[],[],[]]];
|
|
private _garage_data = GETVAR(player,Garage_Unlocks,_default_garage_data);
|
|
|
|
switch (GVAR(pdb_mode)) do {
|
|
case 0: {
|
|
// profileNamespace setVariable ["Garage_Unlocks", _garage_data];
|
|
SETVAR(profileNamespace,Garage_Unlocks,_garage_data);
|
|
};
|
|
case 1: {
|
|
["hsetid", getPlayerUID player, "garage_unlocks", -1, _garage_data, "", false] remoteExec ["dragonfly_db_fnc_addTask", 2, false];
|
|
};
|
|
default {
|
|
// profileNamespace setVariable ["Garage_Unlocks", _garage_data];
|
|
SETVAR(profileNamespace,Garage_Unlocks,_garage_data);
|
|
};
|
|
};
|
|
|
|
[_type, _garage_data] call FUNC(updateUnlocks);
|
|
};
|
|
};
|
|
|
|
TRACE_2("Arsenal Unlocks saved",_type,GVAR(pdb_mode));
|