Ir para conteúdo
  • Cadastre-se

(Resolvido)[Resolvido] Script online.lua Modificado


Ir para solução Resolvido por Saintsbr,

Posts Recomendados

olá bem o que eu gostaria é de mudar o script talkactions online.lua

 

normalmente o player quando escreve !online .... aparece ... ex: 10 player online .... nome do player [120] nome do player 2 [200]

 

eu gostaria de alterar mostrando só a quantidade de player e uma mensagem de texto (a minha vontade)

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

Malblofor REP+

tk-melhor.png

  Citar

[ADMINISTRAÇÃO DE SERVIDORES]

Mostrar mais  
Link para o post
Compartilhar em outros sites
  • Respostas 10
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

aata então tenta assim   Editado~~ eu testei no meu, vc vai fazer o seguinte.  va na pasta, data/talkactions/scripts, dai olha la se tem uma pasta, "players" e outra "gamemaster", ou algo assim, entra na pasta players e acha "online.lua" e substitui por esse script abaixo. (caminho ~~ data/talkactions/scripts/players/online.lua   Se por acaso não tiver a pasta players, procure direto no data/talkactions/script/online.lua (aqui vai ter um arquivo desses de qualquer maneira,mas vc deve edit

tenta isso coloca no online.lua function onSay(cid, words, param) local player = Player(cid) local hasAccess = player:getGroup():getAccess() local players = Game.getPlayers() local playerCount = Game.getPlayerCount() player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.") local i = 0 local msg = "" for k, tmpPlayer in ipairs(players) do if hasAccess or not tmpPlayer:isInGhostMode() then if i > 0 then msg = msg .. ", " end msg = msg ..

tenta isso

coloca no online.lua

function onSay(cid, words, param)
	local player = Player(cid)
	local hasAccess = player:getGroup():getAccess()
	local players = Game.getPlayers()
	local playerCount = Game.getPlayerCount()

	player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.")

	local i = 0
	local msg = ""
	for k, tmpPlayer in ipairs(players) do
		if hasAccess or not tmpPlayer:isInGhostMode() then
			if i > 0 then
				msg = msg .. ", "
			end
			msg = msg .. tmpPlayer:getName() ..
			i = i + 1
		end

		if i == 10 then
			if k == playerCount then
				msg = msg .. "."
			else
				msg = msg .. ","
			end
			player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
			msg = ""
			i = 0
		end
	end

	if i > 0 then
		msg = msg .. "."
		player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
	end
	return false
end
Link para o post
Compartilhar em outros sites
  Em 13/07/2014 em 04:47, Saintsbr disse:

 

tenta isso

coloca no online.lua

function onSay(cid, words, param)
	local player = Player(cid)
	local hasAccess = player:getGroup():getAccess()
	local players = Game.getPlayers()
	local playerCount = Game.getPlayerCount()

	player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.")

	local i = 0
	local msg = ""
	for k, tmpPlayer in ipairs(players) do
		if hasAccess or not tmpPlayer:isInGhostMode() then
			if i > 0 then
				msg = msg .. ", "
			end
			msg = msg .. tmpPlayer:getName() ..
			i = i + 1
		end

		if i == 10 then
			if k == playerCount then
				msg = msg .. "."
			else
				msg = msg .. ","
			end
			player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
			msg = ""
			i = 0
		end
	end

	if i > 0 then
		msg = msg .. "."
		player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
	end
	return false
end
Mostrar mais  

O seu não vai aparecer os leveis, ele quer que apareça o player com o level.

 

Tente esse :

 

  Mostrar conteúdo oculto

function onSay(cid, words, param, channel)

    local strings, i, position, added, showGamemasters = {""}, 1, 1, false, getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))

    for _, pid in ipairs(getPlayersOnline()) 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

        added = false

        if((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

        end

    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player" .. (i > 1 and "s" or "") .. " 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

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

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites

não não pessoal, vocês não entenderam ....

 

Eu não quero que apareça nenhum nome do player e level, quero só a quantidade de player online em numero .... e que eu possa escrever um texto depois disso.

Malblofor REP+

tk-melhor.png

  Citar

[ADMINISTRAÇÃO DE SERVIDORES]

Expand   Mostrar mais  
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.

  • Estatísticas dos Fóruns

    96844
    Tópicos
    519597
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo