V1.1 Vehiclerespawn

  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

V1.1 Vehiclerespawn

« posted: Jan 14, 2015, 01:59 PM »
Rev,

In version 1.1 you completely revamped the vehicle respawn system. In the mission we use I implemented a changeowner script so that players can put town spawned vehicles on their name. After they have done this the vehicle saves in the database because an ownerUID is set to it. To prevent the vehicle from despawning I implemented (with help from this forum) the following check to stop the despawning of owned town vehicles in vehicle.sqf:
Code: [Select]
// Check if owned vehicle. Added for not despawning owned town vehicles.
if ((alive _veh) && {not(isNil {_veh getVariable "ownerUID"})}) then {
    _dead = false;
};

How would I go about implementing this check in the new vehicle respawn system without breaking it? My guess is that this check, or something like it should be added to vehiclerespawnmanager.sqf
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: V1.1 Vehiclerespawn

« Reply #1 posted: Jan 14, 2015, 03:59 PM »
Would this work? Addition to the vehiclerespawnmanager.sqf
Code: [Select]
// Check if vehicle is not being towed or moved or owned
if (isNull (_veh getVariable ["R3F_LOG_est_transporte_par", objNull]) &&
isNull (_veh getVariable ["R3F_LOG_est_deplace_par", objNull]) || isNull (_veh getVariable ["ownerUID", objNull])) then
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2571

Re: V1.1 Vehiclerespawn

« Reply #2 posted: Jan 14, 2015, 07:58 PM »
&& isNil {_veh getVariable "ownerUID"}) then
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: V1.1 Vehiclerespawn

« Reply #3 posted: Jan 14, 2015, 08:59 PM »
Thanks Rev :-*