Jump to content

Vehicles disappearing


Recommended Posts

It's caused by this inside server_updateObject.sqf

if (_isNotOk) exitWith { deleteVehicle _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]); };

I have it commented out with // just because it keeps deleting stuff that does not have an invalid id.

Link to comment
Share on other sites

Ok, when I comment that out, the vehicle doesn't despawn, but if I get in, I die and the vehicle explodes. Here's the log:

18:09:59 "Vehicle killed: Vehicle 1aec3040# 1062085: hmmwv.p3d REMOTE (TYPE: HMMWV_DZ), CharacterID: 0, ObjectID: 0, ObjectUID: 0, Position: [12997.9,10074.7,0.144448]"
18:09:59 "PDEATH: Player Died 76561197975079952"
Link to comment
Share on other sites

Does it say "CLEANUP: Killing a hacker" in your logs anywhere? If so, check for 

	if (!((isNil "_x") || {(isNull _x)})) then {
		if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle)) then {
			//diag_log ("CLEANUP: KILLING A HACKER " + (name _x) + " " + str(_x) + " IN " + (typeOf vehicle _x));
			//(vehicle _x) setDamage 1;
			//_x setDamage 1;
			//sleep 0.25;
		};
	};

in server_functions.sqf and comment out what I have commented out.

Link to comment
Share on other sites

It seems to me like you could fix your issue by assigning the vehicle an ObjectID and ObjectUID value that is greater than 0 then adding them to the PVDZE_serverObjectMonitor array.

myvehicle setVariable ["ObjectID",str(ceil(random 99999)),true];
myvehicle setVariable ["ObjectUID",str(ceil(random 99999)),true];
PVDZE_serverObjectMonitor set [(count PVDZE_serverObjectMonitor),myvehicle];

This should allow you avoid removing things that are designed to stop hackers.

Link to comment
Share on other sites

Well I suppose it's all to stop hackers and is a remnant from the DayZ vanilla mod days. Altough I'm not sure :)

 

Well, there's no "Killing a hacker" in the log. Only the previously mentioned "Vehicle Killed", etc. I haven't done many missions lately but I know I've never had this problem in the past. 

Link to comment
Share on other sites

Could the fact that I'm specifying coordinates, rather than making it random, cause a problem? Here's where I'm creating the vehicles:

 

_veh1 = ["small"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[12997.872, 10074.729, -2.1457672e-005],[], 0, "CAN_COLLIDE"];
_vehicle setDir 6.8135815;
_veh2 = ["fuel"] call DZMSGetVeh;
_vehicle2 = createVehicle [_veh2,[12985.497, 10095.752, 3.3378601e-006],[], 0, "CAN_COLLIDE"];
_vehicle2 setDir 110.71783;
_vehicle2 setFuel 0;

I created a "fuel" category for vehicles that has all of the fuel trucks in it so it randomly picks one to spawn.

Link to comment
Share on other sites

Ok, I'm an idiot. :)

 

I based this mission off of a mission without vehicles so I was missing this section:

//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_vehicle] call DZMSSetupVehicle;
[_vehicle2] call DZMSSetupVehicle;

Add that and it now works fine. 

 

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...