Jump to content
Erzengel

Export Vehicles and Player - stats to DB

Recommended Posts

Hi, i was wondering if anyone knows about a "preset" mission or addon that allows the save of vehicle and player position as well as the inventory. I allready googled quite some time, set um different versions of extDB and i managed to get the character saving properly but not the vehicles .. I would be very happy if someone could explain me how to do (like show me your safe funktions) or get me a link to such an addon.

 

I would prefer extdb 3 about inidbi or savestats.

Share this post


Link to post
Share on other sites

Have a look at a3 wasteland it has a good vehicle and player save system using inidb

Share this post


Link to post
Share on other sites
Just now, KevsNoTrev said:

Have a look at a3 wasteland it has a good vehicle and player save system using inidb

The problem is iam building an mod and i realy dont want to base that on a mod with reward for kills or anything but. But thanks for your hint anyways

Share this post


Link to post
Share on other sites

If you already have players saving, you already know how to pass things back and forth.

 

What part of saving and loading vehicles are you stuck on?   

Share this post


Link to post
Share on other sites

i dont know how to get the vehicle hitpoints (damage), the inventory of an vehicle .. ich did know some stuff from arma 2 for the players so after reading some tutorials i got that set up but i never did anything with vehicles only player and objects

Share this post


Link to post
Share on other sites
13 minutes ago, Erzengel said:

i dont know how to get the vehicle hitpoints (damage), the inventory of an vehicle .. ich did know some stuff from arma 2 for the players so after reading some tutorials i got that set up but i never did anything with vehicles only player and objects

get the damage and store it with the vehicle https://community.bistudio.com/wiki/getDammage

get the items https://community.bistudio.com/wiki/getItemCargo

wepons https://community.bistudio.com/wiki/getWeaponCargo

do same for the other crap

Share this post


Link to post
Share on other sites

Okay.  May want to lead with what you need next time. :)

 

Here is how I do it on my servers.    The big issue with this code right now is attachments on weapons will be lost.  I'm working on that now.

	_pos = getpos _object;
	_vect = [vectordir _object,vectorUp _object];
	_dam = [damage _object,getAllHitPointsDamage _object];
	_inv = [getItemCargo _object, getBackpackCargo _object, getMagazineCargo _object, getWeaponCargo _object];
	_vinv = _object getVariable ["VINV",[]];
	_class = str typeof _object;
	_stat = _object getVariable ["STAT",[]];
	
	[format["UPDATE `objects` SET `POS` = '%1', `VECT` = '%2', `DAM` = '%3', `INV` = '%4', `VINV` = '%5', `CLASS` = '%6', `STAT` = '%7' WHERE `OID` = '%8'",_pos,_vect,_dam,_inv,_vinv,_class,_stat,_OID],false] spawn db_fnc_DBQuery;
	

 

 

 

 

Share this post


Link to post
Share on other sites
On 2.6.2018 at 11:56 PM, wyattwic said:

Okay.  May want to lead with what you need next time. :)

 

Here is how I do it on my servers.    The big issue with this code right now is attachments on weapons will be lost.  I'm working on that now.


	_pos = getpos _object;
	_vect = [vectordir _object,vectorUp _object];
	_dam = [damage _object,getAllHitPointsDamage _object];
	_inv = [getItemCargo _object, getBackpackCargo _object, getMagazineCargo _object, getWeaponCargo _object];
	_vinv = _object getVariable ["VINV",[]];
	_class = str typeof _object;
	_stat = _object getVariable ["STAT",[]];
	
	[format["UPDATE `objects` SET `POS` = '%1', `VECT` = '%2', `DAM` = '%3', `INV` = '%4', `VINV` = '%5', `CLASS` = '%6', `STAT` = '%7' WHERE `OID` = '%8'",_pos,_vect,_dam,_inv,_vinv,_class,_stat,_OID],false] spawn db_fnc_DBQuery;
	

 

 

 

 

allright :) i will give it a shot :D

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

×