AN

Ver Equipes And Skills

Por angeldoido, 04 de nov. de 2011 em Actions e Talkactions

otserv
tibia
script
10
3.4k
angeldoidoA
04 de novembro de 2011 às 08:01

Galera achei 2 script mto inportante aki no xtibiaa,que era pra ve os equipes do player, porem so ve ekipes n da pra sabe se o player é bugado etc...entaum achei o pra ve skills do personagem, dai fis o favor e juntei os 2, vamos la ne (:

 

Primeiro vamos as tags:

 

<talkaction log="yes" access="5" words="!equipment" event="script" value="setskill.lua"/>
<talkaction log="yes" access="5" words="!skill" event="script" value="setskill.lua"/>

 

Depois Criem um arquivo Com nome setskill.lua e colam isso dentro...

 

function getItemsInContainer(cont, sep)
   local text = ""
   local tsep = ""
   local count = ""
   for i=1, sep do
       tsep = tsep.."-"
   end
   tsep = tsep..">"
   for i=0, getContainerSize(cont.uid)-1 do
       local item = getContainerItem(cont.uid, i)
       if isContainer(item.uid) == FALSE then
           if item.type > 0 then
               count = "("..item.type.."x)"
           end
           text = text.."\n"..tsep..getItemNameById(item.itemid).." "..count
       else
           if getContainerSize(item.uid) > 0 then
               text = text.."\n"..tsep..getItemNameById(item.itemid) 
               text = text..getItemsInContainer(item, sep+2)
           else
               text = text.."\n"..tsep..getItemNameById(item.itemid)
           end
       end
   end
   return text
end

function onSay(cid, words, param, channel)

if words == "!skill" then
if not param or param == "" or not getPlayerByName(param) then
doPlayerSendCancel(cid,'Vc nao pode checar isso')
end
if player ~= 0 then
local n = getPlayerByName(param)
doPlayerPopupFYI(cid,"Nome "..getCreatureName(n).."".."\n\nEle esta no level "..getPlayerLevel(n).." !".."\nEle Tem de Distance "..getPlayerSkill(n,4).." !".."\nEle Tem de sword "..getPlayerSkill(n, 2).." !".."\nEle Tem de axe "..getPlayerSkill(n, 3).." !".."\nEle Tem de club "..getPlayerSkill(n, 1).." !".."\nEle Tem de shield "..getPlayerSkill(n, 5).." !".."\nEle Tem de magiclevel "..getPlayerMagLevel(n).."!".."\nEle Tem de mana "..getPlayerMana(n).." !".."\nEle tem de life "..getCreatureMaxHealth(n).." !")
return TRUE
end
end

   if(param == "") then
       doPlayerSendCancel(cid, "Command requires param.")
       return TRUE
   end
   local slotName = {"Head Slot", "Amulet Slot", "Backpack Slot", "Armor Slot", "Right Hand", "Left Hand", "Legs Slot", "Feet Slot", "Ring Slot", "Ammo Slot"}
   local player = getPlayerByNameWildcard(param)
   if isPlayer(player) == TRUE then
       local text = getPlayerName(player).."'s Equipment: "    
       for i=1, 10 do
           text = text.."\n\n"
           local item = getPlayerSlotItem(player, i)
           if item.itemid > 0 then
               if isContainer(item.uid) == TRUE then
                   text = text..slotName[i]..": "..getItemNameById(item.itemid)..getItemsInContainer(item, 1)
               else
                   text = text..slotName[i]..": "..getItemNameById(item.itemid)
               end
           else
               text = text..slotName[i]..": Empty"
           end
       end
       doPlayerPopupFYI(cid, text)
   else
       doPlayerSendCancel(cid, "This player is not online.")
   end
   return TRUE
end

 

 

Lenbrando:

 

Este Scripts Apresentados Acima Não fui eu,em os Que crio-u:
Donos Legitimos:

By:Mulizeu - Checar Skills etc...
By:Azi [ersiu] - Checar Itens Do player...

 

Prints:

 

EQUIPAMENTOS:

 

eskikpes.jpg

 

 

Skills:

 

skillsdsdf.jpg

 

 

[===--°°º.::~EDITED~::.º°°--===]

 

Galera meu colega falo q ta dando alguns errinho na linha 36 e 28,no meu distro n aparece nada, e n achei 1 modo pra comcerta, (POIS NAUM VI E NEM REPAREI ERRO NENHUM)...Como podem ve nas print funcionando d boa -'

SkyDangerousS
04 de novembro de 2011 às 08:10

Bem criativo.

Parabéns !

 

ótimos scripts que você faz.

angeldoidoA
04 de novembro de 2011 às 11:33

Briigado, Porem scripts naum sao meu, so fis o favor de junta (ocupa menos arquivo no pc)

POSKAPOSKAPOSK

MulizeuM
04 de novembro de 2011 às 13:47

Obg Por citar meu creditos!

e quanto ao erro do seu amigo eu editei o script aki e n esta ocorrendo mais esse erro que ele havia dito!

 

function getItemsInContainer(cont, sep)
   local text = ""
   local tsep = ""
   local count = ""
   for i=1, sep do
       tsep = tsep.."-"
   end
   tsep = tsep..">"
   for i=0, getContainerSize(cont.uid)-1 do
       local item = getContainerItem(cont.uid, i)
       if isContainer(item.uid) == FALSE then
           if item.type > 0 then
               count = "("..item.type.."x)"
           end
           text = text.."\n"..tsep..getItemNameById(item.itemid).." "..count
       else
           if getContainerSize(item.uid) > 0 then
               text = text.."\n"..tsep..getItemNameById(item.itemid) 
               text = text..getItemsInContainer(item, sep+2)
           else
               text = text.."\n"..tsep..getItemNameById(item.itemid)
           end
       end
   end
   return text
end

function onSay(cid, words, param, channel)

if words == "!skill" then
if not param or param == "" or not getPlayerByName(param) then
doPlayerSendCancel(cid,'Vc nao pode checar isso')
end
if isPlayer(cid) ~= 0 then
local n = getPlayerByName(param)
doPlayerPopupFYI(cid,"Nome "..getCreatureName(n).."".."\n\nEle esta no level "..getPlayerLevel(n).." !".."\nEle Tem de Distance "..getPlayerSkill(n,4).." !".."\nEle Tem de sword "..getPlayerSkill(n, 2).." !".."\nEle Tem de axe "..getPlayerSkill(n, 3).." !".."\nEle Tem de club "..getPlayerSkill(n, 1).." !".."\nEle Tem de shield "..getPlayerSkill(n, 5).." !".."\nEle Tem de magiclevel "..getPlayerMagLevel(n).."!".."\nEle Tem de mana "..getPlayerMana(n).." !".."\nEle tem de life "..getCreatureMaxHealth(n).." !")
return TRUE
end
end
   if(param == "") then
       doPlayerSendCancel(cid, "Command requires param.")
       return TRUE
   end
   local slotName = {"Head Slot", "Amulet Slot", "Backpack Slot", "Armor Slot", "Right Hand", "Left Hand", "Legs Slot", "Feet Slot", "Ring Slot", "Ammo Slot"}
   local player = getPlayerByNameWildcard(param)
   if isPlayer(player) == TRUE then
       local text = getPlayerName(player).."'s Equipment: "    
       for i=1, 10 do
           text = text.."\n\n"
           local item = getPlayerSlotItem(player, i)
           if item.itemid > 0 then
               if isContainer(item.uid) == TRUE then
                   text = text..slotName[i]..": "..getItemNameById(item.itemid)..getItemsInContainer(item, 1)
               else
                   text = text..slotName[i]..": "..getItemNameById(item.itemid)
               end
           else
               text = text..slotName[i]..": Empty"
           end
       end
       doPlayerPopupFYI(cid, text)
   else
       doPlayerSendCancel(cid, "This player is not online.")
   end
   return TRUE
end

Editado Novembro 4 por mulizeu

EskyloE
04 de novembro de 2011 às 18:12

q tal juntar duas tags numa só?

 

<talkaction log="yes" access="5" words="!equipment;!skill" event="script" value="setskill.lua"/>

 

o script (arquivo) é o mesmo, então vc pode deixar assim :)

 

 

