Ir para conteúdo

Danihcv

Conde
  • Total de itens

    926
  • Registro em

  • Última visita

  • Dias Ganhos

    18

Tudo que Danihcv postou

  1. Ok... Vamos tentar isolar o problema... Troque o seu script do sistema, por esse: *ou seja, troque o ultimo script que vc me mandou por pm, por esse: 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 local online = getOnlinePlayers() local winner = online[1] for l, pid in pairs(online) do if getPlayerFrags(online[l]) > getPlayerFrags(winner) then local winner = online[l] end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, tostring(getCreatureName(winner))) return true end
  2. @@felzan, geraram sim. Eu testei todos. Todos estão geraram o que é mostrado nas respectivas prints... Que estranho... #edit: estou me referindo aos testes feitos em 0.3
  3. Vlww @@felzan. Eu ja tava preparando o topico do 1.x ^^ @@Caronte vlw bro.
  4. @@viniciusd, amigo, vc baixou as sources do programa... sahusahu Pra baixar o programa executavel clique aqui. Porém, para a instalação e uso do mesmo, vc precisa ter o adobe air instalado.
  5. @@Vasto Lord X, amigo, vc soh pode dar 1 UP a cada 24 horas.
  6. Danihcv

    Escolinhas

    Acho q descolo um note hj a tarde. Então, acho q comparecerei.
  7. Disponha. ^^ <p>Tópico movido para dúvidas / pedidos resolvidos.</p>
  8. *Apenas a titulo de testes... Vá em data\talkactions e adicione essa tag ao arquivo talkactions.xml: <talkaction words="!teste" event="script" value="teste.lua"/> Agora vá em data\talkactions\scripts e crie um arquivo chamado teste.lua e adicione isso dentro: local 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 onSay(cid, words, param) local online = getOnlinePlayers() local winner = online[1] for l, pid in pairs(online) do if getPlayerFrags(online[l]) > getPlayerFrags(winner) then local winner = online[l] end end print(getCreatureName(winner)) return true end Agora, dentro do jogo utilize o comando !teste e então confira no console (distro) se apareceu algum nome de player avulso na ultima linha.
  9. Olá, xTibianos. Hoje venho lhes trazer outra lista de tipos de mensagens que podem ser mandadas aos players (por meio de scripts, óbvio). Os seguintes tipos de mensagens são os usados nas versões 1.x do The Forgotten Server (TFS para os íntimos). Segue a lista dos tipos de mensagens e uma breve descrição de como cada tipo de mensagem se apresenta in-game: MESSAGE_STATUS_CONSOLE_BLUE = 4, /*Mensagem azul no console*/ MESSAGE_STATUS_CONSOLE_RED = 13, /*Mensagem vermelha no console*/ MESSAGE_STATUS_DEFAULT = 17, /*Mensagem branca na parte inferior da tela do jogo e no console*/ MESSAGE_STATUS_WARNING = 18, /*Mensagem vermelha no centro da tela do jogo e no console*/ MESSAGE_EVENT_ADVANCE = 19, /*Mensagem branca no centro da tela do jogo e no console*/ MESSAGE_STATUS_SMALL = 21, /*Mensagem branca na parte inferior da tela do jogo"*/ MESSAGE_INFO_DESCR = 22, /*Mensagem verde no centro da tela do jogo e no console*/ MESSAGE_DAMAGE_DEALT = 23, /*Mensagem branca no console*/ MESSAGE_DAMAGE_RECEIVED = 24, MESSAGE_HEALED = 25, MESSAGE_EXPERIENCE = 26, MESSAGE_DAMAGE_OTHERS = 27, MESSAGE_HEALED_OTHERS = 28, MESSAGE_EXPERIENCE_OTHERS = 29, MESSAGE_EVENT_DEFAULT = 30, MESSAGE_LOOT = 31, MESSAGE_EVENT_ORANGE = 36, /*Mensagem laranja no console*/ MESSAGE_STATUS_CONSOLE_ORANGE = 37 lembrando que no script pode ser usado tanto a "parte escrita" quanto o numero correspondente! Agora segue uma sequencia de prints da execução de cada tipo de mensagem in-game: as divisórias "//" indicam que todas os tipos de mensagens presentes antes/depois delas surtem os mesmos efeitos (representados nas prints) MESSAGE_STATUS_CONSOLE_BLUE MESSAGE_STATUS_CONSOLE_RED MESSAGE_STATUS_DEFAULT // MESSAGE_EVENT_DEFAULT MESSAGE_STATUS_WARNING MESSAGE_EVENT_ADVANCE MESSAGE_STATUS_SMALL MESSAGE_INFO_DESCR // MESSAGE_LOOT MESSAGE_DAMAGE_DEALT // MESSAGE_DAMAGE_RECEIVED // MESSAGE_HEALED // MESSAGE_EXPERIENCE // MESSAGE_DAMAGE_OTHERS // MESSAGE_HEALED_OTHERS // MESSAGE_EXPERIENCE_OTHERS MESSAGE_EVENT_ORANGE // MESSAGE_STATUS_CONSOLE_ORANGE Por hoje é isso, galera. Espero que tenha sido útil. ^^ Créditos: @Danihcv
  10. Olá, xTibianos. Hoje venho lhes trazer algo simples mas bem prático: os tipos de mensagens que podem ser mandadas aos players (por meio de scripts, óbvio). Esses tipos de mensagens são os usados nas versões 0.3/0.4 do The Forgotten Server (TFS para os íntimos). Segue a lista dos tipos de mensagens: MESSAGE_STATUS_CONSOLE_BLUE = 4 MESSAGE_STATUS_CONSOLE_RED = 12 MESSAGE_STATUS_DEFAULT = 16 MESSAGE_STATUS_WARNING = 17 MESSAGE_EVENT_ADVANCE = 18 MESSAGE_STATUS_SMALL = 19 MESSAGE_INFO_DESCR = 20 MESSAGE_DAMAGE_DEALT = 21 MESSAGE_DAMAGE_RECEIVED = 22 MESSAGE_HEALED = 23 MESSAGE_EXPERIENCE = 24 MESSAGE_DAMAGE_OTHERS = 25 MESSAGE_HEALED_OTHERS = 26 MESSAGE_EXPERIENCE_OTHERS = 27 MESSAGE_EVENT_DEFAULT = 28 MESSAGE_LOOT = 29 MESSAGE_TRADE_NPC = 30 MESSAGE_EVENT_GUILD = 31 MESSAGE_PARTY_MANAGEMENT = 32 MESSAGE_PARTY = 33 MESSAGE_EVENT_ORANGE = 34 MESSAGE_STATUS_CONSOLE_ORANGE = 35 MESSAGE_REPORT = 36 MESSAGE_HOTKEY_USE = 37 lembrando que no script pode ser usado tanto a "parte escrita" quanto o numero correspondente! Agora segue uma sequencia de prints da execução de cada tipo de mensagem in-game: as divisórias "//" indicam que todas os tipos de mensagens presentes antes/depois delas surtem os mesmos efeitos (representados nas prints) MESSAGE_STATUS_CONSOLE_BLUE MESSAGE_STATUS_CONSOLE_RED MESSAGE_STATUS_DEFAULT // MESSAGE_EVENT_DEFAULT MESSAGE_STATUS_WARNING MESSAGE_EVENT_ADVANCE // MESSAGE_REPORT MESSAGE_STATUS_SMALL MESSAGE_INFO_DESCR // MESSAGE_LOOT // MESSAGE_TRADE_NPC // MESSAGE_EVENT_GUILD // MESSAGE_PARTY_MANAGEMENT // MESSAGE_PARTY // MESSAGE_HOTKEY_USE MESSAGE_DAMAGE_DEALT // MESSAGE_DAMAGE_RECEIVED // MESSAGE_HEALED // MESSAGE_EXPERIENCE // MESSAGE_DAMAGE_OTHERS // MESSAGE_HEALED_OTHERS // MESSAGE_EXPERIENCE_OTHERS MESSAGE_EVENT_ORANGE // MESSAGE_STATUS_CONSOLE_ORANGE Por hoje é isso, galera. Espero que tenha sido útil. ^^ Créditos: @Danihcv
  11. @, shauashuash vlw bro! ^^
  12. Tópico movido para dúvidas / pedidos resolvidos.
  13. FINALMENTEE!!!!! shuahsuauhas Consegui! Eis o .lua: 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 -------------------------- ----PARTE CONFIGURAVEL---- -------------------------- local gatilhos={"informacoes", "mysterious island", "second promotion"} local msgs = { ["informacoes"] = "Sobre o que você quer saber? Sobre a {mysterious island} ou sobre a {second promotion}?", ["mysterious island"] = 'É uma ilha que antigos diziam ficar ao sudoeste de Carlin. Há um teleport que dizem aparecer nos pântanos de Venore, talvez, ele leve a essa ilha.', ["second promotion"] = 'Há um NPC que vem de muito longe e fica a caminhas pelos campos de Thais, dizem que ele pode dar a segunda vocação para os aventureiros.', } local vocs = {1,2,5} ----------------------------- --FIM DA PARTE CONFIGURAVEL-- ----------------------------- function greetCallback(cid) if isInArray(vocs, getPlayerVocation(cid)) then npcHandler:say('Olá, '..getCreatureName(cid)..'. O que você procura? {Informacoes}?', cid) npcHandler:addFocus(cid) else npcHandler:say('Eu não falo com '..getVocationInfo(getPlayerVocation(cid)).name..'s.', cid) npcHandler:resetNpc(cid) return false end return false end function creatureSayCallback(cid, type, msg) for k, v in pairs(gatilhos) do if isInArray(vocs, getPlayerVocation(cid)) then if msgcontains(msg, v) then if msgcontains(msg, v) then npcHandler:say(msgs[v], cid) end elseif msgcontains(msg, 'bye') or msgcontains(msg, 'goodbye') then npcHandler:resetNpc(cid) return false end else npcHandler:say('Eu ja disse que nao falo com '..getVocationInfo(getPlayerVocation(cid)).name..'s.', cid) npcHandler:releaseFocus(cid) npcHandler:resetNpc(cid) return false end end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) .xml: <?xml version="1.0" encoding="UTF-8"?> <npc name="Ezequiel" script="data/npc/scripts/Ezequiel.lua" walkinterval="1500" speed="100" walkradius="2" floorchange="0"> <health max="100" now="100"/> <look type="130" head="0" body="64" legs="67" feet="114" addons="1" mount="0"/> </npc> Funciona assim: Essa tabela: Tem que estar em sincronia com essa: Ou seja, o primeiro gatilho da tabela gatilhos tem que ser o primeiro elemento da tabela msgs. E assim por diante.? Bom, a espera valeu a pena, caro amigo. sahusauhsauh Eu mesmo testei e está td certo. ^^ Tópico movido para dúvidas / pedidos resolvidos.
  14. Danihcv

    aura system

    Tópico movido para dúvidas / pedidos resolvidos.
  15. Tópico movido para dúvidas / pedidos resolvidos.
  16. Tópico movido para dúvidas / pedidos resolvidos.
  17. @, tranquilo então. ^^ sahusahuas #EDIT: Editei meu post anterior com o script para acrescentar a nova versão do script, sem bug algum.
  18. @, eu acabei de mandar o script pra vc corrigido no seu topico.
  19. Danihcv

    ALTERA SCRIPT

    Tópico movido para dúvidas / pedidos resolvidos.
  20. Update: O script continha um bug que permitia crashar o servidor (caso o player botasse um numero negativo) e tambem caso o parametro não fosse um numero, o player falava uma mensagem normal. Esse erros foram corrigidos: situationpoints.lua: local pointObj = 2160 --id do item "points" function getAccountPoints(cid) local res = db.getResult('SELECT `premium_points` FROM `accounts` WHERE id='..getPlayerAccountId(cid)..'') if(res:getID() == -1) then return false end local ret = res:getDataInt("premium_points") res:free() return tonumber(ret) end function onSay(cid, words, param) if (words == '!sacar') then if param ~= "" then if tonumber(param) ~= nil then if 0 >= tonumber(param) then doPlayerSendCancel(cid, "O valor precisa ser acima de zero.") elseif 0 < tonumber(param) and tonumber(param) <= getAccountPoints(cid) then doPlayerAddItem(cid, pointObj, tonumber(param)) db.executeQuery('UPDATE `accounts` SET `premium_points`='..getAccountPoints(cid) - tonumber(param)..' WHERE id='.. getPlayerAccountId(cid)..'') newPoints = getAccountPoints(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você ainda possui '..newPoints..' premium points em sua conta.') else doPlayerSendCancel(cid, "Você não tem tantos premium points assim.") end else doPlayerSendCancel(cid, "O valor precisa ser um numero.") end else doPlayerSendCancel(cid, "Você precisa especificar um valor.") end elseif (words == '!saldo') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Seu saldo no shopping atual é de '..getAccountPoints(cid)..' Premium points.') elseif (words == '!depositar') then if param ~= "" then if tonumber(param) ~= nil then if 0 >= tonumber(param) then doPlayerSendCancel(cid, "O valor precisa ser acima de zero.") elseif 0 < tonumber(param) and tonumber(param) <= getPlayerItemCount(cid, pointObj) then doPlayerRemoveItem(cid, pointObj, tonumber(param)) db.executeQuery('UPDATE `accounts` SET `premium_points`='..getAccountPoints(cid) + tonumber(param)..' WHERE id='.. getPlayerAccountId(cid)..'') newPoints = getAccountPoints(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você acabou de depositar '..param..' premium points no shopping. Seu saldo agora é de '..newPoints..' premium points.') else doPlayerSendCancel(cid, "Você não tem tantos premium points assim.") end else doPlayerSendCancel(cid, "O valor precisa ser um numero.") end else doPlayerSendCancel(cid, "Você precisa especificar um valor.") end end return true end A tag em talkactions.xml permanece a mesma.
  21. @@Dennyz Dias, putz cara, eu acabei de testar. E tá tudo certo... Como é q vc ta usando o comando in-game? Eu usei: !depositar 100 (por exemplo) e deu tudo tranquilo...
  22. Danihcv

    ALTERA SCRIPT

    Deixa assim: [LUA]--[[ day_of_week: 0 = Sunday, 1 = Monday ... 6 = Saturday hour: value between 0 and 23 minute: value between 0 and 59 storage: unique, not used global storage value --]] local autoStartsTable = { {["day_of_week"] = 6, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7867}, {["day_of_week"] = 5, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7869}, {["day_of_week"] = 4, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7870}, {["day_of_week"] = 3, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7871}, {["day_of_week"] = 2, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7872}, {["day_of_week"] = 1, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7873}, {["day_of_week"] = 0, ["hour"] = 21, ["minute"] = 0, ["storage"] = 7868} } function shouldExecuteEvent(configTable) for _, config in pairs(configTable) do if(tonumber(os.date("%d")) ~= getStorage(config.storage) and tonumber(os.date("%w")) == config.day_of_week) then if(tonumber(os.date("%H")) == config.hour and tonumber(os.date("%M")) == config.minute) then doSetStorage(config.storage, tonumber(os.date("%d"))) return true end end end return false end function onThink(interval, lastExecution, thinkInterval) if(shouldExecuteEvent(autoStartsTable)) then if(getStorage(ZE_STATUS) ~= 1 and getStorage(ZE_STATUS) ~= 2) then removeZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 1) doBroadcastMessage("Zombie Arena Event teleport will be open for 2 minutes. We are waiting for " .. getZombiesEventPlayersLimit() - #getZombiesEventPlayers() .. " players to start.") addEvent(startArenaEvent, 120 * 1000) end end return true end function startArenaEvent() if(getStorage(ZE_STATUS) == 1) then addZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 2) doBroadcastMessage("Zombie Arena Event started.") end end Não esquece que vc pode alterar a hora de inicioa pra cada dia. Basta alterar a parte referente a hour e minute referente aql determinado dia.
  23. @@Dennyz Dias, aparece alguma mensagem in-game? Se sim, qual mensagem?
  • Quem Está Navegando   0 membros estão online

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