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

Find Outfit Storage ID's & Addons

don't know what you mean by storage id having anything to do with outfits but but i made something to get a list of player outfits before
Lua:
local match = string.match
local find = string.find
local gsub = string.gsub
local tonumber = tonumber
local hasOutfit = Player.hasOutfit

function Player.getOwnedOutfits(self)
    local outfits = table.create(200, 0)
    local sexPattern = 'type="'..self:getSex()..'"'
    local lookPattern = 'looktype="(%d*)"'
    local file = io.open([[data/xml/outfits.xml]])
    local str = file:read("*a")
    local i, j = find(str, sexPattern)
    file:close()
    while (i and j) do
        local _i, _j = find(str, sexPattern, j)
        local looktype = tonumber(match(str, lookPattern, i))
        if not outfits[looktype] then
            for addon = 3, 0, -1 do
                if hasOutfit(player, looktype, addon) then
                    outfits[looktype] = addon
                end
            end
        end
        i, j = _i, _j
    end
    return outfits
end
 
don't know what you mean by storage id having anything to do with outfits but but i made something to get a list of player outfits before
Lua:
local match = string.match
local find = string.find
local gsub = string.gsub
local tonumber = tonumber
local hasOutfit = Player.hasOutfit

function Player.getOwnedOutfits(self)
    local outfits = table.create(200, 0)
    local sexPattern = 'type="'..self:getSex()..'"'
    local lookPattern = 'looktype="(%d*)"'
    local file = io.open([[data/xml/outfits.xml]])
    local str = file:read("*a")
    local i, j = find(str, sexPattern)
    file:close()
    while (i and j) do
        local _i, _j = find(str, sexPattern, j)
        local looktype = tonumber(match(str, lookPattern, i))
        if not outfits[looktype] then
            for addon = 3, 0, -1 do
                if hasOutfit(player, looktype, addon) then
                    outfits[looktype] = addon
                end
            end
        end
        i, j = _i, _j
    end
    return outfits
end
where do i put this?
 
Back
Top