angeldoidoA
04 de novembro de 2011 às 19:30

opskaspoka, ss economizando menos espaço possivel, POSAKOSAPO, [quanto ao erro mulizeu] so naum vi 1 modo de comcerta pq no meu distro n deu nenhum erro, meu amigo so falo que no dele tava dando erro, Obg por comcerta, e belo script Mto eficient em otservs

lovemetalL
06 de novembro de 2011 às 02:39

noss car parabens realmente adoro seus script s2

andretoproxA
06 de novembro de 2011 às 15:33

Boa a ideia de colocar os 2 numa só linha hehe...

 

@TOPIC

Achei legal, vou testar!

 

@EDIT

 

Funfando legal sem erro algum! Aqui é Forgotten Server 8.60 falow e Obrigado!

 

REP+ PRA TI!

Editado Novembro 6 por andretoprox

VincV
07 de novembro de 2011 às 17:11

so tem um pequeno erro na parte do skill(provavelmente por confusao),ele mostra quanto o player tem de mana no momento e o hpmax do player

o que fica estranho

entao passe deixe os dois igual ou mostra o hp e mana no momento ou mostra o hp e mana maximo(mistura fica confuso para os playes)

ou entao ponha tanto o hp e mana max quanto o hp e mana atual

pra que n intendeu o que eu falei é essa parte aki que to falando

"!".."\nEle Tem de mana "..getPlayerMana(n).." !".."\nEle tem de life "..getCreatureMaxHealth(n).." !")

getPlayerMana(n) mostra mana atual do player

getCreatureMaxHealth(n) mostra hp maxima do player

ou mostra so as max,ou so as atuais

HannahHelenaTeiH
07 de novembro de 2011 às 18:45

brigada, aki funfo certinho *-*