Got tired of dealing with AN2s stuck in trees around my map, so here's my solution. If players find a stuck plane they add some trash loot (empty tin cans, whisky bottles) to the inventory, and on the next restart it will be destroyed and respawned.
I created a stored procedure in the database called cleanup_AN2:
vehicle_id and world_id may need adjusted to fit your server.
Then, in my cleanup batch file that runs every reboot, I call the script
Make sure this is called BEFORE you call the db_spawn_vehicles.pl, so the AN2s get replaced on this restart.
Just implemented this a few minutes ago, but it looks to be working well so far.
I created a stored procedure in the database called cleanup_AN2:
Code:
update instance_vehicle
set damage = 1
where world_vehicle_id in (select id from world_vehicle where vehicle_id = 53 and world_id = 1)
and (inventory like '%trash%' or inventory like '%ItemSodaEmpty%');
Then, in my cleanup batch file that runs every reboot, I call the script
Code:
mysql --host=hive --user=xxxx --pass=xxxx --execute="call cleanup_AN2()" dayz_chernarus
Make sure this is called BEFORE you call the db_spawn_vehicles.pl, so the AN2s get replaced on this restart.
Just implemented this a few minutes ago, but it looks to be working well so far.