• 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!

TFS 1.X+ How do i delete an equipped item off a character? unequippable glitched wand

nugo

Australia OT Mapper
Joined
Apr 1, 2009
Messages
398
Solutions
4
Reaction score
196
A player on my server that has a wand he used fine for days glitch on him after he logged out, all thats left in his left hand slow is a picture of a monster and a glitched item. He cant interact with the item, cant move it and cant move anything into its place, its essentiall stuck. I know player_items table stores items in peoples inventory and depos but how do i delete that wand slot?

using TFS 1.2

Thanks

Bonus points if you can tell me why the wand glitch, it was an energized limb.

 
Last edited:
Solution
player:getSlotItem(CONST_SLOT_LEFT):remove()
If it's another player, use Player('player name here'):getSlotItem(CONST_SLOT_LEFT):remove() instead.
player:getSlotItem(CONST_SLOT_LEFT):remove()
If it's another player, use Player('player name here'):getSlotItem(CONST_SLOT_LEFT):remove() instead.
 
Solution
Cheers, ill give that a go. Out of curiosity for future stuff can you do it with a mysql queery, are player items in their slots stored in the database?

EDIT: Cheers that script did the job, appreciate it.
 
Last edited:
Yes it's stored in the database, but I don't have any test server for myself so I couldn't tell you the exact way. I believe you cross reference the inventory slot with the pid or sid to get the location of the item and just match for the item id you want to remove in that slot. But like I said, I can't be definitive since I'm working from memory here and haven't had a test server in about a month.
 
Use this function and talkaction:
only work with items on inventory
 
Last edited:
Bonus points if you can tell me why the wand glitch, it was an energized limb.

I haven't quite gotten to the bottom of this, but I'm experiencing the same issue with items in backpacks/equip slots, that have an id of greater than 32767, which happens to be the max value for a 16 bit int (signed short), and this also happens to be the id of the item that appears instead. Still looking for the culprit, but I assume it's connected to the extended items dat/spr or how (in my case) otc handles those.

Edit:
Actually, the answer can be found here.
 
Last edited:

Similar threads

  • Question Question
Replies
2
Views
145
Back
Top