Sign in to follow this  
wilderness

SQL query to delete a particular item

6 posts in this topic

Hi everyone

So, we are removing the ADR mod from our server, and need to remove all incidences of the ADR weapons, mags and silencers from the database.

what sql query would I need to use to do this, baring in mind I only want to remove the items from players, vehicles and storage containers, I don't want to remove the actual containers, vehicles or players themselves (that I can do which is pretty easy, but it's not what I'm after) I'm a bit stuck on how to write a query to remove the said items from the actual containers etc.

If anyone could point me in the right direction it would be much appreciated, I do have a basic understanding of sql so only need a pointer.

many thanks

 

Share this post


Link to post
Share on other sites

Not sure how to remove the actual lines, since they are just spreaded in the DB by comma's. To make your life easier, you can just try:

select FROM container WHERE cargo_weapons LIKE '%ADR_%' 
select FROM player WHERE primary_weapon OR backpack_weapons LIKE '%ADR_%' 
select FROM vehicle WHERE cargo_weapons LIKE '%ADR_%' 

EDIT: do NOT use delete from, since this will delete the whole line. ;)

Not sure if ADR has pistols too? Then make a query for that too :)

This should give you the full list, then you have to delete them manually still, but it shouldn't be that much work. 

I'm not sure which syntax the ADR weapons use, so you need to fill that in for yourself :)

Edited by ILLUXNNN
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Works a treat, I just had to change

Quote

select FROM container WHERE cargo_weapons LIKE '%ADR_%'

to

Quote

select * FROM container WHERE cargo_weapons LIKE '%SMG_03_black%'

for the containers, and did similar for vehicles and players and bingo, saved me an absolute tonne of time :)

Thanks again buddy

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.