Jump to content
  • 0

Save to hive


meanbeandk

Question

5 answers to this question

Recommended Posts

  • 0

just spawn it in then look at it and press insert then ok. done.

That's only if you have infistar AH tools...

 

 

Hi i am trying to get this to save to the database

_crate = "FlagCarrierCDF_EP1" createVehicle (position player);
_crate setVariable ["Mission",1,true];


_crate attachto [player, [0,3,3.5]];
sleep 10;
detach _crate;
player reveal _crate;

hope some one kan help me

You need to create nested array and send public var:

https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_server/compile/server_publishObject.sqf

PVDZE_obj_Publish = [_charID,_object,[_direction,_location],_classname]; //create array
publicVariableServer "PVDZE_obj_Publish"; //ask server to save it to database

So, something like this:

private ["_classname","_crate","_pos","_crateDir","_crateLoc"]; //needed to avoid corrupted vars
_classname = "FlagCarrierCDF_EP1";
_pos = [player] call FNC_GetPos; //will work on water, too
_crate = _classname createVehicle [(_pos select 0),(_pos select 2) + 2,(_pos select 2)]; //create 2 meters in front of player
_crate setVariable ["Mission",1,true];
player reveal _crate; //make it available sooner (gear menu etc)
_crateDir = getDir _crate; //grab the new dir and loc for DB
_crateLoc = [_crate] call FNC_GetPos;

sleep 1; //give it a second (or more) for slower machines/network

PVDZE_obj_Publish = [0,_crate,[_crateDir,_crateLoc],_classname]; //compose an array of gathered info
publicVariableServer "PVDZE_obj_Publish"; //ask server to save it to database
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...