Jump to content
code34

iniDBI - Save and Load data to the server or your local computer without databases!

Recommended Posts

do you success to make it works ? :)

hehe... i realized you made a lot of stuff i am working/playing with, kudos to you!

and no, not really. i tried to get into the xbuild stuff, but im not a coder, more a scripter (perl is my main language) and it didnt end well :D

like ive wrote in your missions topic: there is a linux inidb version. and im currently testing it...

Share this post


Link to post
Share on other sites

okay so im using this stat saver for my mod but it sems like it's just working while i host the mission on my own pc but when i host it on a dedi it wont load or save.

code:

["RPP_StatSaver_Read_Client", {
private ["_name","_Profile","_name_UID","_exist","_p"];
_name = name player;
_Profile = format["%1", getPlayerUID player];
_name_UID = _name + "_" + _Profile;
_exist = _name_UID call iniDB_exists;
_p = player;
[[_name,_Profile,_name_UID,_exist,_p], "RPP_StatSaver_Read",false] call BIS_FNC_MP;
}] call SV_Function;
publicVariable "RPP_StatSaver_Read_Client";

["RPP_StatSaver_Server_Saving", {
private ["_Server","_Savings","_name","_exist","_p"];
_Server = "ServerDatabase";
_Savings = "Savings";
_name = _Server + "_" + _Savings;
_exist = _name call iniDB_exists;
_p = player;
[[_Server,_Savings,_name,_exist,_p], "RPP_StatSaver_Server_Read",false] call BIS_FNC_MP;
}] call SV_Function;
publicVariable "RPP_StatSaver_Server_Saving";

