Jump to content
  • 0

Is there a simple sql query that will delete certain cars / bikes?


garyr

Question

Hey guys, just a quick one.

 

I have been pondering on either getting rid of bikes / motorbikes or making them rather expensive as people currently buy them - then ditch them.

 

If there:

1.) Anyway to run a cleanup script that when run will get rid of the objects I want gone (bikes, mountain bikes etc)

2.) on this topic, if there anyway to delete a car / chopper etc if it has not been used for x amount of time?

3.) Even better, a script that can delete cars which are very broken, say missing 3+ wheels.

 

Have browsed the forums and net but not found anything that will solve the problem.

 

Thanks in advance,

Gary

 

EDIT:

Cant actually find the Mountainbike / Motorbike in the database even if I wanted to manually delete...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I am an amateur when it comes to SQL queries, but you may be able to try some of the following. Make sure you backup your DB before hand and review the syntax with some Google-fu!

 

The following SQL query will remove the record of all fully destroyed vehicles from the database: DELETE FROM 'object_data' WHERE Damage = 1;

 

For deleting stuff between a certain date range, I suppose you could use something like (not tested): DELETE FROM 'object_data' WHERE Damage = 1 AND Datestamp between '10/1/2013' and '10/31/2013';

 

For deleting objects with a specific classname you would want something like: DELETE FROM 'object_data' WHERE classname='Old_bike_TK_CIV_EP1';

 

To find the classname for the vehicles you are looking for you have two methods. The first is to look at the BIS Wiki (http://community.bistudio.com/wiki/ArmA_2:_Vehicles and http://community.bistudio.com/wiki/ArmA_2_OA:_Vehicles). The second is to go to the trader, who I believe also shows the classname of the vehicle.

 

You can mix and match this stuff up and then add it to the MySQL Event Scheduler to match your needs.

Link to comment
Share on other sites

  • 0

Well, if you take a look at the hitpoints column, it appears as though you can see how much health is left for each of the wheels. With that said, I suppose it would be possible to use a wild card (%) with something like: DELETE FROM 'object_data' WHERE hitpoints='%wheel%steering",0.7%'

 

I believe each of the wheels have a "1_1", "1_2", "2_1", "2_2", "1_3", "2_3" sort of designation, so putting a wildcard before wheel, between wheel and steering, and after the number, it would make it so just so long as any wheel is damaged above 70% it will cause the vehicle to be deleted. If you wanted to do two wheels hitpoints='%wheel%steering",0.7%wheel%steering",0.7%' may work. I do not know though!

 

Let me know if this does or does not work. I am interested to find out.

 

EDIT: I just reread this and realized that I made an incomplete thought. Using 0.7% will only will only work for wheels at 70% to 79% damage, you would need to do 0.8%, 0.9% and 1% to cover all everything above say 70%.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...