Funções:
Comando: !partycheck
Ele mostra no channel quanto de cada vocação estão na party e mostra os três Knights mais forte(caso queria utilizar-lo para blocar)
Comando: !guildcheck
Ele mostra no channel do servidor quantos jogadores da sua guild estão on-line mostrando os nomes e também mostra os três knights mais forte.
Testado em: TFS 0.3.6
Crie um arquivo qualquer com nome de partyguildcheck.lua e adicione o comando abaixo
function getOnlineGuildMembers(cid) local t = {} local p = getPlayersOnline() local g = getPlayerGuildId(cid) for _, ps in ipairs(p) do local gs = getPlayerGuildId(ps) if(g == gs and gs > 0 and g > 0) then table.insert(t, ps) end end return t end function getGuildMembersByVoc(cid, voc) local h = getOnlineGuildMembers(cid) for _, gid in ipairs(h) do local vg = getPlayerVocation(gid) if(vg == voc) then local gv = {} table.insert(gv, gid) return gv end end return false end function getPartyMembersByVoc(cid, voc) local h = getPartyMembers(cid) local yv = {} for _, yid in ipairs(h) do local vx = getPlayerVocation(yid) if(vx == voc) then table.insert(yv, yid) end end return yv end local text = "" local count = 0 local vocCount = {} local regv = {} local highlevel = 125 function onSay(cid, words, param, channel) if(words == "!partycheck") then local pmem = getPartyMembers(getPartyLeader(cid)) text = "-- Party Check --\n" if(type(pmem) == "table") then if(#pmem <= 1) then text = text .. "You are alone!!!" return doPlayerSendTextMessage(cid, 22, text) elseif(#pmem > 1) then for i = 0, 4 do local k = getPartyMembersByVoc(cid, i) local vocvar = getVocationInfo(i).name text = text .. " " .. #k .. " " .. vocvar .. "\n" end local k2 = getPartyMembersByVoc(cid, 4) text = text .. "\n --High knights: " for _, kid in ipairs(k2) do local klvl = getPlayerLevel(kid) if(klvl >= highlevel) then count = count + 1 if(count <= 3) then text = text .. getPlayerName(kid) .. "[".. klvl .."]" .. (count < 3 and ", " or ".") end end end text = text .. "." end else text = "-- You are not in any party. -- " end elseif(words == "!guildcheck") then local gmem = getOnlineGuildMembers(cid) text = "-- Guild Check --\n" if(#gmem ~= 0) then local noneCount = 0 local g = {name = getPlayerGuildName(cid)} text = "[".. g.name .."] There are ".. #gmem .." players playing. " for _, gid in ipairs(gmem) do noneCount = noneCount + 1 text = text .. getPlayerName(gid) .. (noneCount == #gmem and "." or ", ") end local k2 = getPartyMembersByVoc(cid, 4) text = text .. "\n --High knights: " for _, kid in ipairs(k2) do local klvl = getPlayerLevel(kid) if(klvl >= highlevel) then count = count + 1 if(count <= 3) then text = text .. getPlayerName(kid) .. "[".. klvl .."]" .. (count < 3 and ", " or ".") end end end text = text .. "." else text = "You are not in a guild." end end return doPlayerSendTextMessage(cid, 22, text) end
Obs: Edite apenas onde estiver escrito.
agora em talkaction.xml adicione
<talkaction words="!guildcheck;!partycheck" event="script" value="partyguildcheck.lua"/>
Imagem:

Crédito
KylerXX