[Request] Vehicles

Hello

How would i go about setting up a system so that vehicles that havn't been touched in say 3 days get deleted im tired of vehicles just getting abandoned cmpletely damaged and then theres no vehicles left that can go to use.

Thanks <3
 
delete from instance_vehicle where last_updated < (now() - interval 3 day);

if you want to start it via batch file:
cd /d C:\your\mysql\bin\path
mysql.exe -u db_user -pdb_pass -Ddb_name < C:\path\to\this\command\in_a.txt
 
delete from instance_vehicle where last_updated < (now() - interval 3 day);

if you want to start it via batch file:
cd /d C:\your\mysql\bin\path
mysql.exe -u db_user -pdb_pass -Ddb_name < C:\path\to\this\command\in_a.txt

Quick Question where do i put that command in?
I dont think i can use the second method because i am hosting from dayz.st

Thanks
 
Code:
DELETE FROM instance_vehicle
WHERE ((now() - `instance_vehicle`.`last_updated`) > 5000000)

In your database drop this query into your sql section and execute it is one way of doing it. Note: 5000000= 5 days no interaction with vehicle.

I personally have a .bat file setup to excute this with BEC before server restarts.

On dayz.st you won't be able to do it that way though. You will have to manually execute the above query in your Database.
 
Ok thanks it worked 1 last question do i have to put that in manually each time or is it automatic? Im such a noob :(

In your case because you don't have access to the desktop because you are sharing a server with 20+ other dayz.st customers you can't create a .bat file that you could run automatically. So yes you will have to run it manually every time you want to clear abandoned vehicles. Change the "5" to however many days you want to be what you considered "abandoned"
 
One last thing you say 5000000 is 3 days how do i work this out because its not in seconds im not sure how sql durations work?

Thanks
 
One last thing you say 5000000 is 3 days how do i work this out because its not in seconds im not sure how sql durations work?

Thanks

5000000 is 5 days. Which if you refer back to my previous post that's what it says. Not sure where you got 3 days from.
 
Back
Top