Ir para conteúdo
Entre para seguir isso  
Theax

Look + Frag

Recommended Posts

Theax    0
Theax
Nome: Frags Counter no look

Autor: Theax

Versão Testada: TFS 0.3.6

 

O que faz?

Essa script mostra se quantos frags o player tem quando vc da look nele exemplo: You see Theax. He is a Royal Paladin.[frags:43]

Crie na pasta Data/Creaturescripts/script o arquivo fraglook.lua

e cole isso

 

--Script By Theax 
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

 

Agora no Data/Creaturescripts/creaturescripts.xml

adicione essas tags:

 

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

Duvidas postem ai :D

Editado por Black Ice

Compartilhar este post


Link para o post
Oneshot    24
Oneshot

Aprovado e Movido.

Compartilhar este post


Link para o post
rafaellm    0
rafaellm

100% Otimo .. agora nao tem mais essa de a aquele cara ta bugado a frags deles .. aquele cara n pega red .. acabo isso pq os players estao vendo com seus proprio olhos :yes:

 

Muito bom !

Compartilhar este post


Link para o post
Theax    0
Theax

Obrigado =D

Lembrando q vc pode mudar o Look como por exemplo ...He has X frags....

Compartilhar este post


Link para o post
Roku 3    0
Roku 3

um bom material pra estudo...

Compartilhar este post


Link para o post
Kekezito_LHP    1
Kekezito_LHP

nossa muito legal se sube mexe da para faze de reset ow mesmo do population oO

gostei muito como o rafaellm dise agora nao tei mais essa de bugado o char =D

Compartilhar este post


Link para o post
Theax    0
Theax

@Roku 3

 

Ctz =D

 

@Kekezito_LHP

 

Posso preparar 1 pra reset, ou ate mesmo voces... É de facil edição o script :D

Compartilhar este post


Link para o post
Ribas1574    1
Ribas1574

Inovador.

Muito bom script, esta no meu Servidor, com os devidos créditos.

Só uma duvida, os frags 'somem' ?

Na minha humilde opinião:

Approved

Editado por Ribas1574
Esqueci acento. E outro comentário !

Compartilhar este post


Link para o post
Theax    0
Theax

Ele exibe os FRAGS literalmente, portanto se o player peder algum frag, no look diminui tambem.

 

(Eu colocaria algo do tipo 100 frags pra Red skull sabe... pros players fazerem sua fama encima do look.)

-----------

 

Estou afastado do scripting pq to como Designer de 1 outro forum....

+ qnd voltar quem sabe eu n faça um que conta o numero de player mortos (ao inves dos frags),

Compartilhar este post


Link para o post
hicke98    0
hicke98

Mt show, soh nao ponho no meu ot pq eu fis uns iten edited lah pra vender no site pq tipo, tem os cara que fica se achano lah (pow eu so o fodao vo pegar top e mata todo mundo) ai o mlk lvl 500 chega no lvl 200, começa ataca o lvl 200 e morre askpaskpaskp, acabaria com essa graça ae mas na minha opniao ta mt bom.

Compartilhar este post


Link para o post
Theax    0
Theax

Tem um script que impede 1 player de atacar outro se ele for X lvls maior que o outro... Isso elimina os power abusers e ajuda no pvp tatico =D

:)

Compartilhar este post


Link para o post
VittinhoO    0
VittinhoO

IRado vou usar :D

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×