Ir para conteúdo
  • Cadastre-se

[PEDIDO] Talkaction !Online


Posts Recomendados

Sistema !online diferente, que mostre o nome, level e quantos druids,sorcers,pallys,kinas, tem no servidor?


REP + para o primeiro que me ajudar  ;D 

 

grato !

 

Maluketz ~


Up~

Editado por Wiz Khaliifa (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
local config = {
	showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')),
	showLevel = "yes",
	showVocations = "yes"
}

config.showLevel, config.showVocations = getBooleanFromString(config.showLevel), getBooleanFromString(config.showVocations)
function onSay(cid, words, param, channel)
	local strings, i, position, added, vocations, vocStr = {""}, 1, 1, false, {}, ""
	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
		if(vocations[getPlayerVocation(pid)] ~= nil) then
			vocations[getPlayerVocation(pid)] = vocations[getPlayerVocation(pid)] + 1
		else
			vocations[getPlayerVocation(pid)] = 1
		end

		added = false
		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) .. ""..(config.showLevel and " [" .. getPlayerLevel(pid) .. "]" or "")..""
			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
	if(config.showVocations) then
		for vocId, quant in pairs(vocations) do
			vocStr = vocStr .. ""..getVocationInfo(vocId).name.." ["..quant.."], "
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vocations: "..vocStr:gsub(", $", "."))
	end
	return true
end
Link para o post
Compartilhar em outros sites
local config = {
	showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')),
	showLevel = "yes",
	showVocations = "yes"
}

config.showLevel, config.showVocations = getBooleanFromString(config.showLevel), getBooleanFromString(config.showVocations)
function onSay(cid, words, param, channel)
	local strings, i, position, added, vocations, vocStr = {""}, 1, 1, false, {}, ""
	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
		if(vocations[getPlayerVocation(pid)] ~= nil) then
			vocations[getPlayerVocation(pid)] = vocations[getPlayerVocation(pid)] + 1
		else
			vocations[getPlayerVocation(pid)] = 1
		end

		added = false
		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) .. ""..(config.showLevel and " [" .. getPlayerLevel(pid) .. "]" or "")..""
			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
	if(config.showVocations) then
		for vocId, quant in pairs(vocations) do
			vocStr = vocStr .. ""..getVocationInfo(vocId).name.." ["..quant.."], "
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vocations: "..vocStr:gsub(", $", "."))
	end
	return true
end

ficou assim:

 

09:22 10 players online:
09:22 Gente Boa [638], Coringa Returns [571], Staan [347], Sr'anny [512], Rogerio Skylab [759], Biketi [8], Renatinha [736],
09:22 Ataliba Returns [662], Cherolayne [519], Thunder Cat War [41], .
09:22 Vocations: Master Sorcerer [1], Elder Druid [2], Royal Paladin [1], Elite Knight [2], Baiake Vip Sorcerer [1], Baiake Vip Druid [2], Baiake Vip Paladin [1], Baiake Vip Kina [1].
 
não tem como juntar pra nao fica grande?exemplo: todos druids, (6) todos pally (4), todos kina (8)
Link para o post
Compartilhar em outros sites
local config = {
	showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')),
	showLevel = "yes",
	showVocations = "yes"
}

config.showLevel, config.showVocations = getBooleanFromString(config.showLevel), getBooleanFromString(config.showVocations)
function onSay(cid, words, param, channel)
	local vocationsList = {"Sorcerer", "Druid", "Paladin", "Knight"}
	local strings, i, position, added, vocations, vocStr = {""}, 1, 1, false, {}, ""
	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
		for _, vocName in ipairs(vocationsList) do
			if(not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) and string.find(getVocationInfo(getPlayerVocation(pid)).name:lower(), vocName:lower())) then
				vocations[vocName] = vocations[vocName] ~= nil and vocations[vocName] + 1 or 1
			end
		end

		added = false
		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) .. ""..(config.showLevel and " [" .. getPlayerLevel(pid) .. "]" or "")..""
			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
	if(config.showVocations) then
		for vocName, quant in pairs(vocations) do
			vocStr = vocStr .. "todos "..vocName:lower()..""..(quant > 1 and "s" or "").." ("..quant.."), "
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..vocStr:gsub(", $", "."))
	end
	return true
end

Tenta agora (não testei)

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