Ir para conteúdo
  • Cadastre-se

(Resolvido)Modificação na Talk


Ir para solução Resolvido por Wakon,

Posts Recomendados

Mostrar as novas vocações no comando !online.

 

Só que mostra apenas as vocações do 1, ao 8. Preciso que mostre do 1 ao 12.

 

--((By Skyligh baiak-sky))--
local config = {
		showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}
 
function onSay(cid, words, param, channel)
		local players = getPlayersOnline()
		local strings = {""}
local sorc,druid,paladin,knight,rook = 0,0,0,0,0
 
		local i, position = 1, 1
		local added = false
		for _, pid in ipairs(players) do
		-- Implementacion por Xafterin.
				if isSorcerer(pid) then
						sorc = sorc + 1
				elseif isDruid(pid) then
						druid = druid + 1
				elseif isPaladin(pid) then
						paladin = paladin + 1
				elseif isKnight(pid) then
						knight = knight + 1
				elseif isRookie(pid) then
						rook = rook + 1
		end
		---
				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
 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, (i - 1) .. " ONLINE IN EPIC SERVER:")
		for i, str in ipairs(strings) do
				if(str:sub(str:len()) ~= ",") then
						str = str .. ".".. sorc .." [sorcerer], ".. druid .." [druid], ".. paladin .." [paladin], ".. knight .." [knight] jogando atualmente!"
				end
 
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, str)
		end
 
		return true
end

 

Link para o post
Compartilhar em outros sites
8 minutos atrás, Wakon disse:

@JcA, "data\lib", arquivo 031-vocations.lua.

 

Nossa, não sabia desse recurso, obrigado!

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo