Ir para conteúdo

Featured Replies

Postado

fiz um mod para seu primeiro pedido, entre na pasta mods, crie um aquivo xml e cole o código:

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Ranking Uptime" version="1.0" author="Gantz (miiller)" contact="tibiaking.com" enabled="yes">
<config name="uptime_func"><![CDATA[
uptime = {
	storage = 67517,
	get = function (cid)
		return getPlayerStorageValue(cid, uptime.storage)
	end,
	start = function (cid)
				if not isCreature(cid) then return true end
				setPlayerStorageValue(cid, uptime.storage,  uptime.get + 1)
				addEvent(uptime.start, 1000, cid)
	end,
	convert = function(uptime)
				local day, hour, minute = 0
				while uptime >= 86400 do
					day = day + 1
					uptime = uptime - 86400
				end
				while uptime >= 3600 do
					hour = hour + 1
					uptime = uptime - 3600
				end
				while uptime >= 60 do
					minute = minute + 1
					uptime = uptime - 60
				end
				local second = uptime
				local str = ((day > 0 and day .. "d " or "") .. (hour > 0 and hour .. "h " or "") .. (minute > 0 and minute .. "m " or "") .. (second > 0 and second .. "s " or ""))
				return str
	end
}
]]></config>
<event type="login" name="uptime_login" event="script"><![CDATA[
domodlib('uptime_func')
function onLogin(cid)
	setPlayerStorageValue(cid, uptime.storage, 0)
	uptime.start(cid)
	return true
end]]></event>
<talkaction words="!uptimerank;/uptimerank" event="buffer"><![CDATA[
domodlib('uptime_func')
function onSay(cid, words, param)
	local ranking = getPlayersOnline()
	local t = #ranking < 10 and #ranking or 10
	for i = 1, t do
		for j = i + 1, #getPlayersOnline() do
			if uptime.get(ranking[j]) > uptime.get(ranking[i]) then
				local aux = uptime.get(ranking[i])
				ranking[i] = ranking[j]
				ranking[j] = aux
			end
		end
	end
	local result = ""
	for i = 1, t do
		result = result .. i .. ". " .. getCreatureName(ranking[i]) .. " - " .. uptime.convert(uptime.get(ranking[i])) .. "\n"
	end
	doShowTextDialog(cid, 6500, result)
	return true
end]]></talkaction>
</mod>

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

whatsapp-4in.png (18) 98134-9991

 

icon-skype.png [email protected]

 

  • Respostas 10
  • Visualizações 554
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • fiz um mod para seu primeiro pedido, entre na pasta mods, crie um aquivo xml e cole o código: <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Ranking Uptime" version="1.0" author="Ga

  • Pra fazer um ranking de tempo, sua data base precisa ter uma table (ou coluna) que guarde o tempo que o player ficou online.   Pra fazer o "!libert" creio que somente mexendo na distro, pois o god,

  • é possivel fazer um globalevent, que salva no player, uma storage a cada minuto que passou, assim contabilizando o tempo que ele ficou online

Postado
  • Autor

 

