-FW- Shaanguy 10 Posted November 2, 2014 how to save a variable?, when i join the server, and when the server restart i want my variable to get save when server restart or when i get dissconect, i am sure this script would solve. :cryy: _uid = getPlayerUID player; Oh and i made a addaction call "save", when i click it, and the save script must be in %1.sqf Share this post Link to post Share on other sites
[evo] dan 79 Posted November 2, 2014 Use: https://community.bistudio.com/wiki/profileNamespace https://community.bistudio.com/wiki/saveProfileNamespace and maybe this one too: https://community.bistudio.com/wiki/missionNamespace (not tried this method myself) Share this post Link to post Share on other sites
654wak654 25 Posted November 2, 2014 Don't use the private variable "_uid" or "_id", they are reserved for some operations and using them might cause problems. [color=#FF8040][color=#006400][i]//For saving[/i][/color] [color=#191970][b]if[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#191970][b]isDedicated[/b][/color][color=#8B3E2F][b])[/b][/color] [color=#191970][b]then[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#1874CD]_pid[/color] [color=#8B3E2F][b]=[/b][/color] [color=#191970][b]getPlayerUID[/b][/color] [color=#000000]player[/color][color=#8B3E2F][b];[/b][/color] [color=#191970][b]profileNamespace[/b][/color] [color=#191970][b]setVariable[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"Shaan_pid"[/color][color=#8B3E2F][b],[/b][/color] [color=#1874CD]_pid[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#191970][b]saveProfileNamespace[/b][/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b];[/b][/color] [color=#006400][i]//For loading[/i][/color] [color=#191970][b]if[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#191970][b]isDedicated[/b][/color][color=#8B3E2F][b])[/b][/color] [color=#191970][b]then[/b][/color] [color=#8B3E2F][b]{[/b][/color] [color=#1874CD]_pid[/color] [color=#8B3E2F][b]=[/b][/color] [color=#191970][b]profileNamespace[/b][/color] [color=#191970][b]getVariable[/b][/color] [color=#7A7A7A]"Shaan_pid"[/color][color=#8B3E2F][b];[/b][/color] [color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter Share this post Link to post Share on other sites
Llano 11 Posted November 2, 2014 You could also store it in some kind of database. Share this post Link to post Share on other sites
MINKA 14 Posted November 3, 2014 I would suggest investing your time into learning MySQL or iniDB, Which are addons you can hold serversided and hold a database of information using the fn_MP function provided by BIS. Share this post Link to post Share on other sites