Ir para conteúdo

Featured Replies

Postado

Ja vi um sistema que quando você clica no nome do player aparece o Level nome e vocação e de lado aparece ´[65] que seria os players que ele matou.

se alguem puder postar,agradeço.

 

Versão do tibia 8.60

  • Respostas 11
  • Visualizações 3.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Crie um script chamado fraglook.lua na pasta data\creaturescripts\script: function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))}

  • Aí galera, eu nem sei mexer com OtServers, mas eu comecei a mexer ontem e vim procurar sobre Fraglook... Mas eu faço programação, então isso ajudou a conseguir resolver! Então lá vai o código: funct

  • O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTS

Postado

Crie um script chamado fraglook.lua na pasta data\creaturescripts\script:

function getPlayerFrags(cid)
	local time = os.time()
	local times = {today = (time - 86400), week = (time - (7 * 86400))}

	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
	if(result:getID() ~= -1) then
		repeat
			local content = {date = result:getDataInt("date")}
			if(content.date > times.today) then
				table.insert(contents.day, content)
			elseif(content.date > times.week) then
				table.insert(contents.week, content)
			else
				table.insert(contents.month, content)
			end
		until not result:next()
		result:free()
	end

	local size = {
		day = table.maxn(contents.day),
		week = table.maxn(contents.week),
		month = table.maxn(contents.month)
	}
	return size.day + size.week + size.month
end

function onLogin(cid)
	registerCreatureEvent(cid, "fraglook")
	return true
end

function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) and thing.uid ~= cid then
		doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']')
		return true
	elseif thing.uid == cid then
		doPlayerSetSpecialDescription(cid,'[Frags: '..getPlayerFrags(cid)..']')
		local string = 'You see yourself.'
		if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
			string = string..' You are '.. getPlayerGroupName(cid) ..'.'
		elseif getPlayerVocation(cid) ~= 0 then
			string = string..' You are '.. getPlayerVocationName(cid) ..'.'
		else
			string = string..' You have no vocation.'
		end
		string = string..getPlayerSpecialDescription(cid)..''

		if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
			string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
		end

		if getPlayerGuildId(cid) > 0 then
			string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
			string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
			string = string..'nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
			string = string..'nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
			string = string..'nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
		return false
	end
	return true
end

E no arquivo creaturescripts.xml adicione:

<event type="login" name="fraglook_register" event="script" value="fraglook.lua"/>
<event type="look" name="fraglook" event="script" value="fraglook.lua"/>

Espero ter ajudado! :)

Abraços

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Postado
  • Autor
...

 Funcionou só que ficou no meio da descrisão do char, :

You see yourself. You are Vip Baiak Sorcerer.[Frags: 5] You are Vice-Leader of the Vingadores.

Teria como alterar o local e por para ficar no final da descrisão do char? tipo assim?:

You see yourself. You are Vip Baiak Sorcerer. You are Vice-Leader of the Vingadores. [Frags: 5]

 

 

O tópico foi movido para a área correta, preste mais atenção da próxima vez!

Este tópico foi movido:

De: "OTServSuporte OTServSuporte de OTServ Geral"

Para: "OTServSuporte OTServSuporte de Scripts"

Ok, não tinha percebido, Obrigado.

Postado

Tente esse:

function onLook(cid, thing, position, lookDistance)
function getDeathsAndKills(cid, type) -- by vodka
 local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
		if (query:getID() ~= -1) then 
			repeat
				d = d+1
			until not query:next()
			query:free()
		end
	return d  
end
if isPlayer(thing.uid) then
	if cid ~= thing.uid then
		doPlayerSetSpecialDescription(thing.uid, "\n[Killed: "..getDeathsAndKills(thing.uid, "kill").."]")
	else
		doPlayerSetSpecialDescription(cid, "\n[Killed: "..getDeathsAndKills(cid, "kill").."]")
	end
	return true
end

cole isso no login.lua :

registerCreatureEvent(cid, "fraglook")

E isso no creaturescript.xml:

<event type="look" name="fraglook" script="fragsonlook.lua"/>

"A alma permanece em suas criações" V89E5aN.png


142c9d3439.jpg
(Não dou suporte por mensagem privada.)

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

Informação Importante

Confirmação de Termo