Automatic Vehicle Respawns

Swarles

New Member
Hi all!

I have been looking for a while but coming up with nothing helpful.

I run a PvP Private hive with 500+ Vehicles on 1.7.7.1.

Currently we have automatic restarts every 2 hours.What I am trying to do is have ALL vehicles be deleted and then Spawned again in their original spots with full health and fuel. Right now go into the DB and just truncate the instance_vehicle table and then go into my providers "spawn vehicles now" button.

I'm looking for automation. Any help would be much appreciated
 
Could make a SQL script that does it.

First part you will need to do is dump a full table with all vehicles exactly as you want them.
Save this as a SQL file. Set the mode to insert+replace. Also set it to Drop table and create table.

I use HeidiSQL.

Copy and paste this above the below code.

Something like;

Code:
[INSERTED VALUES FROM SQL FILE]
 
UPDATE `instance_vehicle` SET `damage`=1

Do you run dedicated? If so you can make a batch file that executes this as a proceedure.

Log into your SQL Manager.

Create a new proceedure - Call it whatever - For now we will call it repairVehicles

Code:
BEGIN
 
[INSERTED VALUES FROM SQL FILE]
 
UPDATE `instance_vehicle` SET `damage`=1
 
END

Then make a batch file with this;

Code:
cd /d "INSERT YOUR MYSQL DIR"
mysql.exe --user=USERNAME --password=PASSWORD --execute="call repairVehicles()" DATABASENAME

This can then be added to your restart script by;

Code:
set externalbat=BATCHPATH
if not "%externalbat%" == "0" (start %externalbat%)

That should work nicely :)
 
Is it possible to do this , but only respawn destroyed vehicles and damaged vehicles with empty inventories?
 
Could make a SQL script that does it.

First part you will need to do is dump a full table with all vehicles exactly as you want them.
Save this as a SQL file. Set the mode to insert+replace. Also set it to Drop table and create table.

I use HeidiSQL.

Copy and paste this above the below code.

Something like;

Code:
[INSERTED VALUES FROM SQL FILE]
 
UPDATE `instance_vehicle` SET `damage`=1

Do you run dedicated? If so you can make a batch file that executes this as a proceedure.

Log into your SQL Manager.

Create a new proceedure - Call it whatever - For now we will call it repairVehicles

Code:
BEGIN
 
[INSERTED VALUES FROM SQL FILE]
 
UPDATE `instance_vehicle` SET `damage`=1
 
END

Then make a batch file with this;

Code:
cd /d "INSERT YOUR MYSQL DIR"
mysql.exe --user=USERNAME --password=PASSWORD --execute="call repairVehicles()" DATABASENAME

This can then be added to your restart script by;

Code:
set externalbat=BATCHPATH
if not "%externalbat%" == "0" (start %externalbat%)

That should work nicely :)
Bad idea.

#1 You set `damage` to 1. Which means destroyed.
#2 If a person crashes a helicopter into trees. You will fix it, but there is no way you're going to get it to lift off.


#OP If you're using Reality, try create a bat file that runs the db_spawn_vehicles.pl before it actually starts the server.
 
Dose this work? I've tried loads of things to try and get vehicles that i imputed through the editor to respawn and nothing. All i want is for damaged vehicles, heli's etc to respawn on restarts only when they are blown up.
 
Back
Top