Author: Linnet
Author Website: http://www.infecto.se

Version: 0.1.3

Short description: Life mission statsave
Date: 2013-08-11 13:16
Submitted by: Linnet


Comments: (0)
Rating:



 



SQL-Life

by
Linnet


Description:
Hello there arma community, I've been working on a stat saver for life missions using Arma2Net (ScottNZ) & Arma2MySQL (Firefly2442), thanks to them for creating such awesome additions to the arma community!
Before I go any further I'd just like to say that the latest version has not yet been tested with a full server, so far only with 25-30 people however it worked rather well then. So if you are intrested in implementing this it might contain bugs, exploits or may not even work at all!


Features:
-Saves your inventory, bank account, licenses, streetrep (this is our own stat that we created for our server you can edit -this out easily)
-Comes with a premade loading screen & dialog for stat saving.
-Save one car of your choice and puts it back in the impound lot after a restart.


Installation:
Before anything backup all your mission files.
Since you've now backed up your mission files lets get started on starting it!
First of all add this to your description.ext
#include "statsave\dialogs\savemenu.hpp"
Now lets continue to the init file. The way I initialize it I add this to the bottom of my init.sqf
if (isServer) then 
{
_h = execVM "statsave\server\savefunc.sqf";
waitUntil{scriptDone  _h};
_h = execVM "statsave\server\serverevents.sqf";
waitUntil{scriptDone  _h};
};
if(!dedicatedserver) then
{
waitUntil {alive player};
execVM "statsave\saveinit.sqf";
};
Initialization can be done diffrent ways, you chose how you wish to do it!
Cool now we're almost ready to go!

The last step is to start the dialog to save somewhere now to add the script to say an ATM or similar things is not included in this and you will have to do yourself. But to test the dialogs/stat save
you can start the dialog with this.
[] execVM "statsave\dialogs\savomat.sqf";

Optional:
I add this to the bottom of my init to disable the update stats button for 5 seconds (This is to stop people spamming it causing lag).
disableSerialization;
while {true} do
{
	waitUntil {!(isNull (findDisplay 70001))};
	((findDisplay 70001) displayCtrl 153040) ctrlEnable false;
	_time = time;
	waitUntil {(isNull (findDisplay 70001)) || time >= _time + 5};
	if (!(isNull (findDisplay 70001))) then
	{
		((findDisplay 70001) displayCtrl 153040) ctrlEnable true;
		waitUntil {isNull (findDisplay 70001)};
	};
};
IMPORTANT: All of the variables used such as kontostand or INV_InventarArray can be diffrent on your specific mission and you will need to change them to your mission variables. I tested this stat save on TCG's Island life mission.


Notes:
No notes yet!


Credits & Thanks:
ScottNZ for creating Arma2Net
Firefly2442 for creating Arma2Mysql


Change log:
v0.1.3
-Insert has been improved to be more efficent.

v0.1.2
- Fixed car saving (this includes the dialog saving).
- Added recreating vehicle function which puts it back to the impound lot after a restart. (IMPORTANT: This command is specificly for Island life you will need to change this accordingly to your mission variables. Look into createfunctions.sqf)

v0.1.1
- Fixed an issue where user input would not be enabled after creating a new profile.

v0.1
- Test release


Forums Topic:
- BI forums



- Arma2NET
- Community Base Addons
- Arma2MySQL

Arma2MySQL note: You need the latest Async development branch and follow the instructions in the readme on how to install it.




Download from FTP #1:
SQL-Life
Download from FTP #2:
SQL-Life
Download from FTP #3:
Size : 1 MB   Downloaded : 442 times     Report broken download link



Tags: Database,   Sql,   Save,   Stat