fiz um mod para seu primeiro pedido, entre na pasta mods, crie um aquivo xml e cole o código:

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Ranking Uptime" version="1.0" author="Gantz (miiller)" contact="tibiaking.com" enabled="yes">
<config name="uptime_func"><![CDATA[
local uptime = {
	storage = 67517,
	get = function (cid)
		return getPlayerStorageValue(cid, uptime.storage)
	end,
	start = function (cid)
				if not isCreature(cid) then return true end
				setPlayerStorageValue(cid, uptime.storage,  uptime.get + 1)
				addEvent(uptime.start, 1000, cid)
	end,
	convert = function(uptime)
				local day, hour, minute = 0
				while uptime >= 86400 do
					day = day + 1
					uptime = uptime - 86400
				end
				while uptime >= 3600 do
					hour = hour + 1
					uptime = uptime - 3600
				end
				while uptime >= 60 do
					minute = minute + 1
					uptime = uptime - 60
				end
				local second = uptime
				local str = ((day > 0 and day .. "d " or "") .. (hour > 0 and hour .. "h " or "") .. (minute > 0 and minute .. "m " or "") .. (second > 0 and second .. "s " or ""))
				return str
	end
}
]]></config>
<event type="login" name="uptime_login" event="script"><![CDATA[
domodlib('uptime_func')
function onLogin(cid)
	setPlayerStorageValue(cid, uptime.storage, 0)
	uptime.start(cid)
	return true
end]]></event>
<talkaction words="!uptimerank;/uptimerank" event="buffer"><![CDATA[
domodlib('uptime_func')
function onSay(cid, words, param)
	local ranking = getPlayersOnline()
	for i = 1, 10 do
		for j = i, #getPlayersOnline() do
			if uptime.get(ranking[j]) > uptime.get(ranking[i]) then
				local aux = uptime.get(ranking[i])
				ranking[i] = ranking[j]
				ranking[j] = aux
			end
		end
	end
	local result = ""
	for i = 1, 10 do
		result = result .. i .. ". " .. getCreatureName(ranking[i]) .. " - " .. uptime.convert(uptime.get(ranking[i])) .. "\n"
	end
	doShowTextDialog(cid, 6500, result)
	return true
end]]></talkaction>
</mod>

jah jah eu testo

wq3bBzt.png
Pokémon Dust Evolution
 
É aonde começa sua nova aventura!! 

 

Facebook

 
Verifique Atualizações

 

Postado

 

fiz um mod para seu primeiro pedido, entre na pasta mods, crie um aquivo xml e cole o código:

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Ranking Uptime" version="1.0" author="Gantz (miiller)" contact="tibiaking.com" enabled="yes">
<config name="uptime_func"><![CDATA[
local uptime = {
	storage = 67517,
	get = function (cid)
		return getPlayerStorageValue(cid, uptime.storage)
	end,
	start = function (cid)
				if not isCreature(cid) then return true end
				setPlayerStorageValue(cid, uptime.storage,  uptime.get + 1)
				addEvent(uptime.start, 1000, cid)
	end,
	convert = function(uptime)
				local day, hour, minute = 0
				while uptime >= 86400 do
					day = day + 1
					uptime = uptime - 86400
				end
				while uptime >= 3600 do
					hour = hour + 1
					uptime = uptime - 3600
				end
				while uptime >= 60 do
					minute = minute + 1
					uptime = uptime - 60
				end
				local second = uptime
				local str = ((day > 0 and day .. "d " or "") .. (hour > 0 and hour .. "h " or "") .. (minute > 0 and minute .. "m " or "") .. (second > 0 and second .. "s " or ""))
				return str
	end
}
]]></config>
<event type="login" name="uptime_login" event="script"><![CDATA[
domodlib('uptime_func')
function onLogin(cid)
	setPlayerStorageValue(cid, uptime.storage, 0)
	uptime.start(cid)
	return true
end]]></event>
<talkaction words="!uptimerank;/uptimerank" event="buffer"><![CDATA[
domodlib('uptime_func')
function onSay(cid, words, param)
	local ranking = getPlayersOnline()
	local t = #ranking < 10 and #ranking or 10
	for i = 1, t do
		for j = i, #getPlayersOnline() do
			if uptime.get(ranking[j]) > uptime.get(ranking[i]) then
				local aux = uptime.get(ranking[i])
				ranking[i] = ranking[j]
				ranking[j] = aux
			end
		end
	end
	local result = ""
	for i = 1, t do
		result = result .. i .. ". " .. getCreatureName(ranking[i]) .. " - " .. uptime.convert(uptime.get(ranking[i])) .. "\n"
	end
	doShowTextDialog(cid, 6500, result)
	return true
end]]></talkaction>
</mod>

Miiiller ta vooltandooo *-------* <3 <3

Tony Araújo  ;D 

 

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 520.2k

Informação Importante

Confirmação de Termo