[Encerrado] Como Mudo O Jeito !online

k2lan
Por k2lan
em Tópicos Sem Resposta

k2lan

Na vida tudo passa, não importa o que tu faça
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 17/12/07Posts: 217

quando vc coloca no ot !online mosta

19:29 1 player(s) online:

19:29 [GOD] Kaylos [100000].

como faço apenas para mostrar a quantidade de player, sem mostrar o nick e level, apenas assim

 

19:29 100 player(s) online

.

igorbrunomax

Yo no te conozco
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 12/05/08Posts: 21Char no Tibia: Admin Necrox

Estou com a mesma Dúvida.

Tomara que algum scripter venah aqui pra ajudar.

Depois de 2 anos voltei ao Xtibia. Conta nova, mundo Novo!

Gostou de mim? Te Ajudei? Faz um +REP.

Mulizeu

Programar ate cair os dedos
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 05/08/10Posts: 218Gênero: Masculino

Veja se e isso que vc quer.

 

 

local config = {
showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand'))
}

function onSay(cid, words, param)
local players = getPlayersOnline()
local strings = {}

local i = 1
local position = 1
for _, pid in ipairs(players) do
	if(i > (position * 7)) then
		strings[position] = strings[position] .. ","
		position = position + 1
	else
		strings[position] = i == 1 and "" or strings[position] .. ", "
	end

	if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) > getPlayerAccess(pid))) then
		strings[position] = strings[position] ..'' 
		i = i + 1
	end
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:")
for i, str in ipairs(strings) do
	if(str:sub(str:len()) ~= ",") then
		str = str .. "."
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
end

return TRUE
end

k2lan

Na vida tudo passa, não importa o que tu faça
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 17/12/07Posts: 217

isso mesmo, mas dei uma adaptação nele, pois o que vc postou mostra 2 linhas.

ta ai pra quem quizer usar

 

local config = {
   	showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand'))
}

function onSay(cid, words, param)
   	local players = getPlayersOnline()
   	local strings = {}

   	local i = 1
   	local position = 1
   	for _, pid in ipairs(players) do
           	if(i > (position * 7)) then
                   	strings[position] = strings[position] .. ","
                   	position = position + 1

           	else
                   	strings[position] = i == 1 and "" or strings[position] .. ""
           	end

           	if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) > getPlayerAccess(pid))) then
                   	strings[position] = strings[position] ..'' 
                   	i = i + 1
           	end
   	end

   	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online no Moekanos Baiak 3.0")
   	for i, str in ipairs(strings) do
           	if(str:sub(str:len()) ~= "") then

           	end


   	end

   	return TRUE
end

147963lol

TrasthGames
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/10/08Posts: 39Char no Tibia: [GOD] YaK

Em qual dos arquivos modifico para este para o !Online funcionar com esta adptação?



Ltk Server v.2.6

LTK + BruhADM + VTRLEONE

 

 

 

 

Visite meu LTK Server!

17050_2.png

 

Lalala~

 

 

 

 

 

Quer ajuda para criar seu Tópico perfeitamente? PM

hellcoreot

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 12/08/11Posts: 110

Em talkaction/script/online.lua

thefog

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/08/11Posts: 18Char no Tibia: Invencible Invisible

eu peguei o meu !online que mostra os players e os levels e fiz uma alteração, ve esse funciona

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]

i = i + 1

added = TRUE

else

added = FALSE

end

end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online")

for i, str in ipairs(strings) do

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

str = str .. "."

end

--doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)

end

return TRUE

end

 

aqui eu testei e funcionou, testado no The forgotten server 0.4_svn

147963lol

TrasthGames
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/10/08Posts: 39Char no Tibia: [GOD] YaK

Obrigado; Vou testar isso em meu servidor assim que conseguir ligar ele novamente *-*



Ltk Server v.2.6

LTK + BruhADM + VTRLEONE

 

 

 

 

Visite meu LTK Server!

17050_2.png

 

Lalala~

 

 

 

 

 

Quer ajuda para criar seu Tópico perfeitamente? PM

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel