42 - chat command to clear certain character data
If you delete character it's data will remain in database. Because you cannot log in to that character anymore to get rid off that toon's info without wiping whole database add slash command like /bi clear charactername. It will wipe data of charactername from current realm.
Below is fragment of code to put inside function BankItems_SlashHandler():
elseif strfind(msg, "clear (.*)") then local selfPlayerRealm = strtrim(GetRealmName()) local p1, p2 = strmatch(msg, "clear (.)(.*)") if not p1 or not p2 then return end -- names are at least 2 chars long local playerName = strupper(p1)..p2.."|"..selfPlayerRealm for key, value in pairs(BankItems_Save) do if type(value) == "table" and key == playerName then BankItems_DelPlayer(key) end end return
Place above code before
elseif msg == "clearall" then
line.
Also you can add
BankItems_Chat(L["-- /bi clear character : clear character's info"])
in same function.
| User | When | Change |
|---|---|---|
| Mornadan | Jan 07, 2014 at 00:02 UTC | Create |
Facts
- Reported
- Jan 07, 2014
- Status
- New - Issue has not had initial review yet.
- Type
- Enhancement - A change which is intended to better the project in some way
- Priority
- Medium - Normal priority.
- Votes
- 0