kito2
www.masteria.net
Bump!
Bump!
local function getMembersOnline(tabla)
if (type(tabla) == 'table') then
local nohay = "There are not."
str = "Members list:\n"
str = str.. " Sorcerers (".. #players.sorcs.."): ".. (#players.sorcs == 1 and players.sorcs[1].."." or #players.sorcs > 1 and table.concat (players.sorcs, ", ").."." or nohay).. " \n"
str = str.. "Druids ("..#players.druids.."): ".. (#players.druids == 1 and players.druids[1].."." or #players.druids > 1 and table.concat (players.druids, ", ").."." or nohay).. "\n"
str = str.. "Paladins ("..#players.paladins.."): "..(#players.paladins == 1 and paladins[1].."." or #players.paladins > 1 and table.concat (players.paladins, ", ").."." or nohay).. "\n"
str = str.. "Kinas ("..#players.kinas.."): ".. (#players.kinas == 1 and players.kinas[1].."." or #players.kinas > 1 and not table.sort(players.sorcs, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (players.kinas, ", ").."." or nohay).."\n"
str = str .. "The best kinas are: "..(#players.kinas == 0 and nohay or #players.kinas == 1 and players.kinas[1].."." or #players.kinas == 2 and players.kinas[1]..", "..players.kinas[2] or #players.kinas == 3 and players.kinas[1]..", "..players.kinas[2] .. ", "..players.kinas[3])
end
return str
end
function onSay(cid, words, param, channel)
if (words == '/guildcheck') then
if (getPlayerGuildId(cid) > 0) then
players = {}
players.sorcs = {}
players.druids = {}
players.paladins = {}
players.kinas = {}
for _, pid in pairs (getPlayersOnline()) do
if (getPlayerGuildId(pid) == getPlayerGuildId(cid) ) then
local str = getPlayerName(pid).. " ["..getPlayerLevel(pid).."]"
if (isSorcerer(pid)) then
table.insert(players.sorcs, str)
elseif (isDruid(pid)) then
table.insert(players.druids, str)
elseif (isPaladin(pid)) then
table.insert(players.paladins, str)
elseif (isKnight(pid)) then
table.insert(players.kinas, str)
end
end
end
doPlayerSendTextMessage(cid, MESSAGE_TYPES["blue"], getMembersOnline(players))
else
doPlayerSendCancel(cid, "You are not in a guild.")
end
elseif (words == '/partycheck') then
if (isInParty(cid)) then
players = {}
players.sorcs = {}
players.druids = {}
players.paladins = {}
players.kinas = {}
for _, pid in pairs(getPlayersOnline()) do
if (isInParty(pid) and getPlayerParty(pid) == getPlayerParty(cid)) then
str = getPlayerName(pid).. " ["..getPlayerLevel(pid).."]"
if (isSorcerer(pid)) then
table.insert(players.sorcs, str)
elseif (isDruid(pid)) then
table.insert(players.druids, str)
elseif (isPaladin(pid)) then
table.insert(players.paladins, str)
elseif (isKnight(pid)) then
table.insert(players.kinas, str)
end
end
end
doPlayerSendTextMessage(cid, MESSAGE_TYPES["blue"],getMembersOnline(players) )
else
doPlayerSendCancel(cid,"You are not in a party.")
end
end
return true
end
[13:28:15.026] [Error - TalkAction Interface]
[13:28:15.026] data/talkactions/scripts/mtibia/check_party_guild.lua:onSay
[13:28:15.026] Description:
[13:28:15.026] ...ata/talkactions/scripts/mtibia/check_party_guild.lua:9: attempt to concatenate a boolean value
[13:28:15.026] stack traceback:
[13:28:15.026] ...ata/talkactions/scripts/mtibia/check_party_guild.lua:9: in function 'getMembersOnline'
[13:28:15.026] ...ata/talkactions/scripts/mtibia/check_party_guild.lua:41: in function <...ata/talkactions/scripts/mtibia/check_party_guild.lua:16>
[17:22:20.615] [Error - TalkAction Interface]
[17:22:20.615] data/talkactions/scripts/mtibia/check_party_guild.lua:onSay
[17:22:20.615] Description:
[17:22:20.615] ...ata/talkactions/scripts/mtibia/check_party_guild.lua:9: attempt to concatenate a boolean value
[17:22:20.615] stack traceback:
[17:22:20.615] ...ata/talkactions/scripts/mtibia/check_party_guild.lua:9: in function 'getMembersOnline'
[17:22:20.615] ...ata/talkactions/scripts/mtibia/check_party_guild.lua:41: in function <...ata/talkactions/scripts/mtibia/check_party_guild.lua:16>
21:38 Members list:
Sorcerers (1): Kito [192].
Druids (22): Nylrad [190], Benners [192], Cerberous [206], Sellair Rush [188],
Charlex [210], Krewprecyz [202], Fardmorix [201], Quubo [206], Nazhoo [202],
Deathcrush [214], Scontrik [200], Jotapek [213], Chonox [178], Haron Rah [214],
Injek [196], Lord Zarpao [205], Bambino [184], Novinha [187], Nyziczciel fon [203],
Warrior Jah [218], Druiiidax [197], Dof Nacho [231].
Paladins (3): Teth [212], Conithaaxz [212], Malkka [191].
Kinas (3): Eternal Oblivion [152], Re