[Pedido] Talk Spy

soexpedito
em Lixeira Pública

soexpedito

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 24/10/11Posts: 9

Queria uma Talkaction assim.Quando eu usa-se ela ela me mostrava os dados dos outros player tipo (level,club,sword,magic level,distance,fishing,axe tals) e mostrasse tambem a quantidade de Life e Mana que o player tem.

 

 

 

 

 

Se puder me ajudar desde ja agradeço. !

 

 

 

Ahh...A talkaction a ser fala é .!whois (Name)

risada21

HARD Corporation
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/08/11Posts: 44

o.O Tbm quero..

 

eu tambem vou Querer um.

Fica o aviso ai embaixo

AVISO: ESTE LOCAL NAO é APROPRIADO PARA PEDIR SCRIPTS.

"Quem começa a guerra , não pode lamentar a morte" @HARD 2011-2012 Corporation Tibia.

Definindo o TIbia em 2012: INOVAÇÃO.

Esta Preparado para Inovar?TIBIA?MAPAS?Scripts?Sites?Poketibia?outros..

"Meu Ponto de VIsta Critico e Social é Suficiente para Manter-me VIvo, Ate que meu Sangue Derrame-se Todo."

83670544.gif93341863.gif61691408.gif

Este Comentario PUBLICADO NESTE TOPICO Possui Direitos Autorais.

 

A Declaração dos Direitos do Homem e do Cidadão, em seu artigo 11, DIZ:

"Art. 11. A livre comunicação das idéias e das opiniões é um dos mais preciosos direitos do homem; todo cidadão pode, portanto, falar, escrever, imprimir livremente, respondendo, todavia, pelos abusos desta liberdade nos termos previstos na lei".

 

Da mesma forma, a Declaração Universal dos Direitos do Homem, no artigo XIX:

"Artigo XIX

Todo homem tem direito à liberdade de opinião e expressão; este direito inclui a liberdade de, sem interferências, ter opiniões e de procurar, receber e transmitir informações e idéias por quaisquer meios e independentemente de fronteiras."

 

"Art. 5o. Da Constituiçao Brasileira

XIV - é assegurado a todos o acesso à informação....;

Gabriel Couto

Anyur
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 22/04/11Posts: 2455Gênero: MasculinoChar no Tibia: Thyn Zare

Mais atenção ao postar. Você postou na área errada. Leia os Nomes da seção!

Cuidado com a reincidência nisso, você pode ser alertado.

 

Movido para o local correto.

 

Até!

Gabriel Couto, 23 anos. Acadêmico de Medicina.

Ex-Diretor Geral do XTibia.

 

www.tibiatv.com.br

 

 

Vinc

The white fox
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/10/11Posts: 625Gênero: Masculino

primeiro va em talkactions/script crie um arquivo lua chamado spy.lua(retire o .lua caso os outros script na pasta n tenham no final do nome .lua)

e cole

---edit---

obs:modfiquei ta funfado direitinho agora

 

 

function onSay(cid, words, param)

storevalue = 2468 ---ai sera guardado o tempo de alerta
alerttime = 10 ---tempo de espera antes de usar novamente a a talkaction para naum dar alerta nu outro char
w = getPlayerByNameWildcard(param)
name2 = getPlayerName(cid)
level = getPlayerLevel(w)
ml = getPlayerMagLevel(w)
fist = getPlayerSkill(w,0)
club = getPlayerSkill(w,1)
sword = getPlayerSkill(w,2)
axe = getPlayerSkill(w,3)
distance = getPlayerSkill(w,4)
shield = getPlayerSkill(w,5)
healthmax = getCreatureMaxHealth(w)
hp1 = getCreatureHealth(w)
voc = getPlayerVocation(w)
manamax = getCreatureMaxMana(w)
mana = getCreatureMana(w)
hp = 100 ---quantu hp vc perde se naum esperar o tempo de alerta passar antes de usar a rune otra vez
playeraccess = getPlayerAccess(w)

