1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-11 21:00:41 +01:00
server-nalc/mods/u_skins/u_skins/skinlist.lua
2015-06-10 19:12:48 +02:00

51 lines
1.2 KiB
Lua
Executable File

u_skins.list = {}
u_skins.meta = {}
local id = 1
local internal_id = 1
local fetched_skip = 0
while fetched_skip < 40 do
local name = "character_"..id
local file = io.open(u_skins.modpath.."/meta/"..name..".txt", "r")
if file then
local data = string.split(file:read("*all"), "\n", 3)
file:close()
u_skins.list[internal_id] = name
u_skins.meta[name] = {}
u_skins.meta[name].name = data[1]
u_skins.meta[name].author = data[2]
u_skins.meta[name].license = data[3]
u_skins.meta[name].description = "" --what's that??
fetched_skip = 0
internal_id = internal_id + 1
end
fetched_skip = fetched_skip + 1
id = id + 1
end
-- MODIFICATION MADE FOR MFF
id = 1
fetched_skip = 0
while fetched_skip < 40 do
local name = "mff_character_"..id
local file = io.open(u_skins.modpath.."/meta/"..name..".txt", "r")
if file then
local data = string.split(file:read("*all"), "\n", 3)
file:close()
u_skins.list[internal_id] = name
u_skins.meta[name] = {}
u_skins.meta[name].name = data[1]
u_skins.meta[name].author = data[2]
u_skins.meta[name].license = data[3] or ""
u_skins.meta[name].description = ""
fetched_skip = 0
internal_id = internal_id + 1
end
fetched_skip = fetched_skip + 1
id = id + 1
end