Ir para conteúdo

Featured Replies

Postado

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)

Resolvido por Saintsbr

Ir para solução
  • Respostas 10
  • Visualizações 2.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most 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, e

  • 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

Postado

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

Postado

 

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

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

 

Tente esse :

 

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)

Postado
  • Autor

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.

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.6k

Informação Importante

Confirmação de Termo