Hey,
I'm trying to spawn Vehicles via SQF file so that they will be back every Server restart.
The vehicles I spawn like this:
_vehicle_1 = objNull; if (true) then { _this = createVehicle ["VEHICLEXYZ", [15286.053, 80.74379, 529.44104], [], 0, "CAN_COLLIDE"]; _vehicle_1 = _this; _this setDir 89.986031; _this setPos [15286.053, 80.74379, 529.44104]; };
Just like you would a normal object like a house or a supermarket.
The vehicle is there I can get in and fly/drive it but if it takes any damage even if someone with a makarov shoots it it will just dissapear and I will get the animation you do when you exit the vehicle. I guess it's because it's not in the Database and when it takes damage that triggers and eventhandler which checks to see if the vehicle is valid which it isn't so it just gets rid of it.
I already tried editing the DayZ_Server.pbo/server_updateObject.sqf
and I edited the following line:
//Check if object has an ignore flag, set to false as the default// _ignoreThis =_object getVariable ["ignoreThis",false]; if (_ignoreThis) exitWith {}; if ((typeName _objectID != "string") || (typeName _uid != "string")) then { diag_log(format["Non-string Object: ID %1 UID %2", _objectID, _uid]); //force fail _objectID = "0"; _uid = "0"; }; if (!_parachuteWest) and !(locked _object)) then { if (_objectID == "0" && _uid == "0") then { _object_position = getPosATL _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]", typeOf _object, _object_position select 0, _object_position select 1, _object_position select 2]); _isNotOk = true; }; }; // do not update if buildable and not ok if (_isNotOk and _isbuildable) exitWith { }; // delete if still not ok if (_isNotOk) exitWith { deleteVehicle _object; };
Anyone got any idea which server files I would have to edit to stop it from checking if the vehicle is valid or maybe that it just ignores that it is invalid and let's it "exist".
Would be glad if anyone could help!