• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua [TFS 1.2] Delete certain items from players depot

Siegh

Thronar Developer
Joined
Mar 12, 2011
Messages
1,276
Solutions
1
Reaction score
635
Location
Brazil
Hello, again, I'm really asking for a lot lately.

I had an issue today where certain items were acquired through unnoficial means and I'd like to remove a list of these items from my players' depots. Is there a way to do that?
 
Solution
Make sure you replace 1000 with your desired item id. And don't forget to create a backup incase you mess things up...
You should also research about SQL transactions.

To search
SQL:
SELECT * FROM `player_depotitems` WHERE `itemtype` = 1000

To delete (irreversible)
SQL:
DELETE FROM `player_depotitems` WHERE `itemtype` = 1000

(If you execute a SQL command whilst your server is online, and a player is logged in, they will overwrite your executed action whenever they logout. So make sure to do this either while the server is offline, or no players are logged in)
You can check your DB, I think the items are saved under player_items or player_depotitems~
When you know where you can just run a query to delete the items
 
You can check your DB, I think the items are saved under player_items or player_depotitems~
When you know where you can just run a query to delete the items
I have never had to run a query on the DB before, could you please exemplify how to search for and delete a specific item id please?
 
Make sure you replace 1000 with your desired item id. And don't forget to create a backup incase you mess things up...
You should also research about SQL transactions.

To search
SQL:
SELECT * FROM `player_depotitems` WHERE `itemtype` = 1000

To delete (irreversible)
SQL:
DELETE FROM `player_depotitems` WHERE `itemtype` = 1000

(If you execute a SQL command whilst your server is online, and a player is logged in, they will overwrite your executed action whenever they logout. So make sure to do this either while the server is offline, or no players are logged in)
 
Solution
Make sure you replace 1000 with your desired item id. And don't forget to create a backup incase you mess things up...
You should also research about SQL transactions.

To search
SQL:
SELECT * FROM `player_depotitems` WHERE `itemtype` = 1000

To delete (irreversible)
SQL:
DELETE FROM `player_depotitems` WHERE `itemtype` = 1000

(If you execute a SQL command whilst your server is online, and a player is logged in, they will overwrite your executed action whenever they logout. So make sure to do this either while the server is offline, or no players are logged in)
That worked ou perfectly, thanks a lot!
 
Back
Top