["RPP_StatSaver_Server_Read", {
private ["_name","_Profile","_name_UID","_exist","_user"];
_name = _this select 0;
_Profile = _this select 1;
_name_UID = _this select 2;
_exist = _this select 3;
_p = _This select 4;

if (_exist) then {
	_BankSafe = [_name_UID,_Profile,"RPP_MainBank_Safe", "SCALAR"] call inidb_read;
	_CompanyList = [_name_UID,_Profile,"Company_list", "ARRAY"] call inidb_read;
	_gs1 = [_name_UID,_Profile,"GasStation1_Money", "SCALAR"] call inidb_read;
	_gs2 = [_name_UID,_Profile,"GasStation2_Money", "SCALAR"] call inidb_read;
	_gs3 = [_name_UID,_Profile,"GasStation3_Money", "SCALAR"] call inidb_read;
	_gs4 = [_name_UID,_Profile,"GasStation4_Money", "SCALAR"] call inidb_read;
	_gs5 = [_name_UID,_Profile,"GasStation5_Money", "SCALAR"] call inidb_read;
	_gs6 = [_name_UID,_Profile,"GasStation6_Money", "SCALAR"] call inidb_read;
	_gs7 = [_name_UID,_Profile,"GasStation7_Money", "SCALAR"] call inidb_read;
	_Warrants = [_name_UID,_Profile,"RPP_Warrants", "ARRAY"] call inidb_read;
	_shop1 = [_name_UID,_Profile,"LowCars_ShopOwner", "ARRAY"] call inidb_read;
	_shop2 = [_name_UID,_Profile,"EscaladeCars_ShopOwner", "ARRAY"] call inidb_read;
	_shop3 = [_name_UID,_Profile,"OldCars_ShopOwner", "ARRAY"] call inidb_read;
	_shop4 = [_name_UID,_Profile,"PoliceCarShop_Owner", "ARRAY"] call inidb_read;
	_shop5 = [_name_UID,_Profile,"WildlifeCarShop_Owner", "ARRAY"] call inidb_read;
	_shop6 = [_name_UID,_Profile,"FastCars_ShopOwner", "ARRAY"] call inidb_read;
	_shop7 = [_name_UID,_Profile,"TruckShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop8 = [_name_UID,_Profile,"Boatshop_ShopOwner", "ARRAY"] call inidb_read;
	_shop9 = [_name_UID,_Profile,"HeliShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop10 = [_name_UID,_Profile,"EMT_VehicleShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop11 = [_name_UID,_Profile,"Gun_Store_ShopOwner", "ARRAY"] call inidb_read;
	_shop12 = [_name_UID,_Profile,"GeneralItem_ShopOwner", "ARRAY"] call inidb_read;
	_shop13 = [_name_UID,_Profile,"Rifle_Store_ShopOwner", "ARRAY"] call inidb_read;
	_shop14 = [_name_UID,_Profile,"CivItemShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop15 = [_name_UID,_Profile,"HuntingTools_ShopOwner", "ARRAY"] call inidb_read;
	_shop16 = [_name_UID,_Profile,"Police_ItemShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop17 = [_name_UID,_Profile,"Wildlife_ItemShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop18 = [_name_UID,_Profile,"EMT_ItemShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop19 = [_name_UID,_Profile,"Market_ItemShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop20 = [_name_UID,_Profile,"Fishingtools_ItemShop_ShopOwner", "ARRAY"] call inidb_read;
	_shop21 = [_name_UID,_Profile,"AudiCars_ShopOwner", "ARRAY"] call inidb_read;
	_shop22 = [_name_UID,_Profile,"NissanCars_ShopOwner", "ARRAY"] call inidb_read;

	[[_BankSafe,_CompanyList,_gs1,_gs2,_gs3,_gs4,_gs5,_gs6,_gs7,_Warrants,_shop1,_shop2,_shop3,
	_shop4,_shop5,_shop6,_shop7,_shop8,_shop9,_shop10,_shop11,_shop12,
	_shop13,_shop14,_shop15,_shop16,_shop17,_shop18,_shop19,_shop20,_shop21,_shop22], "RPP_StatSaver_Server_StatsReturnBack", _p] call BIS_FNC_MP;
} else {
	[[], "RPP_StatSaver_Server_Save", false] call BIS_FNC_MP;
};
}] call SV_Function;
publicVariable "RPP_StatSaver_Server_Read";

["RPP_StatSaver_Server_StatsReturnBack", {
_bank = _this select 0;
_CompanyList = _this select 1;
_gs1 = _this select 2;
_gs2 = _this select 3;
_gs3 = _this select 4;
_gs4 = _this select 5;
_gs5 = _this select 6;
_gs6 = _this select 7;
_gs7 = _this select 8;
_Warrants = _this select 9;
_shop1 = _this select 10;
_shop2 = _this select 11;
_shop3 = _this select 12;
_shop4 = _this select 13;
_shop5 = _this select 14;
_shop6 = _this select 15;
_shop7 = _this select 16;
_shop8 = _this select 17;
_shop9 = _this select 18;
_shop10 = _this select 19;
_shop11 = _this select 20;
_shop12 = _this select 21;
_shop13 = _this select 22;
_shop14 = _this select 23;
_shop15 = _this select 24;
_shop16 = _this select 25;
_shop17 = _this select 26;
_shop18 = _this select 27;
_shop19 = _this select 28;
_shop20 = _this select 29;
_shop21 = _this select 30;
_shop22 = _this select 31;

RPP_MainBank_Safe = _bank;
Company_list = _CompanyList;
GasStation1_Money = _gs1;
GasStation2_Money = _gs2;
GasStation3_Money = _gs3;
GasStation4_Money = _gs4;
GasStation5_Money = _gs5;
GasStation6_Money = _gs6;
GasStation7_Money = _gs7;
RPP_Warrants = _Warrants;

LowCars_ShopOwner = _shop1;
EscaladeCars_ShopOwner = _shop2;
OldCars_ShopOwner = _shop3;
PoliceCarShop_Owner = _shop4;
WildlifeCarShop_Owner = _shop5;
FastCars_ShopOwner = _shop6;
TruckShop_ShopOwner = _shop7;
Boatshop_ShopOwner = _shop8;
HeliShop_ShopOwner = _shop9;
EMT_VehicleShop_ShopOwner = _shop10;
Gun_Store_ShopOwner = _shop11;
GeneralItem_ShopOwner = _shop12;
Rifle_Store_ShopOwner = _shop13;
CivItemShop_ShopOwner = _shop14;
HuntingTools_ShopOwner = _shop15;
Police_ItemShop_ShopOwner = _shop16;
Wildlife_ItemShop_ShopOwner = _shop17;
EMT_ItemShop_ShopOwner = _shop18;
Market_ItemShop_ShopOwner = _shop19;
Fishingtools_ItemShop_ShopOwner = _shop20;
AudiCars_ShopOwner = _shop21;
NissanCars_ShopOwner = _shop22;

publicVariable "RPP_MainBank_Safe";
publicVariable "Company_list";
publicVariable "GasStation1_Money";
publicVariable "GasStation2_Money";
publicVariable "GasStation3_Money";
publicVariable "GasStation4_Money";
publicVariable "GasStation5_Money";
publicVariable "GasStation6_Money";
publicVariable "GasStation7_Money";
publicVariable "RPP_Warrants";
publicVariable "LowCars_ShopOwner";
publicVariable "EscaladeCars_ShopOwner";
publicVariable "OldCars_ShopOwner";
publicVariable "PoliceCarShop_Owner";
publicVariable "WildlifeCarShop_Owner";
publicVariable "FastCars_ShopOwner";
publicVariable "TruckShop_ShopOwner";
publicVariable "Boatshop_ShopOwner";
publicVariable "HeliShop_ShopOwner";
publicVariable "EMT_VehicleShop_ShopOwner";
publicVariable "Gun_Store_ShopOwner";
publicVariable "GeneralItem_ShopOwner";
publicVariable "Rifle_Store_ShopOwner";
publicVariable "CivItemShop_ShopOwner";
publicVariable "HuntingTools_ShopOwner";
publicVariable "Police_ItemShop_ShopOwner";
publicVariable "Wildlife_ItemShop_ShopOwner";
publicVariable "EMT_ItemShop_ShopOwner";
publicVariable "Market_ItemShop_ShopOwner";
publicVariable "Fishingtools_ItemShop_ShopOwner";
publicVariable "AudiCars_ShopOwner";
publicVariable "NissanCars_ShopOwner";
}] call SV_Function;
publicVariable "RPP_StatSaver_Server_StatsReturnBack";

["RPP_StatSaver_Server_Save", {
private ["_name","_Profile","_name_UID"];
_name = "ServerDatabase";
_Profile = "Savings";
_name_UID = _name + "_" + _Profile;

[_name_UID,_Profile, "RPP_MainBank_Safe", RPP_MainBank_Safe] call iniDB_write;
[_name_UID,_Profile, "Company_list", Company_list] call iniDB_write;
[_name_UID,_Profile, "GasStation1_Money", GasStation1_Money] call iniDB_write;
[_name_UID,_Profile, "GasStation2_Money", GasStation2_Money] call iniDB_write;
[_name_UID,_Profile, "GasStation3_Money", GasStation3_Money] call iniDB_write;
[_name_UID,_Profile, "GasStation4_Money", GasStation4_Money] call iniDB_write;
[_name_UID,_Profile, "GasStation5_Money", GasStation5_Money] call iniDB_write;
[_name_UID,_Profile, "GasStation6_Money", GasStation6_Money] call iniDB_write;
[_name_UID,_Profile, "GasStation7_Money", GasStation7_Money] call iniDB_write;
[_name_UID,_Profile, "RPP_Warrants", RPP_Warrants] call iniDB_write;
[_name_UID,_Profile,"LowCars_ShopOwner", LowCars_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"EscaladeCars_ShopOwner", EscaladeCars_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"OldCars_ShopOwner", OldCars_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"PoliceCarShop_Owner", PoliceCarShop_Owner] call iniDB_write;
[_name_UID,_Profile,"WildlifeCarShop_Owner", WildlifeCarShop_Owner] call iniDB_write;
[_name_UID,_Profile,"FastCars_ShopOwner", FastCars_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"TruckShop_ShopOwner", TruckShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"Boatshop_ShopOwner", Boatshop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"HeliShop_ShopOwner", HeliShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"EMT_VehicleShop_ShopOwner", EMT_VehicleShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"Gun_Store_ShopOwner", Gun_Store_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"GeneralItem_ShopOwner", GeneralItem_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"Rifle_Store_ShopOwner", Rifle_Store_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"CivItemShop_ShopOwner", CivItemShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"HuntingTools_ShopOwner", HuntingTools_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"Police_ItemShop_ShopOwner", Police_ItemShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"Wildlife_ItemShop_ShopOwner", Wildlife_ItemShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"EMT_ItemShop_ShopOwner", EMT_ItemShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"Market_ItemShop_ShopOwner", Market_ItemShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"Fishingtools_ItemShop_ShopOwner", Fishingtools_ItemShop_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"AudiCars_ShopOwner", AudiCars_ShopOwner] call iniDB_write;
[_name_UID,_Profile,"NissanCars_ShopOwner", NissanCars_ShopOwner] call iniDB_write;

_Server = "ServerDatabase";
_Savings = "Savings";
_name = _Server + "_" + _Savings;
_exist = _name call iniDB_exists;
_p = player;

[[_Server,_Savings,_name,_exist,_p], "RPP_StatSaver_Server_Read",false] call BIS_FNC_MP;
}] call SV_Function;
publicVariable "RPP_StatSaver_Server_Save";


["RPP_StatSaver_Read", {
private ["_name","_Profile","_name_UID","_exist","_user"];
_name = _this select 0;
_Profile = _this select 1;
_name_UID = _this select 2;
_exist = _this select 3;
_user = _This select 4;

if (_exist) then {
	_cash = [_name_UID,_Profile,"Cash", "SCALAR"] call inidb_read;
	_bank = [_name_UID,_Profile,"Bank", "SCALAR"] call inidb_read;
	_adminlvl = [_name_UID,_Profile,"Admin_lvl", "SCALAR"] call inidb_read;
	_coplvl = [_name_UID,_Profile,"CopLevel", "SCALAR"] call inidb_read;
	_miningskill = [_name_UID,_Profile,"Mining_Skill", "SCALAR"] call inidb_read;
	_vehicleskill = [_name_UID,_Profile,"Vehicle_Skill", "SCALAR"] call inidb_read;
	_fishingskill = [_name_UID,_Profile,"Fishing_Skill", "SCALAR"] call inidb_read;
	_CraftingSkill = [_name_UID,_Profile,"Crafting_Skill", "SCALAR"] call inidb_read;
	_gatheringSkill = [_name_UID,_Profile,"Gathering_Skill", "SCALAR"] call inidb_read;
	_vehicleStorage = [_name_UID,_Profile,"Vehicle_Storage", "ARRAY"] call inidb_read;
	_Inventory = [_name_UID,_Profile,"RPP_PlayerInventory", "ARRAY"] call inidb_read;
	_License = [_name_UID,_Profile,"RPP_License", "ARRAY"] call inidb_read;
	_SavingPDGEAR = [_name_UID,_Profile,"Saving_PD_Gear", "ARRAY"] call inidb_read;
	_CompanyWorkerlist = [_name_UID,_Profile,"Company_Workerslist", "ARRAY"] call inidb_read;
	_CompanyApplyed = [_name_UID,_Profile,"Company_Applyed", "ARRAY"] call inidb_read;
	_CompanyBank = [_name_UID,_Profile,"Company_Bank", "SCALAR"] call inidb_read;
	_CompanyStorage = [_name_UID,_Profile,"Company_Storage", "ARRAY"] call inidb_read;
	_CompanyCraftlist = [_name_UID,_Profile,"Company_CraftList", "ARRAY"] call inidb_read;
	_CompanyInfo = [_name_UID,_Profile,"Company_Info", "ARRAY"] call inidb_read;
	_CompanyOwning = [_name_UID,_Profile,"Company_Owning", "STRING"] call inidb_read;
	_CompanyWorkers = [_name_UID,_Profile,"Company_Workers", "SCALAR"] call inidb_read;
	_CompanyMaxWorkers = [_name_UID,_Profile,"Company_MaxWorkers", "SCALAR"] call inidb_read;
	_CompanyWorkingfor = [_name_UID,_Profile,"Company_WorkingFor", "ARRAY"] call inidb_read;
	_username = [_name_UID,_Profile,"RPP_Username", "STRING"] call inidb_read;
	_password = [_name_UID,_Profile,"RPP_Password", "STRING"] call iniDB_read;
	_newplayer = [_name_UID,_Profile,"RPP_NewPlayer", "STRING"] call inidb_read;
	_Playerlevel = [_name_UID,_Profile,"RPP_PlayerLevel", "SCALAR"] call inidb_read;
	_playerStatus = [_name_UID,_Profile,"RPP_PlayerStatus", "STRING"] call inidb_read;
	_JaiTimeh = [_name_UID,_Profile,"JailTime_H", "SCALAR"] call inidb_read;
	_JailTimem = [_name_UID,_Profile,"JailTime_M", "SCALAR"] call inidb_read;
	_JailTimes = [_name_UID,_Profile,"JailTime_S", "SCALAR"] call inidb_read;
	_Hunger = [_name_UID,_Profile,"Hunger", "SCALAR"] call inidb_read;
	_Thirst = [_name_UID,_Profile,"Thirst", "SCALAR"] call inidb_read;
	_Weapons = [_name_UID,_Profile,"Weapons", "SCALAR"] call inidb_read;
	_Mags = [_name_UID,_Profile,"Mags", "SCALAR"] call inidb_read;
	_healt = [_name_UID,_Profile,"Healt", "SCALAR"] call inidb_read;
	_CompanyWorking = [_name_UID,_Profile,"Company_Working", "STRING"] call inidb_read;
	_isCop = [_name_UID,_Profile,"IsCop", "STRING"] call inidb_read;
	_isEMT = [_name_UID,_Profile,"IsEMT", "STRING"] call inidb_read;
	_isOnDuty = [_name_UID,_Profile,"IsOnDuty", "STRING"] call inidb_read;

	[[_cash,_bank,_adminlvl,_coplvl,_miningskill,_vehicleskill,_fishingskill,_CraftingSkill,_gatheringSkill,_vehicleStorage,_Inventory,_License,
	_SavingPDGEAR,_CompanyWorkerlist,_CompanyApplyed,_CompanyBank,_CompanyStorage,_CompanyCraftlist,_CompanyInfo,_CompanyOwning,_CompanyWorkers,
	_CompanyMaxWorkers,_CompanyWorkingfor,_username,_password,_newplayer,_Playerlevel,_playerStatus,_JaiTimeh,_JailTimem,_JailTimes,
	_hunger,_Thirst,_Weapons,_mags,_healt,_CompanyWorking,_isCop,_isEMT,_isOnDuty], "RPP_StatSaver_StatsReturnBack", _user] call BIS_FNC_MP;
} else {
	[[_name,_Profile,_name_UID,_user], "RPP_StatSaver_Write", false] call BIS_FNC_MP;
};
}] call SV_Function;
publicVariable "RPP_StatSaver_Read";

["RPP_StatSaver_ReadUser", {
private ["_name","_Profile","_name_UID","_exist","_user"];
_name = _this select 0;
_Profile = _this select 1;
_name_UID = _this select 2;
_user = _This select 4;

_cash = [_name_UID,_Profile,"Cash", "SCALAR"] call inidb_read;
_bank = [_name_UID,_Profile,"Bank", "SCALAR"] call inidb_read;
_adminlvl = [_name_UID,_Profile,"Admin_lvl", "SCALAR"] call inidb_read;
_coplvl = [_name_UID,_Profile,"CopLevel", "SCALAR"] call inidb_read;
_miningskill = [_name_UID,_Profile,"Mining_Skill", "SCALAR"] call inidb_read;
_vehicleskill = [_name_UID,_Profile,"Vehicle_Skill", "SCALAR"] call inidb_read;
_fishingskill = [_name_UID,_Profile,"Fishing_Skill", "SCALAR"] call inidb_read;
_CraftingSkill = [_name_UID,_Profile,"Crafting_Skill", "SCALAR"] call inidb_read;
_gatheringSkill = [_name_UID,_Profile,"Gathering_Skill", "SCALAR"] call inidb_read;
_vehicleStorage = [_name_UID,_Profile,"Vehicle_Storage", "ARRAY"] call inidb_read;
_Inventory = [_name_UID,_Profile,"RPP_PlayerInventory", "ARRAY"] call inidb_read;
_License = [_name_UID,_Profile,"RPP_License", "ARRAY"] call inidb_read;
_SavingPDGEAR = [_name_UID,_Profile,"Saving_PD_Gear", "ARRAY"] call inidb_read;
_CompanyWorkerlist = [_name_UID,_Profile,"Company_Workerslist", "ARRAY"] call inidb_read;
_CompanyApplyed = [_name_UID,_Profile,"Company_Applyed", "ARRAY"] call inidb_read;
_CompanyBank = [_name_UID,_Profile,"Company_Bank", "SCALAR"] call inidb_read;
_CompanyStorage = [_name_UID,_Profile,"Company_Storage", "ARRAY"] call inidb_read;
_CompanyCraftlist = [_name_UID,_Profile,"Company_CraftList", "ARRAY"] call inidb_read;
_CompanyInfo = [_name_UID,_Profile,"Company_Info", "ARRAY"] call inidb_read;
_CompanyOwning = [_name_UID,_Profile,"Company_Owning", "STRING"] call inidb_read;
_CompanyWorkers = [_name_UID,_Profile,"Company_Workers", "SCALAR"] call inidb_read;
_CompanyMaxWorkers = [_name_UID,_Profile,"Company_MaxWorkers", "SCALAR"] call inidb_read;
_CompanyWorkingfor = [_name_UID,_Profile,"Company_WorkingFor", "ARRAY"] call inidb_read;
_username = [_name_UID,_Profile,"RPP_Username", "STRING"] call inidb_read;
_password = [_name_UID,_Profile,"RPP_Password", "STRING"] call iniDB_read;
_newplayer = [_name_UID,_Profile,"RPP_NewPlayer", "STRING"] call inidb_read;
_Playerlevel = [_name_UID,_Profile,"RPP_PlayerLevel", "SCALAR"] call inidb_read;
_playerStatus = [_name_UID,_Profile,"RPP_PlayerStatus", "STRING"] call inidb_read;
_JaiTimeh = [_name_UID,_Profile,"JailTime_H", "SCALAR"] call inidb_read;
_JailTimem = [_name_UID,_Profile,"JailTime_M", "SCALAR"] call inidb_read;
_JailTimes = [_name_UID,_Profile,"JailTime_S", "SCALAR"] call inidb_read;
_Hunger = [_name_UID,_Profile,"Hunger", "SCALAR"] call inidb_read;
_Thirst = [_name_UID,_Profile,"Thirst", "SCALAR"] call inidb_read;
_Weapons = [_name_UID,_Profile,"Weapons", "SCALAR"] call inidb_read;
_Mags = [_name_UID,_Profile,"Mags", "SCALAR"] call inidb_read;
_healt = [_name_UID,_Profile,"Healt", "SCALAR"] call inidb_read;
_CompanyWorking = [_name_UID,_Profile,"Company_Working", "STRING"] call inidb_read;
_isCop = [_name_UID,_Profile,"IsCop", "STRING"] call inidb_read;
_isEMT = [_name_UID,_Profile,"IsEMT", "STRING"] call inidb_read;
_isOnDuty = [_name_UID,_Profile,"IsOnDuty", "STRING"] call inidb_read;

[[_cash,_bank,_adminlvl,_coplvl,_miningskill,_vehicleskill,_fishingskill,_CraftingSkill,_gatheringSkill,_vehicleStorage,_Inventory,_License,
_SavingPDGEAR,_CompanyWorkerlist,_CompanyApplyed,_CompanyBank,_CompanyStorage,_CompanyCraftlist,_CompanyInfo,_CompanyOwning,_CompanyWorkers,
_CompanyMaxWorkers,_CompanyWorkingfor,_username,_password,_newplayer,_Playerlevel,_playerStatus,_JaiTimeh,_JailTimem,_JailTimes,
_hunger,_Thirst,_Weapons,_mags,_healt,_CompanyWorking,_isCop,_isEMT,_isOnDuty], "RPP_StatSaver_StatsReturnBack", _user] call BIS_FNC_MP;
}] call SV_Function;
publicVariable "RPP_StatSaver_ReadUser";

["RPP_StatSaver_StatsReturnBack", {
_cash = _this select 0;
_bank = _this select 1;
_adminlvl = _this select 2;
_coplvl = _this select 3;
_miningskill = _this select 4;
_vehicleskill = _this select 5;
_fishingskill = _this select 6;
_CraftingSkill = _this select 7;
_gatheringSkill = _this select 8;
_vehicleStorage = _this select 9;
_Inventory = _this select 10;
_License = _this select 11;
_SavingPDGEAR = _this select 12;
_CompanyWorkerlist = _this select 13;
_CompanyApplyed = _this select 14;
_CompanyBank = _this select 15;
_CompanyStorage = _this select 16;
_CompanyCraftlist = _this select 17;
_CompanyInfo = _this select 18;
_CompanyOwning = _this select 19;
_CompanyWorkers = _this select 20;
_CompanyMaxWorkers = _this select 21;
_CompanyWorkingfor = _this select 22;
_username = _this select 23;
_password = _this select 24;
_newplayer = _this select 25;
_Playerlevel = _this select 26;
_playerStatus = _this select 27;
_JaiTimeh = _this select 28;
_JailTimem = _this select 29;
_JailTimes = _this select 30,
_hunger = _this select 31;
_thirst = _this select 32;
_Weapons = _this select 33;
_mags = _this select 34;
_healt = _this select 35;
_CompanyWorking = _this select 36;
_iscop = _this select 37;
_isemt = _this select 38;
_isOnDuty = _this select 39;

Cash = _cash;
Bank = _bank;
Admin_lvl = _adminlvl;
CopLevel = _coplvl;
Mining_Skill = _miningskill;
Vehicle_Skill = _vehicleskill;
Fishing_Skill = _fishingskill;
Crafting_Skill = _CraftingSkill;
Vehicle_Storage = _vehicleStorage;
RPP_PlayerInventory = _Inventory;
RPP_License = _License;
Saving_PD_Gear = _SavingPDGEAR;
Company_Workerslist = _CompanyWorkerlist;
Company_Applyed = _CompanyApplyed;
Company_Bank = _CompanyBank;
Company_Storage = _CompanyStorage;

Company_CraftList = _CompanyCraftlist;
Company_Info = _CompanyInfo;
Company_Owning = _CompanyOwning;
Company_Workers = _CompanyWorkers;
Company_MaxWorkers = _CompanyMaxWorkers;
Company_WorkingFor = _CompanyWorkingfor;
RPP_Username = name player;
RPP_Password = _password;
RPP_NewPlayer = _newplayer;
RPP_PlayerLevel = _Playerlevel;
RPP_PlayerStatus = _playerStatus;
JailTime_H = _JaiTimeh;
JailTime_M = _JailTimem;
JailTime_S = _JailTimes;
Hunger = _hunger;
Thirst = _thirst;
player setDamage _healt;
Company_Working = _CompanyWorking;
isCop = _isCop;
isEMT = _isemt;
IsOnDuty = _isOnDuty;

if (Company_Owning == "true") then {
	Company_Owning = true;
} else {
	Company_Owning = false;
};

if (RPP_NewPlayer == "true") then {
	RPP_NewPlayer = true;
} else {
	RPP_NewPlayer = false;
};
if (Company_Working == "true") then {
	Company_Working = true;
} else {
	Company_Working = false;
};
if (isCop == "true") then {
	isCop = true;
} else {
	isCop = false;
};
if (isEMT == "true") then {
	isEMT = true;
} else {
	isEMT = false;
};
if (IsOnDuty == "true") then {
	IsOnDuty = true;
} else {
	IsOnDuty = false;
};
if (!(isCop)) then {
	if (!(isEMT)) then {
		if (!(IsOnDuty)) then {
			isCiv = true;
		};
	};
};

[] spawn {	
	sleep 0.5;
	if (!(RPP_inidb_read)) then {
		_name = name player;
		_Profile = format["%1", getPlayerUID player];
		_name_UID = _name + "_" + _Profile;
		_user = player;
		[[_name,_Profile,_name_UID,_user], "RPP_StatSaver_Write", false] call BIS_FNC_MP;
	};
	sleep 0.2;
	RPP_inidb_read = true;
};
}] call SV_Function;
publicVariable "RPP_StatSaver_StatsReturnBack";

["RPP_StatSaver_Save", {
private ["_name","_Profile","_name_UID"];
_name = name player;
_Profile = format["%1", getPlayerUID player];
_name_UID = _name + "_" + _Profile;
_user = player;

[[_name,_Profile,_name_UID,_user], "RPP_StatSaver_Write", true] call BIS_FNC_MP;
}] call SV_Function;
publicVariable "RPP_StatSaver_Save";

["RPP_StatSaver_Write", {
_name = _this select 0;
_Profile = _this select 1;
_name_UID = _this select 2;
_user = _this select 3;

[_name_UID,_Profile, "Cash", Cash] call iniDB_write;
[_name_UID,_Profile, "Bank", Bank] call iniDB_write;
[_name_UID,_Profile, "Admin_lvl", Admin_lvl] call iniDB_write;
[_name_UID,_Profile, "CopLevel", CopLevel] call iniDB_write;
[_name_UID,_Profile, "Mining_Skill", Mining_Skill] call iniDB_write;
[_name_UID,_Profile, "Vehicle_Skill", Vehicle_Skill] call iniDB_write;
[_name_UID,_Profile, "Fishing_Skill", Fishing_Skill] call iniDB_write;
[_name_UID,_Profile, "Crafting_Skill", Crafting_Skill] call iniDB_write;
[_name_UID,_Profile, "Vehicle_Storage", Vehicle_Storage] call iniDB_write;
[_name_UID,_Profile, "RPP_PlayerInventory", RPP_PlayerInventory] call iniDB_write;
[_name_UID,_Profile, "RPP_License", RPP_License] call iniDB_write;
[_name_UID,_Profile, "Saving_PD_Gear", Saving_PD_Gear] call iniDB_write;
[_name_UID,_Profile, "Company_Workerslist", Company_Workerslist] call iniDB_write;
[_name_UID,_Profile, "Company_Applyed", Company_Applyed] call iniDB_write;
[_name_UID,_Profile, "Company_Bank", Company_Bank] call iniDB_write;
[_name_UID,_Profile, "Company_Storage", Company_Storage] call iniDB_write;
[_name_UID,_Profile, "Company_CraftList", Company_CraftList] call iniDB_write;
[_name_UID,_Profile, "Company_Info", Company_Info] call iniDB_write;
[_name_UID,_Profile, "Company_Owning", Company_Owning] call iniDB_write;
[_name_UID,_Profile, "Company_Workers", Company_Workers] call iniDB_write;
[_name_UID,_Profile, "Company_MaxWorkers", Company_MaxWorkers] call iniDB_write;
[_name_UID,_Profile, "Company_WorkingFor", Company_WorkingFor] call iniDB_write;
[_name_UID,_Profile, "RPP_Username", RPP_Username] call iniDB_write;
[_name_UID,_Profile, "RPP_Password", RPP_Password] call iniDB_write;
[_name_UID,_Profile, "RPP_NewPlayer", RPP_NewPlayer] call iniDB_write;
[_name_UID,_Profile, "RPP_PlayerLevel", RPP_PlayerLevel] call iniDB_write;
[_name_UID,_Profile, "RPP_PlayerStatus", RPP_PlayerStatus] call iniDB_write;
[_name_UID,_Profile, "JailTime_H", JailTime_H] call iniDB_write;
[_name_UID,_Profile, "JailTime_M", JailTime_M] call iniDB_write;
[_name_UID,_Profile, "JailTime_S", JailTime_S] call iniDB_write;
[_name_UID,_Profile, "Hunger", Hunger] call iniDB_write;
[_name_UID,_Profile, "Thirst", Thirst] call iniDB_write;
[_name_UID,_Profile, "Weapons", weapons player] call iniDB_write;
[_name_UID,_Profile, "Mags", magazines player] call iniDB_write;
[_name_UID,_Profile, "Healt", damage player] call iniDB_write;
[_name_UID,_Profile, "Company_Working", Company_Working] call iniDB_write;
[_name_UID,_Profile, "isCop", isCop] call iniDB_write;
[_name_UID,_Profile, "isEMT", isEMT] call iniDB_write;
[_name_UID,_Profile, "IsOnDuty", IsOnDuty] call iniDB_write;

_exist = _name_UID call iniDB_exists;
[[_name,_Profile,_name_UID,_exist,_user], "RPP_StatSaver_ReadUser", true] call BIS_FNC_MP;
}] call SV_Function;
publicVariable "RPP_StatSaver_Write";

["RPP_StatSaver_Saving", {
[] spawn {
	while {true} do {
		sleep 60;
		[] call RPP_StatSaver_Save;
	};
};
}] call SV_Function;
publicVariable "RPP_StatSaver_Saving";

["RPP_StatSaver_Saving_Server", {
[] spawn {
Server_SavewaitTime = 200;
	while {true} do {
		sleep 1;
		if (Server_SavewaitTime == 0) then {
			sleep (Server_SavewaitTime);
			[] call RPP_StatSaver_Server_Save;
			Server_SavewaitTime = 200;
			publicVariable "Server_SavewaitTime";
		} else {
			Server_SavewaitTime = Server_SavewaitTime - 1;
			publicVariable "Server_SavewaitTime";
		};
	};
};
}] call SV_Function;
publicVariable "RPP_StatSaver_Saving_Server";

Share this post


Link to post
Share on other sites
okay so im using this stat saver for my mod but it sems like it's just working while i host the mission on my own pc but when i host it on a dedi it wont load or save.

first check the vc++ libraries on your server are up to date, after that check the permissions files :)

Share this post


Link to post
Share on other sites

well it works to create the cfg file but it wont load from it or update it.

Share this post


Link to post
Share on other sites

if it s a server configuration problem you should look for it in the good thread :)

Share this post


Link to post
Share on other sites
first check the vc++ libraries on your server are up to date, after that check the permissions files :)

Hi code34,

Wich version is needed to make it work ?

i have an issue on one server. The second one is working but have c++ 2005,2008,2010,2012 x84 and x64.

The first one use 2010, x86 and x64 and it doesn't work

Share this post


Link to post
Share on other sites

hi mariodu62

i have no clue about that :( it should works with the last release.

Share this post


Link to post
Share on other sites
hi mariodu62

i have no clue about that :( it should works with the last release.

Ok works fine with seven but not with 8.1.

i had to use the dll from wasteland github

Share this post


Link to post
Share on other sites
is anyone able to provide an example on how to use this to save a players kit and location?

thanks

I would also love to find a good/simple example of this. I tried the OOD persistant data world, but couldn't get that working for me at all. Any advice?

Share this post


Link to post
Share on other sites
I would also love to find a good/simple example of this. I tried the OOD persistant data world, but couldn't get that working for me at all. Any advice?

http://forums.bistudio.com/showthread.php?167927-iniDBI-Save-and-Load-data-to-the-server-or-your-local-computer-without-databases!&p=2757861&viewfull=1#post2757861

Share this post


Link to post
Share on other sites

Thanks for the help, been trying to get this working for a while now, keep running into problems though. I think i almost have it, but following that example, I run into a script error in autoSendingProfile.sqf, at the end of this block:

playerProfile = [
	getPlayerUID player,

	[
		damage player,
		[position player, direction player],
		magazines player,
		_weapons
	];    //ERROR ON THIS LINE?
];

I can't seem to figure out why, it says it's missing a "]", but there's one there. Any suggestions?

Share this post


Link to post
Share on other sites

I can't seem to figure out why, it says it's missing a "]", but there's one there. Any suggestions?

My mistake, sorry. Just remove semicolon:

playerProfile = [
	getPlayerUID player,

	[
		damage player,
		[position player, direction player],
		magazines player,
		_weapons
	]
];

Share this post


Link to post
Share on other sites

Thanks a bunch for the help, that fixed that (although sometimes i don't understand the SQF syntax at all, why would it need a semicolon at the end of the first array, but not that one?), i'm still struggling with getting this working though. Following your example, after putting diag_logs everywhere, what's happening is that the publicVariableEventHandler is not firing on the server, so after autoSendingProfile is started and the player profile is created, it's never passed to the server and saved in the DB. So basically the event handlers on the server don't seem to be working. 

 

Can you think of any reason this might be happening?

 

Thanks again for your help

Share this post


Link to post
Share on other sites

why would it need a semicolon at the end of the first array, but not that one?

Because first array is assigned to variable playerProfile using assignment operator (=) and it requires that any operator ended by semicolon.

Internal array is last element of external array and you can not put semicolon after last element. Compare with this:

variable = [variable1, [variable2, variable3], ..., variableN];

i'm still struggling with getting this working though. Following your example, after putting diag_logs everywhere, what's happening is that the publicVariableEventHandler is not firing on the server, so after autoSendingProfile is started and the player profile is created, it's never passed to the server and saved in the DB. So basically the event handlers on the server don't seem to be working.

Can you think of any reason this might be happening?

How you start your mission?

Share this post


Link to post
Share on other sites

Because first array is assigned to variable playerProfile using assignment operator (=) and it requires that any operator ended by semicolon.

Internal array is last element of external array and you can not put semicolon after last element. Compare with this:

variable = [variable1, [variable2, variable3], ..., variableN];
How you start your mission?

 

 

Hmm, not sure what you mean, I'm just starting it both trying it in the editor, and starting a locally hosted MP game and having a friend join to try and test it.

 

I'm not running a local server or anything, would that make a difference?

Share this post


Link to post
Share on other sites

You need to use arma3server.exe to start MP game to get fully working, because event handlers doesn't work if you locally hosted MP game.

Share this post


Link to post
Share on other sites

Hey there, I have problem right here. I am trying to save a entry for every UID joining my server. At least it is no problem with static informations but as soon as I am trying to save the playerdata it is not writing to the ini file or all I get is

[Error: No vehicle]
Name="Error: No vehicle"

At least I would like to have it like

[23423423531534] // PlayerUID
Name="Dovev" //Player name

This is how my sqf file looks. Called from the init.sqf in the mp mission

if(isServer) then
	{
		call compile preProcessFile "\inidbi\init.sqf";
	};
	
sleep 20;

_databasename = "visits";

_player = name player;
_uid = getPlayerUID player;

_addVisit = [_databasename, _uid, "Name", _player] call iniDB_write;

I think my error might be some kind of wrong or missing formatting the variables but even after a few hours searching google and the docs I can´t a solution.

_player and _uid are available and can be used from other script parts in that section.

 

 

 

#Edit:  

_player = format["%1", name player];
_uid = format["%1", getPlayerUID player];

I have tried this. Still delivers an "No vehicle" for the _player and an empty variable for _uid.

Edited by Dovev

Share this post


Link to post
Share on other sites

Thank you for your answer. If I get you right, this means that I need to create a kind of remote command? Sorry but I am new to Arma scripting.

Share this post


Link to post
Share on other sites

If I get you right, this means that I need to create a kind of remote command?

if (isServer) then {
	call compile preProcessFile "\inidbi\init.sqf";

	"playerData" addPublicVariableEventHandler {
		_name = playerData select 0;
		_uid = playerData select 1;

		playerData = nil;

		["visits", _uid, "Name", _name] call iniDB_write;

		true
	};
}
else {
	sleep 20;

	playerData = [name player, getPlayerUID player];

	publicVariableServer "playerData";

	playerData = nil;
};
  • Like 1

Share this post


Link to post
Share on other sites

Thanks for all your help, finally managed to get this to work! Definitely excited about that.

 

Somewhat related, does anyone know any good ways to get/set a loadout in script? There used to be a really get GET/SET Loadout script that was in the forums here, but it's not being updated any longer and unfortunately doesn't work. 

Is there a quick way or easier way of doing this?

Share this post


Link to post
Share on other sites

I have box and save box cargo .

call compile preProcessFile "\inidbi\init.sqf";
_array = [

(getWeaponCargo Storage_1),
(getMagazineCargo Storage_1),
(getItemCargo Storage_1),
(getBackpackCargo Storage_1)
];
    
_ret = ["locker", "GLOBAL", "Locker1", _array] call iniDB_write;

locker.ini

[GLOBAL]
Locker1="[[["arifle_MXC_ACO_F","hgun_Pistol_heavy_01_MRD_F"],[1,1]],[[],[]],[["FirstAidKit","V_BandollierB_rgr","U_B_CombatUniform_mcam","tf_anprc152_1","ItemGPS","ItemMap"],[1,1,1,1,1,1]],[[],[]]]"

How i can read this and refill box in game restart!?


 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×