Ir para conteúdo

lugk123

Campones
  • Total de itens

    59
  • Registro em

  • Última visita

Posts postados por lugk123

  1. Consegui solucionar meu problema, bastava fazer isto, caso alguem tenha uma dúvida.

    em talkactions>frags.lua

    local config = {
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
    advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
    }
    function onSay(cid, words, param, channel)
    if(not config.useFragHandler) then
     return false
    end
    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 = {
       name = result:getDataString("name"),
       level = result:getDataInt("level"),
       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)
    }
    if(config.advancedFragList) then
     local result = "Frags gained today: " .. size.day .. "."
     if(size.day > 0) then
      for _, content in ipairs(contents.day) do
       result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
      end
      result = result .. "\n"
     end
     result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
     if(size.week > 0) then
      for _, content in ipairs(contents.week) do
       result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
      end
      result = result .. "\n"
     end
     result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
     if(size.month > 0) then
      for _, content in ipairs(contents.month) do
       result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
      end
      result = result .. "\n"
     end
     local skullEnd = getPlayerSkullEnd(cid)
     if(skullEnd > 0) then
      result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, result)
    else
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
     if(size.day > 0) then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
     end
     local skullEnd = getPlayerSkullEnd(cid)
     if(skullEnd > 0) then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
     end
    end
    return true
    end
    

      <talkaction words="!frags" script="frags.lua"/>
    

    e em creaturescripts, segue este tutorial:

    http://www.xtibia.com/forum/topic/145118-creatureevent-contagem-de-frags-no-look/
    

    e no config.lua

    useBlackSkull = true
    useFragHandler = true
    advancedFragList = false
    

    /\ tava advancedFragList=true

     

    pode mover

  2. Mas, eu não peguei do tópico. Eu peguei do meu ot, e no meu ot esse script está funcionando perfeitamente!

    Ah, malz ae...Vou testar, e se funcionar vo falar editando aqui.

    EDIT---

    Bom, cara, agora deu esse erro:

    [25/03/2013 18:45:14] Error during getDataInt(frags).
    

  3. Precisa executar nada na database não. Usa esse fraglook aqui.

     

    Vá em Pasta do seu OT/data/creaturescripts/scripts/fraglook.lua, e coloque 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, vá em Pasta do seu OT/data/creaturescripts/creaturescripts.xml, e adicione essas tag:

     

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

    Cara, ja disse denovo "Esse script não aumenta de frag quando um player mata, mesmo injustamente fica "[Frags:0]"

  4. Gente, qualé, ao menos leiam o script todo antes de tentar ajudar alguém, desse jeito vocês não vão conseguir ajudar ninguém.

     

    @Topic

     

    Refiz o script aqui:

     

    local vip = false -- Precisa ser VIP? (true / false)
    local vip_storage = 37191 -- Storage da VIP
    local cobrar = false -- Cobrar em dinheiro? (true / false)
    local price = 10000 -- Preço em gold coins
    local item = true -- Cobrar algum item? (true / false)
    local id = 11192 -- ID do item
    local count = 10 -- Quantidade do item
    
    function onSay(cid, words, param)
    if not param then
    	doPlayerSendCancel(cid, "Você precisa escrever algo.") return true
    elseif vip and getPlayerStorageValue(cid, vip_storage) - os.time() <= 0 then
    	doPlayerSendCancel(cid, "Você não é vip.") return true
    elseif cobrar and not doPlayerRemoveMoney(cid, price) then
    	doPlayerSendCancel(cid, "Você não possui VIP coins suficientes.") return true
    elseif item and not doPlayerRemoveItem(cid, id, count) then
    	doPlayerSendCancel(cid, "Você precisa ter "..count.."x "..getItemNameById(id).." para usar o broadcast.") return true
    end
    
    doBroadcastMessage(""..getCreatureName(cid).." ["..getPlayerLevel(cid).."]: "..param.."", MESSAGE_INFO_DESCR)
    return true
    end

     

    Configurando:

     

    local vip = false -- Precisa ser VIP? (true / false)
    local vip_storage = 37191 -- Storage da VIP
    local cobrar = false -- Cobrar em dinheiro? (true / false)
    local price = 10000 -- Preço em gold coins
    local item = true -- Cobrar algum item? (true / false)
    local id = 11192 -- ID do item
    local count = 10 -- Quantidade do item

    Vlw mesmo Luck Oake, funcionou certinho +REPP(EDIT.Amanhã te dou o rep pq ja dei rep hoje)

    Aproveitando...Da pra vc tentar solucionar essa minha outra duvida ???

    http://www.xtibia.com/forum/topic/210489-contador-de-frags/
    

  5. Opa, vacilo meu :)

    Spoiler

     

     

    ------ Script By MatheusMkalo for Xtibia.com Users -------

    local configs = {

    cobrar = "sim", ------ Use sim ou nao para cobrar.

    sovip = " ", ------ Se somente vip players poderam usar o comando

    price = 0 -- Preço

    id = 11192, ------ Id do item.

    storage = 13710 ------ Storage Id da sua vip account caso for usar somente vips

    }

    function onSay(cid, words, param)

    local nada = {" "}

     

    if table.isStrIn(param, nada) or param == "" then

    doPlayerSendCancel(cid,"Voce precisa falar alguma coisa.")

    return TRUE

    end

     

    if configs.sovip == "sim" and getPlayerStorageValue(cid, tonumber(configs.storage)) - os.time() <= 0 then

    doPlayerSendCancel(cid,"Você não é vip.")

    return TRUE

    end

     

    if configs.cobrar == "sim" and doPlayerRemoveItem(cid, configs.id) and doPlayerRemoveMoney(cid, config.price) then

    doPlayerSendCancel(cid,"Você não tem o item necessario.")

    end

    return true

     

    doBroadcastMessage(""..getCreatureName(cid).." ["..getPlayerLevel(cid).."]: " .. param .. "", MESSAGE_INFO_DESCR)

    return TRUE

    end

    Agora deu esse erro:

    [24/03/2013 10:20:00] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/talkbroad.lua:6: '}' expected (to close '{' at line 2) near 'id'
    [24/03/2013 10:20:00] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/talkbroad.lua)
    [24/03/2013 10:20:00] data/talkactions/scripts/talkbroad.lua:6: '}' expected (to close '{' at line 2) near 'id'
    

  6. Troca por isso:

     

     

    ------ Script By MatheusMkalo for Xtibia.com Users -------

    local configs = {

    cobrar = "sim", ------ Use sim ou nao para cobrar.

    sovip = " ", ------ Se somente vip players poderam usar o comando

    price = 0, ------ Preço a pagar se o cobrar estiver ativado.

    storage = 13710, ------ Storage Id da sua vip account caso for usar somente vips

    money = 11192 --- ID DO ITEM ( MONEY ) OBS : JA COLOQUEI

    }

    function onSay(cid, words, param)

    local nada = {" "}

     

    if table.isStrIn(param, nada) or param == "" then

    doPlayerSendCancel(cid,"Voce precisa falar alguma coisa.")

    return TRUE

    end

     

    if configs.sovip == "sim" and getPlayerStorageValue(cid, tonumber(configs.storage)) - os.time() <= 0 then

    doPlayerSendCancel(cid,"Você não é vip.")

    return TRUE

    end

     

    if configs.cobrar == "sim" and not doPlayerRemoveItem(cid,configs.money,price) then

    doPlayerSendCancel(cid,"Você não tem dinheiro suficiente.")

    return TRUE

    end

     

    if doPlayerRemoveItem(cid,configs.money,price) == true then

    doBroadcastMessage(""..getCreatureName(cid).." ["..getPlayerLevel(cid).."]: " .. param .. "", MESSAGE_INFO_DESCR)

    end

    return TRUE

    end

     

     

    No começo, aonde ta vermelho, você muda o preço e o ID do money.

    Nem funcionou...O script funciona como se não custasse nada

    Ja tentou o meu? :)

    A mesma coisa, cara.

     

    É claro, eu falei que no começo do script que eu passei aond ta vermelho, aonde ta

    price=0"

    tem que coloca o preço

    N, eu coloquei sim

  7. Troca por isso:

     

     

    ------ Script By MatheusMkalo for Xtibia.com Users -------

    local configs = {

    cobrar = "sim", ------ Use sim ou nao para cobrar.

    sovip = " ", ------ Se somente vip players poderam usar o comando

    price = 0, ------ Preço a pagar se o cobrar estiver ativado.

    storage = 13710, ------ Storage Id da sua vip account caso for usar somente vips

    money = 11192 --- ID DO ITEM ( MONEY ) OBS : JA COLOQUEI

    }

    function onSay(cid, words, param)

    local nada = {" "}

     

    if table.isStrIn(param, nada) or param == "" then

    doPlayerSendCancel(cid,"Voce precisa falar alguma coisa.")

    return TRUE

    end

     

    if configs.sovip == "sim" and getPlayerStorageValue(cid, tonumber(configs.storage)) - os.time() <= 0 then

    doPlayerSendCancel(cid,"Você não é vip.")

    return TRUE

    end

     

    if configs.cobrar == "sim" and not doPlayerRemoveItem(cid,configs.money,price) then

    doPlayerSendCancel(cid,"Você não tem dinheiro suficiente.")

    return TRUE

    end

     

    if doPlayerRemoveItem(cid,configs.money,price) == true then

    doBroadcastMessage(""..getCreatureName(cid).." ["..getPlayerLevel(cid).."]: " .. param .. "", MESSAGE_INFO_DESCR)

    end

    return TRUE

    end

     

     

    No começo, aonde ta vermelho, você muda o preço e o ID do money.

    Nem funcionou...O script funciona como se não custasse nada

  8. Queria saber se da pra cobrar outro tipo de dinheiro em um script de broadcast (!b) que é desse item id "11192", pois está cobrando em coins(gold,platinum,crystal)

    ------ Script By MatheusMkalo for Xtibia.com Users -------

    local configs = {

    cobrar = "sim", ------ Use sim ou nao para cobrar.

    sovip = " ", ------ Se somente vip players poderam usar o comando

    price = 0, ------ Preço a pagar se o cobrar estiver ativado.

    storage = 13710 ------ Storage Id da sua vip account caso for usar somente vips

    }

    function onSay(cid, words, param)

    local nada = {" "}

     

    if table.isStrIn(param, nada) or param == "" then

    doPlayerSendCancel(cid,"Voce precisa falar alguma coisa.")

    return TRUE

    end

     

    if configs.sovip == "sim" and getPlayerStorageValue(cid, tonumber(configs.storage)) - os.time() <= 0 then

    doPlayerSendCancel(cid,"Você não é vip.")

    return TRUE

    end

     

    if configs.cobrar == "sim" and not doPlayerRemoveMoney(cid,tonumber(configs.price)) then

    doPlayerSendCancel(cid,"Você não tem dinheiro suficiente.")

    return TRUE

    end

     

    doBroadcastMessage(""..getCreatureName(cid).." ["..getPlayerLevel(cid).."]: " .. param .. "", MESSAGE_INFO_DESCR)

    return TRUE

    end

     

  9. Não da...é como eu disse "Esse script não aumenta de frag quando um player mata, mesmo injustamente fica "[Frags:0]".

    Só uma pergunta: precisa executa algo na database ???pois n ta funcionando

  10. Preciso de um script para meu ot 8.60 que, quando um player morre aparece uma mensagem encima do corpo.

    Testei o script desse tópico, porém não deu certo

    http://www.xtibia.com/forum/topic/153908-mensagem-ao-morrer-owned/
    

  11. Se jogava la no subwat-edited, kaiotp ? O único motivo de fechar o server é porque minha net não é muito boa, e causa muito lag...E que não queria pagar um dedicado. Quanto a sala da quest, vou tentar dar uma melhorada. :]

    -----------------------------------------

    Vlw Delaks !!!

  12. SUBWAT EDITED V 8.60

    O QUE TEM DE NOVO NO SERVER ?

    °NOVOS MONSTROS (SHACO, ASSASSINOS DE ELITE, EVIL MONSTER, THE MORT, THE ENERGY, THE FIRE, ELFO GUARDIAO, ELFO ESCOTEIRO)

    °TEMPLO MODIFICADO

    °NOVA QUEST (MASTER SECRET SD)

    °NOVO ITEM (MASTER SECRET SD)

    °NOVOS SCRIPS IMPLANTADOS

    °TODOS OS ERROS DO DISTRO FORAM RETIRADOS

    °DUAS NOVAS OUTFITS

     

    AGORA AS FOTOS

    TEMPLO

    11k8awo.png

     

    NOVO ITEM

    16ixo92.png

     

    SALA DAS QUESTS (COM BOSSES DE INFEITE PARA OS NOVOS JOGADORES VER)

    4lrha0.png

     

    CONTEUDO DOS TPS

    34rht05.png

     

    CONTEUDO DOS TPS

    2qkjfj8.png

    SENHA DO GOD

    acc number:god

    password:god

     

    SCAN

    DOWNLOAD

     

    CREDITOS

     

    EU

    Subwat

    Delaks

    Afeez

    marciks

    Kung San

    Animal Pak

  13. VLW

    pastadoot/data/npcs

     

    Crie um arquivo chamado Informações.xml

     

    e cole isso dentro

    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Central de Informacoes" script="data/npc/scripts/info.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look type="128" head="69" body="19" legs="68" feet="58"/>
    <parameters>
     <parameter key="message_greet" value="Bem Vindo |PLAYERNAME|! Diga os sobre o que deseja saber? {Aol}, {Bless}, {Task}, {Houses}, {A Sweaty Cyclops}, {Addons} , {Castle 24 Horas}." />
     <parameter key="message_decline" value="Bye Bye." />
     <parameter key="module_keywords" value="1" />
     <parameter key="keywords" value="bless;aol;task;a sweaty cyclops;houses;addons;castle;" />
     <parameter key="keyword_reply1" value="Use o comando !bless. Custa 50k" />
     <parameter key="keyword_reply2" value="Use o comando !aol. Custa 10k" />
     <parameter key="keyword_reply3" value="Task é o sistema de missões do servidor, o npc Grizzly Adams logo acima do templo. Saiba mais como funciona pelo site: http://sitedoseuot/?subtopic=task ."/>
     <parameter key="keyword_reply4" value="O NPC A Sweaty Cyclops é um ferreiro tem alguns itens que não se encontra em qualquer lugar. ele só negocia com pessoas espertas, por isso ele se encontra escondido pela cidade."/>
    		  <parameter key="keyword_reply5" value="Você pode comprar casa no server normalmente com o comando Alana res (Ou !buyhouse), tambêm pode negociar com players. O aluguel da house é semanal. Mais comandos de Houses no Site (Server Info)."/>
    		  <parameter key="keyword_reply6" value="Você pode adquirir addons no npc Varkhal, e pode adquirir a maiorinha dos itens comprando no npc Fabinho Addons. Outro modo seria com addon doll adquirindo pelo shop do site ou eventos."/>
    		  <parameter key="keyword_reply7" value="O Castle 24 horas é um castelo que ocorre sem nenhum tipo de inicio, ele é 24 horas e somente players com guilds podem conquista-lo, basta entrar no teleporte a minha esquerda e invadir o castelo com sua guild."/>
    </parameters>
    </npc>
    

     

     

    Ai vá em pastadoot/data/npcs/scripts

    e crie um arquivo chamados Info.lua

    e cole isso dentro

     

    local keywordHandler = KeywordHandler:new()
    local npcHandler = NpcHandler:new(keywordHandler)
    NpcSystem.parseParameters(npcHandler)
    
    function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
    function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
    function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
    function onThink() npcHandler:onThink() end
    
    npcHandler:addModule(FocusModule:new())
    
    

     

    VLW CARA, FUNCIONOU S
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...