if w == cid then
if playeraccess == 0 then
  if (alert(cid, storevalue, alerttime) == 1) then
    if voc == 1 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um sorcerer")
     elseif voc == 2 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Druid")
      elseif voc == 3 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Paladin")
      elseif voc == 4 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Knight")
      elseif voc == 5 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Master Sorcerer")
      elseif voc == 6 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Elder Druid")
      elseif voc == 7 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Royal Paladin")
      elseif voc == 8 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Elite Knight")
        end
    doPlayerSendTextMessage(cid,4,"Level: "..level.."")
    doPlayerSendTextMessage(cid,4,"Magic Level: "..ml.."")
    doPlayerSendTextMessage(cid,4,"Fist: "..fist.."")
    doPlayerSendTextMessage(cid,4,"Club: "..club.."")
    doPlayerSendTextMessage(cid,4,"Sword: "..sword.."")
    doPlayerSendTextMessage(cid,4,"Axe: "..axe.."")
    doPlayerSendTextMessage(cid,4,"Distance: "..distance.."")
    doPlayerSendTextMessage(cid,4,"Shielding: "..shield.."")
    doPlayerSendTextMessage(cid,4,"tem  "..healthmax.." de hp")
    doPlayerSendTextMessage(cid,4,"tem  "..manamax.." de mana")
    doPlayerSendTextMessage(cid,4,"esta com  "..hp1.." de hp")
    doPlayerSendTextMessage(cid,4,"esta com  "..mana.." de mana")
    else
    doPlayerSendTextMessage(w,22,""..name2.." is spying you.")
    doPlayerAddHealth(cid,-hp)
    doPlayerSendTextMessage(cid,22,"espere sair o alerta para usar novamente ou vao descomfiar")
  end
else
  doPlayerSendCancel(cid,"n pode espionar a staff")
end
else
doPlayerSendCancel(cid,"escreve a porra do nome do player que quer espionar certo")
end


return 1
end



function alert(cid, storevalue, alerttime)

  newAlert = os.time()
  oldAlert = getPlayerStorageValue(cid, storevalue)
  if (lastalert == nil or lastalert < 0) then
      lastalert = 0
  end
  if (alerttime == nil or alerttime < 0) then
      alerttime = 1
  end
  diffTime = os.difftime(newAlert, oldAlert)
  if (diffTime >= alerttime) then
      setPlayerStorageValue(cid, storevalue, newAlert)
      return 1
  else
      return 0
  end
end 
return 1
end

 

 

na talkactions.xml crie essa tag

<talkaction words="!whois" script="spy.lua"/>

caso funcione

cretitos 60%colex por : uma spy runa usada para criaçao que n tava funfado (tava bugado, falava que n tava takando em player¬¬)

40%meu por : modifica(passa pra talkaction,muda de catar player cid por item para por nome)

n garanto que o cloex tenha conta no xtibia tava no script que ja veio no sever

n esta testa to sem tempo agora(ta tarde meus pai ta echendo saco pra sai do pc kkk)

se n funfa fala

^w^

RafaelMan

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/06/06Posts: 5Char no Tibia: Ises Ajah

Fiz o código aqui.. Testei e ficou perfect :D

 

Cria um arquivo na pasta data/talkactions/scripts com o nome whois e cole o código abaixo:

function onSay(cid, words, param, channel)

-- Verifica se há parâmetro no comando
if(param == '') then 
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Digite o nome do player. Ex.: !Whois Nome do Player")
	return true
end

-- Busca as informações do player de acordo com o nome (param) digitado
player = db.getResult("SELECT name, level, maglevel, healthmax, manamax FROM players WHERE UPPER(name) = UPPER('".. param .."')")

-- Verifica se aquele nome/player existe
if(player:getID() == -1) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Nome '".. param .."' inválido. Ex.: !Whois Nome do Player")
	return true
end

-- Monta o texto que vai aparecer na tela
local txt = "Nome: " .. player:getDataString("name") .. "\n"
txt = txt .. "Life: " .. player:getDataInt("healthmax") .. "\n"
txt = txt .. "Mana: " .. player:getDataInt("manamax") .. "\n\n"
txt = txt .. "Magic lvl: " .. player:getDataInt("maglevel") .. "\n"

-- Busca skill club
local club = db.getResult("SELECT value FROM player_skills WHERE skillid = 1 AND player_id = ".. getPlayerGUIDByName(param)):getDataInt("value")
txt = txt .. "Club: " .. club .. "\n"
-- Busca skill sword
local sword = db.getResult("SELECT value FROM player_skills WHERE skillid = 2 AND player_id = ".. getPlayerGUIDByName(param)):getDataInt("value")
txt = txt .. "Sword: " .. sword .. "\n"
-- Busca skill axe
local axe = db.getResult("SELECT value FROM player_skills WHERE skillid = 3 AND player_id = ".. getPlayerGUIDByName(param)):getDataInt("value")
txt = txt .. "Axe: " .. axe .. "\n"
-- Busca skill distance
local distance = db.getResult("SELECT value FROM player_skills WHERE skillid = 4 AND player_id = ".. getPlayerGUIDByName(param)):getDataInt("value")
txt = txt .. "Distance: " .. distance .. "\n"
-- Busca skill shielding
local shielding = db.getResult("SELECT value FROM player_skills WHERE skillid = 5 AND player_id = ".. getPlayerGUIDByName(param)):getDataInt("value")
txt = txt .. "Shielding: " .. shielding .. "\n"

