rooyo
New Member
- Joined
- Jul 2, 2013
- Messages
- 70
- Reaction score
- 3
hello I need someone who will improve the script 0.3.6
information needed chance for loot displayed in% and hiding xml file location
Code:
function onSay(cid, words, param, channel)
local monsterFile = "data/lootinfo/" .. param .. ".xml"
local loot = {}
local t = 0
local text = "File opened: " .. monsterFile .. ""
if (io.open(monsterFile, "r") ~= nil) then
for line in io.lines(monsterFile) do
if (line:find('id=".*".*')) then
line = string.match(line, 'id=".*".*')
lootid = string.sub(line, string.find(line, '="') + 2, string.find(line, '" ') - 1)
table.insert(loot, lootid)
end
end
text = text .. "\n\n" .. "Found " .. #loot .. " items\n"
for _, i in ipairs(loot) do
t = t + 1
text = text .. "\n " .. t .. ". " .. getItemArticleById(i) .. " " .. getItemNameById(i) .. " [" .. i .. "]"
end
doPlayerPopupFYI(cid, text)
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "File: " .. monsterFile .. " does not exist.")
return TRUE
end
return TRUE
end
information needed chance for loot displayed in% and hiding xml file location