Midnighters 152 Posted March 4, 2017 Hello, I was wondering if there was the possibility of getting a variable to be persistent through a mission restart. I want the player's inventory to be saved and then reloaded when connecting back. Any ideas? Share this post Link to post Share on other sites
froggyluv 2130 Posted March 4, 2017 https://community.bistudio.com/wiki/uiNamespace Share this post Link to post Share on other sites
Midnighters 152 Posted March 4, 2017 1 minute ago, froggyluv said: https://community.bistudio.com/wiki/uiNamespace Oh sweet! Totally skimmed over this, much appreciated :) 1 Share this post Link to post Share on other sites
serena 150 Posted March 4, 2017 // save loadout profileNamespace setVariable ["PlayerLoadout", getUnitLoadout player]; // restore loadout profileNamespace getVariable "PlayerLoadout" call {player setUnitLoadout _this}; // reset loadout profileNamespace setVariable ["PlayerLoadout", nil]; Share this post Link to post Share on other sites
Midnighters 152 Posted March 4, 2017 1 hour ago, serena said: // save loadout profileNamespace setVariable ["PlayerLoadout", getUnitLoadout player]; // restore loadout profileNamespace getVariable "PlayerLoadout" call {player setUnitLoadout _this}; // reset loadout profileNamespace setVariable ["PlayerLoadout", nil]; Thanks for the usage. This actually clears up some problems I had been running into, I appreciate both of your help. Share this post Link to post Share on other sites
Midnighters 152 Posted March 4, 2017 2 hours ago, serena said: // save loadout profileNamespace setVariable ["PlayerLoadout", getUnitLoadout player]; // restore loadout profileNamespace getVariable "PlayerLoadout" call {player setUnitLoadout _this}; // reset loadout profileNamespace setVariable ["PlayerLoadout", nil]; 3 hours ago, froggyluv said: https://community.bistudio.com/wiki/uiNamespace Upon loading in, the player doen't have the weapon saved upon disconnect. Any ideas? The player acts like he has a gun at first, then puts away i'd say an 'invisible gun' ? Share this post Link to post Share on other sites
serena 150 Posted March 4, 2017 Are you sure that: Your gear have been saved before you disconnect (commands are executed properly and profile namespace contains saved data) Saved data extracted and applied when you resume mission (commands are executed properly and profile namespace contains saved data) Share this post Link to post Share on other sites
Midnighters 152 Posted March 4, 2017 I got it working now, thanks! Share this post Link to post Share on other sites