-- Abre uma janela com as informações acima
doPlayerPopupFYI(cid, txt)	

end

 

Agora adicione no arquivo talkactions.xml o código:

<talkaction words="!whois" event="script" value="whois.lua"/>

 

Espero ter ajudado :D

_______________________________________________

 

Nossa.. fiz a função e postei aqui.. Não tinha visto que o lordbug99 tinha acabado de postar =/

Mas fica aí a função. Pode utilizar como base para pegar qualquer outra informação do player (com um pouco de conhecimento em banco de dados)

soexpedito

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 24/10/11Posts: 9

Testei os 2 e nao deu certo.. (se acaso forem tentar dinovo , ve se da pra colocar a vocaçao do player tambem)

Vinc

The white fox
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/10/11Posts: 625Gênero: Masculino

n puis a vocation por que é so da look no plaeyr...

achei que n presisace

vo edita o la decima pra te voc tbm.

(ta no primeiro post)

edit

vi agora que nem tinha copiado o script

agora ta testado funfando, com voc, hp e mana maximo do player e hp e mana atual do player

observaçao: n coloquei pra so da pra usa em player(n funfa em staff)

 

function onSay(cid, words, param)

storevalue = 2468 ---ai sera guardado o tempo de alerta
alerttime = 10 ---tempo de espera antes de usar novamente a a talkaction para naum dar alerta nu outro char
w = getPlayerByNameWildcard(param)
name2 = getPlayerName(cid)
level = getPlayerLevel(w)
ml = getPlayerMagLevel(w)
fist = getPlayerSkill(w,0)
club = getPlayerSkill(w,1)
sword = getPlayerSkill(w,2)
axe = getPlayerSkill(w,3)
distance = getPlayerSkill(w,4)
shield = getPlayerSkill(w,5)
healthmax = getCreatureMaxHealth(w)
hp1 = getCreatureHealth(w)
voc = getPlayerVocation(w)
manamax = getCreatureMaxMana(w)
mana = getCreatureMana(w)
hp = 100 ---quantu hp vc perde se naum esperar o tempo de alerta passar antes de usar a rune otra vez
playeraccess = getPlayerAccess(w)

if w == cid then
if playeraccess == 0 then
  if (alert(cid, storevalue, alerttime) == 1) then
    if voc == 1 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um sorcerer")
     elseif voc == 2 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Druid")
      elseif voc == 3 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Paladin")
      elseif voc == 4 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Knight")
      elseif voc == 5 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Master Sorcerer")
      elseif voc == 6 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Elder Druid")
      elseif voc == 7 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Royal Paladin")
      elseif voc == 8 then
    doPlayerSendTextMessage(cid,4,"o player "..param.." é um Elite Knight")
        end
    doPlayerSendTextMessage(cid,4,"Level: "..level.."")
    doPlayerSendTextMessage(cid,4,"Magic Level: "..ml.."")
    doPlayerSendTextMessage(cid,4,"Fist: "..fist.."")
    doPlayerSendTextMessage(cid,4,"Club: "..club.."")
    doPlayerSendTextMessage(cid,4,"Sword: "..sword.."")
    doPlayerSendTextMessage(cid,4,"Axe: "..axe.."")
    doPlayerSendTextMessage(cid,4,"Distance: "..distance.."")
    doPlayerSendTextMessage(cid,4,"Shielding: "..shield.."")
    doPlayerSendTextMessage(cid,4,"tem  "..healthmax.." de hp")
    doPlayerSendTextMessage(cid,4,"tem  "..manamax.." de mana")
    doPlayerSendTextMessage(cid,4,"esta com  "..hp1.." de hp")
    doPlayerSendTextMessage(cid,4,"esta com  "..mana.." de mana")
    else
    doPlayerSendTextMessage(w,22,""..name2.." is spying you.")
    doPlayerAddHealth(cid,-hp)
    doPlayerSendTextMessage(cid,22,"espere sair o alerta para usar novamente ou vao descomfiar")
  end
else
  doPlayerSendCancel(cid,"n pode espionar a staff")
end
else
doPlayerSendCancel(cid,"escreve a porra do nome do player que quer espionar certo")
end


return 1
end



function alert(cid, storevalue, alerttime)

  newAlert = os.time()
  oldAlert = getPlayerStorageValue(cid, storevalue)
  if (lastalert == nil or lastalert < 0) then
      lastalert = 0
  end
  if (alerttime == nil or alerttime < 0) then
      alerttime = 1
  end
  diffTime = os.difftime(newAlert, oldAlert)
  if (diffTime >= alerttime) then
      setPlayerStorageValue(cid, storevalue, newAlert)
      return 1
  else
      return 0
  end
end 
return 1
end

 

^w^