Ir para conteúdo

Featured Replies

Postado
  • Autor

Tenta assim:


local config = {

showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))

}

function onSay(cid, words, param, channel)

local players = getPlayersOnline()

local strings = {""}

local i, position = 1, 1

local added = false

for _, pid in ipairs(players) do

if(added) then

if(i > (position * 7)) then

strings[position] = strings[position] .. ","

position = position + 1

strings[position] = ""

else

strings[position] = i == 1 and "" or strings[position] .. ", "

end

end

if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then

strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"

i = i + 1

added = true

else

added = false

end

end


for i, str in ipairs(strings) do

if(str:sub(str:len()) ~= ",") then

str = str .. "\n\n"

end

doShowTextDialog(cid, 1952, str)

end

return true

end

Não deu nao, segue abaixo a imagem de como esta!

63147199.png

Teria como deixar assim?

Nome: Profissao: Level:

Legolas Elder Druid 100

Marcos Knight 154

Test Elite Knight 156

Total Paladins = 0

Total Druids= 1

Total Knights= 2

Total Sorcerers= 0

Total Geral: 3

REP+ ;)

  • Respostas 16
  • Visualizações 1.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Bruno Carvalho
    Bruno Carvalho

    Tenta este: [paste]dvKc1Yvy[/paste] Créditos a esse tópico da otland onde eu peguei a base: http://otland.net/f81/show-players-online-who-have-not-done-specific-quest-148358/

Postado

Tenta este:

[paste]dvKc1Yvy[/paste]

Créditos a esse tópico da otland onde eu peguei a base:

http://otland.net/f81/show-players-online-who-have-not-done-specific-quest-148358/

Bruno Carvalho / Ex-Administrador TibiaKing

[email protected]

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Postado

Falha minha kk...

[paste]6QVEQvWW[/paste]

Bruno Carvalho / Ex-Administrador TibiaKing

[email protected]

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Postado
  • Autor

Simpl

Falha minha kk...

[paste]6QVEQvWW[/paste]

Cara Show de bola, 99%, falta somente 1 detalhe, no final colocar um total de players online.

Se possivel editar em cima deste script

local item = 1740

function onSay(cid, words, param, channel)

local sorcs = {}

local druids = {}

local pallies = {}

local kinas = {}

local name,voc,level = "","",0

for _,on in pairs (getPlayersOnline()) do

name, voc, level = getCreatureName(on), getPlayerVocationName(on), getPlayerLevel(on)

if ( isSorcerer(on)) then

table.insert(sorcs, name.. " - ["..level.."]" )

elseif ( isDruid(on)) then

table.insert(druids, name.. " - ["..level.."]")

elseif (isPaladin(on)) then

table.insert(pallies, name.. " - ["..level.."]")

elseif (isKnight(cid)) then

table.insert(kinas, name.. " - ["..level.."]")

end

end

local np = "Não Tem Ning ON."

local str = "Lista de Players: \n\n"

str = str.. "Sorcerers (".. #sorcs..")\n".. (#sorcs == 1 and sorcs[1] or #sorcs > 1 and not table.sort(sorcs, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (sorcs, "\n").."." or np).. " \n\n"

str = str.. "Druids ("..#druids..")\n".. (#druids == 1 and druids[1] or #druids > 1 and not table.sort(druids, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (druids, "\n").."." or np).. "\n\n"

str = str.. "Pallies ("..#pallies..")\n"..(#pallies == 1 and pallies[1] or #pallies > 1 and not table.sort(pallies, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (pallies, "\n").."." or np).. "\n\n"

str = str.. "Kinas ("..#kinas..")\n".. (#kinas == 1 and kinas[1] or #kinas > 1 and not table.sort(kinas, function (a, b) return (a:match("%d+") < b:match("%d+")) end) and table.concat (kinas, "\n").."." or np)

doShowTextDialog(cid, item, str)

return true

end

É o seu só que eu coloquei os players um de baixo do outro.

Edit - O comando esta com algum bug, com relação aos Knights, quando um Kina faz o comando !online ele consegue ver todo mundo, inclusive ele e o resto dos kinghts, quando qualker outra profissao faz o comando !online, ning enxerga nenhum kina, ou seja, somente os kinas conseguem ver todos as profissoes onlines.

Tem como arrumar?

Edit 2- Arrumei era isso:


elseif (isKnight(cid)) then

					    table.insert(kinas, name.. " ["..level.."]")

Mudei para isso:

elseif (isKnight(on)) then

					    table.insert(kinas, name.. " ["..level.."]")

Só falta o quantitativo final dos players online.

Aguardo, abraços meu amigo!

Editado por markim1986 (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo