Search the Community
Showing results for tags 'playernamespace'.
Found 1 result
-
Need help with Playernamespace for Heroes Survive
MuRaZorWitchKING posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello all, I recently have started utilizing Heros Survive and am looking into Saving some important variables via playernamespace, as I'm going to be running it via a dedicated server. Any and all help is seriously appreciated as I think my error is possibly due to the fact that HS uses client side vars? @Sgt Bombadil was helping out, but we haven't figured it out yet. initplayerlocal.sqf: [] execVM "persistency db\savedb.sqf"; private ["_player"]; _player =_this select 0; waitUntil {!isNull _player}; if (isNil {profileNamespace getVariable "HALs_money_funds"}) then { profileNamespace setVariable ["HALs_money_funds", 0]; }; _profile = (profileNamespace getVariable "HALs_money_funds"); _player setVariable ["HALs_money_funds", _profile]; //Heroes Survive persistentcy system: //Hunger if (isNil {profileNamespace getVariable "Her_L_Hunger"}) then { profileNamespace setVariable ["Her_L_Hunger", 100]; }; _profile = (profileNamespace getVariable "Her_L_Hunger"); Her_L_Hunger = 100; //thirst if (isNil {profileNamespace getVariable "Her_L_Thirst"}) then { profileNamespace setVariable ["Her_L_Thirst", 100]; }; _profile = (profileNamespace getVariable "Her_L_Thirst"); Her_L_Thirst = 100; //Temperature if (isNil {profileNamespace getVariable "Her_L_BodyTemp"}) then { profileNamespace setVariable ["Her_L_BodyTemp", 37]; }; _profile = (profileNamespace getVariable "Her_L_BodyTemp"); Her_L_BodyTemp = 37; savedb.sqf: [] spawn { waitUntil {!isNull(findDisplay 46)}; (findDisplay 46) displayAddEventHandler ["KeyDown", { if(_this select 1 == 1) //esc key then { [] execVM "Persistency db\autosave.sqf"; }; }]; }; Autosave.sqf: _moneys = (player getVariable "HALs_money_funds"); profileNamespace setVariable ["HALs_money_funds", _moneys]; _Hunger = (player getVariable "Her_L_Hunger"); profileNamespace setVariable ["Her_L_Hunger", _Hunger]; _Thirst = (player getVariable "Her_L_Thirst"); profileNamespace setVariable ["Her_L_Thirst", _Thirst]; _TemperatureH = (player getVariable "Her_L_BodyTemp"); profileNamespace setVariable ["Her_L_BodyTemp", _TemperatureH]; HALs money is saving perfectly, it's only the "Her_L" vars that are not working properly. Thanks again- 4 replies
-
- scripts
- heros survive
-
(and 1 more)
Tagged with: