Jump to content
  • 0

Adding new function to server_updateObject.sqf (no update information in db)


hekut146

Question

Please help, i add new function to server_updateObject.sqf, no saving info to db (update) 

Part script:

PVDZE_veh_Update = [_object,"all2"];
publicVariableServer "PVDZE_veh_Update";

server_updateObject.sqf (case):

case "all2": {
        call _object_position2;
};

server_updateObject.sqf (function):

_object_position2 = {
    private["_worldspace","_fuel","_key"];
    _worldspace = _object call serializeExtendedObjectData;
    
    diag_log "_worldspace";
    diag_log _worldspace;
    
    _fuel = 0;
    if (_object isKindOf "AllVehicles") then {
        _fuel = fuel _object;
    };

    diag_log "_fuel";
    diag_log _fuel;
    
    _key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
    
    diag_log "_key";
    diag_log _key;
    
    //diag_log ("HIVE: WRITE: "+ str(_key));
    _key call server_hiveWrite;
    
    diag_log "_key";
    diag_log _key;
};

Info generate normal, no save to db, no error in logs (client/server/hive)...

Edited by hekut146
Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

You define object_position2 as a function but you are calling _object_position2 which does not exist. Also object_position2 is never passed the variable containng the _object. You, also, cannot pass a non-string value or variable to diag_log (diag_log _fuel), if it is a non-string value or variable it must first be transformed into a string.
Also, what is serializeExtendedObjectData?

Link to comment
Share on other sites

  • 0

my script call 

case "all2": {
        call _object_position2;
};

and this case call function

object_position2 = {

i write object_position2 (function) in script server_updateObject.sqf (in first message in this trade)

Edited by hekut146
Link to comment
Share on other sites

  • 0
private["_vehicleLock","_skinFiles","_animationStates","_position","_worldspace","_fuel","_key","_vectorFix","_dirFix","_lockFix"];
_object = _this;
_position = _object getVariable ["extendedPos",getPosATL _object];
_ownerPUID = _object getVariable ["ownerPUID",""];
_skinFiles = _object getVariable ["skinFiles",[]];
_animationStates = _object getVariable ["animationStates",[]];
_buildStage = _object getVariable ["buildStage", 0];
_attachedObjects = [];
_dirFix = getDir _object;
_vectorFix = [1,0,[],[],[]];
_lockFix = 1;

_worldspace = [
	_dirFix,
	_position,
	_vectorFix,
	_ownerPUID,
	[
		_lockFix,
		_buildStage,
		_skinFiles,
		_animationStates,
		_attachedObjects
	]
];

_worldspace

this serializeExtendedObjectData 

Edited by hekut146
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...