MrNeal

Removal of RHS equipment and vehicles from database

3 posts in this topic

Hi,

I have removed RHS for my server and obviously, there are a lot of players with RHS weapons, ammo and vehicles etc. 
Would anyone help me with a query to remove anything starting with RHS. I don't know if you can use wildcards with database queries and have zero experience so would obviously make a backup and would prefer to test of one player first.

 

Thanks

Share this post


Link to post
Share on other sites

Removing Vehicles is one thing, but coming up with a query to run that will remove the wild card for RHS and the value of the ammo or item counter is another thing. You may end up just biting the bullet and and nuking all players and containers that contain a RHS item in the end. in which case you would run something like this:

DELETE FROM player WHERE primary_weapon LIKE 'RHS%' OR assigned_items LIKE 'RHS%' OR backpack LIKE 'RHS%' OR backpack_items LIKE 'RHS%' OR backpack_magazines LIKE 'RHS%' OR backpack_weapons LIKE 'RHS%' OR current_weapon LIKE 'RHS%' OR goggles LIKE 'RHS%' OR handgun_items LIKE 'RHS%' OR handgun_weapon LIKE 'RHS%' OR headgear LIKE 'RHS%' OR binocular LIKE 'RHS%' OR loaded_magazines LIKE 'RHS%' OR primary_weapon LIKE 'RHS%' OR primary_weapon_items LIKE 'RHS%' OR secondary_weapon LIKE 'RHS%' OR secondary_weapon_items LIKE 'RHS%' OR uniform LIKE 'RHS%' OR uniform_items LIKE 'RHS%' OR uniform_magazines LIKE 'RHS%' OR uniform_weapons LIKE 'RHS%' OR vest LIKE 'RHS%' OR vest_items LIKE 'RHS%' OR vest_magazines LIKE 'RHS%' OR vest_weapons LIKE 'RHS%'

DELETE FROM container WHERE cargo_items LIKE 'RHS%' OR cargo_magazines LIKE 'RHS%' OR cargo_weapons LIKE 'RHS%'

DELETE FROM vehicle WHERE class LIKE 'RHS%'

You could easily run the Vehicle one and be fine, but then you would still need to worry about what's inside the remaining vehicles. And if you were to use Navicat or HeidiSQL to find and replace individual class names of the items, you would still be left with the quantity and end up with a broken database. An example of what I'm talking about is in the database we can search for the class name 150Rnd_93x64_Mag and replace it with a blank entry, but we would still be left with [["",150]] the amount of ammunition. If it were me, I would nuke the database of all traces and comp for the change.

Edited by Beowulfv
  • Like 1

Share this post


Link to post
Share on other sites

@Beowulfv

Thanks, my best option was to remove all traces of RHS via the database and with your help was easy. I only had to update this 'RHS%' to '%RHS%' to get rid of the last few.

Thank you for your time you were very helpful 

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.