Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. no seu serve não existe essa função getPlayerSecureMode https://otland.net/threads/securemode-pvp-system.128600/
  2. Vodkart postou uma resposta no tópico em Mapas de Tibia
    é porque você mora no meu e no meu 8=====D
  3. function onSay(cid, words, param) local areas ={ -- areas bloqueadas {from = {x=1014,y=1016,z=7},to = {x=1017,y=1019,z=7}}, -- começo da area e final da area {from = {x=1008,y=1018,z=7},to = {x=1011,y=1021,z=7}} } local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = true, -- se os teleport irão custa (true or false) need_level = true, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } --[[ Config lugares]]-- local lugar = { ["templo"] = { -- nome do lugar pos = {x=1029, y=907, z=6},level = 150, price = 000}, ["arena"] = { -- nome do lugar pos = {x=1001, y=915, z=7},level = 150,price = 000}, } --[[ Lista de Viagem (Não mexa) ]]-- if (param == "lista") then local str = "" str = str .. "lista de viagem :\n\n" for name, pos in pairs(lugar) do str = str..name.."\n" end str = str .. "" doShowTextDialog(cid, 6579, str) return TRUE end local a = lugar[param] for _, var in ipairs(areas) do if isInRange(getCreaturePosition(cid), var.from, var.to) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você nao pode usar o comando nesta area.") return true end end if not(a) then doPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem teleportar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.") return TRUE elseif config.need_level == true and getPlayerLevel(cid) < a.level then doPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then doPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE end doTeleportThing(cid, a.pos) doSendMagicEffect(a.pos, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".") return TRUE end
  4. Vodkart postou uma resposta no tópico em Mapas de Tibia
    Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.
  5. joga essa função na sua lib: function convertTime(a) if(type(tonumber(a)) == "number" and a > 0) then if (a <= 3599) then local minute = math.floor(a/60) local second = a - (60 * minute) if(second == 0) then return ((minute)..((minute > 1) and " minutos" or " minuto")) else return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo")) end else local hour = math.floor(a/3600) local minute = math.floor((a - (hour * 3600))/60) local second = (a - (3600 * hour) - (minute * 60)) if (minute == 0 and second > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo")) elseif (second == 0 and minute > 0) then return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto")) elseif (second == 0 and minute == 0) then return (hour..((hour > 1) and " horas" or " hora")) end return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo")) end end end e a talk vc usa assim: function onSay(cid, words, param, channel) local potion_storage = 61002 return doPlayerSendTextMessage(cid, 25, getPlayerStorageValue(cid, potion_storage) - os.time() <= 0 and "voce nao tem exp potion no momento." or "voce tem "..convertTime(getPlayerStorageValue(cid, potion_storage) - os.time()).." de exp potion") end
  6. falha minha! local lvl = 12000 local entrada = { {x = 80, y = 6, z = 7}, -- pos players {x = 81, y = 6, z = 7}, {x = 82, y = 6, z = 7}, {x = 83, y = 6, z = 7}, {x = 84, y = 6, z = 7}, {x = 85, y = 6, z = 7}, {x = 86, y = 6, z = 7}, {x = 87, y = 6, z = 7}, {x = 88, y = 6, z = 7}, {x = 89, y = 6, z = 7} } local saida = {x = 1675, y = 1521, z = 7} function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} for _, k in ipairs(entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < lvl) then doPlayerSendCancel(cid, 'esta faltando jogador ou alguem nao tem '..lvl..' ou mais.') return true end check[#check+1] = x end for _, pid in pairs(check) do doSendMagicEffect(getPlayerPosition(pid), CONST_ME_POFF) doTeleportThing(pid, saida) doSendMagicEffect(getPlayerPosition(pid), CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
  7. usa esse que é bom pra iniciante https://tibiaking.com/forums/topic/2705-ferramentas-para-scripters/ Script Live By colex.rar
  8. para quem quiser o sistema, aqui está o código sem bugs de formatação do fórum: https://pastebin.com/raw/inBHcJaL
  9. function doEffectPlayer(cid, effect, store) if not isCreature(cid) then return LUA_ERROR end if getPlayerStorageValue(cid, store) >= os.time() then doSendMagicEffect(getThingPos(cid), effect) addEvent(doEffectPlayer, 200, cid, effect, store) -- 300 é o speed do efeito pode configurar end end function onStepIn(cid, item, position, fromPosition) local efeito, seconds = 44,3 -- configure aqui o numero do efeito e tempo em segundos que vai durar o efeito local exausted, var, storage = 5, 548754, 548755 -- 5 minutos para voltar e usar o tile novamente if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, var) - os.time() <= 0 then setPlayerStorageValue(cid, storage, os.time()+seconds) doEffectPlayer(cid, efeito, storage) setPlayerStorageValue(cid, var, os.time()+exausted*60) end return true end
  10. quando eu te passei o código estava um looping na action, quando voltou, esse looping sumiu misteriosamente... só olhar na action alguem removei o dele. não sei se foi o fórum ou alguém ? descobri!! quando vocês colam o código sem a tag de code ele bugga pq nao reconhece o "" entendeu? fica italico e some... ai ai some o [i] -- some << se não for usado de forma certa, tem que ser no bb code
  11. local lvl = 100 local entrada = { {x = 710, y = 1420, z = 5}, -- pos players {x = 709, y = 1420, z = 5}, {x = 708, y = 1420, z = 5}, {x = 707, y = 1420, z = 5}, {x = 706, y = 1420, z = 5}, {x = 705, y = 1420, z = 5}, {x = 704, y = 1420, z = 5}, {x = 703, y = 1420, z = 5}, {x = 702, y = 1420, z = 5}, {x = 701, y = 1420, z = 5} } local saida = {x = 28, y = 779, z = 7} function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} for _, k in ipairs(entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < lvl) then doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..lvl..' ou mais.') return true end table.insert(check, x) end for i, tid in ipairs(check) do doSendMagicEffect(entrada[i], CONST_ME_POFF) doTeleportThing(tid, saida[i], false) doSendMagicEffect(saida[i], CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
  12. percebi isso tbm, e ta me deixando com raiva, vou começar a simplesmente jogar o código num quote mesmo adc la na ultima linha msm, na sua lib...
  13. adc na sua lib: function isInRange(pos, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end dps fecha e abre o server
  14. <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Guild For Arena Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="gfae_config"><![CDATA[ config = { positions = { {{x=44, y=279, z=7}, {x=21, y=480, z=7}}, {{x=45, y=279, z=7}, {x=21, y=480, z=7}}, {{x=44, y=280, z=7}, {x=21, y=480, z=7}}, {{x=45, y=280, z=4}, {x=21, y=480, z=7}}, }, positions2 = { {{x=47, y=279, z=7}, {x=78, y=448, z=7}}, {{x=48, y=279, z=7}, {x=78, y=448, z=7}}, {{x=47, y=280, z=7}, {x=78, y=448, z=7}}, {{x=48, y=280, z=7}, {x=78, y=448, z=7}}, }, money = 500,-- em k hours = 5, -- para voltar a arena storage = 889757, a = {x= 14, y=442, z=7}, -- pos começo da arena b = {x=87, y=492, z=7}, -- pos final da arena exit_pos = {x=154, y=160, z=7} } function getPlayersWithGuildInArena(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end function endArenaEvent(cid, p1, p2) for _, ret in pairs(getPlayersWithGuildInArena(p1, p2)) do if getPlayerGuildId(cid) ~= getPlayerGuildId(ret) then return false end end return true end ]]></config> <event type="login" name="GuildForArenaLogin" event="script"><![CDATA[ domodlib('gfae_config') function onLogin(cid) registerCreatureEvent(cid, "GuildForArenaDeath") if getCreatureName(cid) ~= "Account Manager" and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="preparedeath" name="GuildForArenaDeath" event="script"><![CDATA[ domodlib('gfae_config') function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) if endArenaEvent(deathList[1], config.a, config.b) then -- qndo acaba o evento for _, ret in pairs(getPlayersWithGuildInArena(config.a, config.b)) do doPlayerAddItem(ret, 1999, 1) -- premio doTeleportThing(ret, config.exit_pos) end doBroadcastMessage("A guild "..getPlayerGuildName(deathList[1]).." Foi a vencedora da arena!") end end return true end]]></event> <action actionid="7124" event="script"><![CDATA[ domodlib('gfae_config') function onUse(cid, item, fromPosition, item2, toPosition) if #getPlayersWithGuildInArena(config.a, config.b) > 0 then return doPlayerSendCancel(cid, "espere, atualmente ha guilds batalhando.") and doSendMagicEffect(getThingPos(cid), 2) end for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Nao existe players em todas as posicoes.") and doSendMagicEffect(getThingPos(cid), 2) end local guild1 = getPlayerGuildId(getTopCreature(config.positions[1][1]).uid) if getPlayerGuildId(creature) ~= guild1 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end -- Checando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Not enough players.") and doSendMagicEffect(getThingPos(cid), 2) end local guild2 = getPlayerGuildId(getTopCreature(config.positions2[1][1]).uid) if getPlayerGuildId(creature) ~= guild2 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end doBroadcastMessage("Começou uma batalha entre ".. getPlayerGuildName(getTopCreature(config.positions[1][1]).uid) .." e ".. getPlayerGuildName(getTopCreature(config.positions2[1][1]).uid)..".") -- Teleportando posições 1 for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid doTeleportThing(creature, config.positions[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end -- Teleportando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid doTeleportThing(creature, config.positions2[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end return true end]]></action> </mod>? seu serve existe a função isInRange?
  15. vc nao configurou a exiit pos , olha ali!!!
  16. você configurou a pos errada... deixa eu ver como ficou e manda lá no paint a pos do mapa pra eu configurar. a pos do sqm la de cima e dps a de baixo.
  17. postei a imagem ali da configuração das posição. vc viu? a config.a e config.b ???
  18. o meu bloco de notas bugou o código, apareceu uns caracteres especiais "?" dentro do código. tenta assim: <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Guild For Arena Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="gfae_config"><![CDATA[ config = { positions = { {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, }, positions2 = { {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, {{x=535, y=1597, z=4}, {x=535, y=2000, z=4}}, }, money = 500,-- em k hours = 5, -- para voltar a arena storage = 889757, a = {x=535, y=1597, z=4}, -- pos começo da arena b = {x=540, y=1600, z=4}, -- pos final da arena exit_pos = {x=154, y=160, z=7} } function getPlayersWithGuildInArena(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end function endArenaEvent(cid, p1, p2) for _, ret in pairs(getPlayersWithGuildInArena(p1, p2)) do if getPlayerGuildId(cid) ~= getPlayerGuildId(ret) then return false end end return true end ]]></config> <event type="login" name="GuildForArenaLogin" event="script"><![CDATA[ domodlib('gfae_config') function onLogin(cid) registerCreatureEvent(cid, "GuildForArenaDeath") if isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end]]></event> <event type="preparedeath" name="GuildForArenaDeath" event="script"><![CDATA[ domodlib('gfae_config') function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) if endArenaEvent(deathList[1], config.a, config.b) then -- qndo acaba o evento for _, ret in pairs(getPlayersWithGuildInArena(config.a, config.b)) do doPlayerAddItem(ret, 1999, 1) -- premio doTeleportThing(ret, config.exit_pos) end doBroadcastMessage("A guild "..getPlayerGuildName(deathList[1]).." Foi a vencedora da arena!") end end return true end]]></event> <action actionid="84020" event="script"><![CDATA[ domodlib('gfae_config') function onUse(cid, item, fromPosition, item2, toPosition) if #getPlayersWithGuildInArena(config.a, config.b) > 0 then return doPlayerSendCancel(cid, "espere, atualmente ha guilds batalhando.") and doSendMagicEffect(getThingPos(cid), 2) end for i = 1, #config.positions do local creature = getTopCreature(config.positions[i][1]).ui if not isPlayer(creature) then return doPlayerSendCancel(cid, "Nao existe players em todas as posicoes.") and doSendMagicEffect(getThingPos(cid), 2) end local guild1 = getPlayerGuildId(getTopCreature(config.positions[1][1]).uid) if getPlayerGuildId(creature) ~= guild1 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end -- Checando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[i][1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Not enough players.") and doSendMagicEffect(getThingPos(cid), 2) end local guild2 = getPlayerGuildId(getTopCreature(config.positions2[1][1]).uid) if getPlayerGuildId(creature) ~= guild2 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end doBroadcastMessage("Começou uma batalha entre ".. getPlayerGuildName(getTopCreature(config.positions[1][1].uid)) .." e ".. getPlayerGuildName(getTopCreature(config.positions2[1][1]).uid) ..".") -- Teleportando posições 1 for i = 1, #config.positions do local creature = getTopCreature(config.positions[i][1]).uid doTeleportThing(creature, config.positions[i][2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end -- Teleportando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[i][1]).uid doTeleportThing(creature, config.positions2[i][2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end return true end]]></action> </mod> configura assim a pos A e pos B lá na config:
  19. Sozinho, copiando script e alterando, tentando entender e tal... Na época tava cansado de fazer pedido de script no xtibia(n existia tk ainda) e ngm responder, cansei de esperar já que não tenho paciência praticamente pra nada e comecei a fuçar pra aprender alguma coisa, nunca fui programador e faço faculdade de Direito. Abraços.
  20. #REMOVIDO CÓDIGO BUGADO Só não esqueça na arena de colocar PVP TOOL e AREA NO LOGOUT
  21. eu to saindo agora, se ninguém fizer de noite eu dou uma olhada pra você!! vou almoçar fora e passar a tarde com a minha morena... abraços.
  22. Faz no action um script de tempo também, digamos que você possa ficar no máximo 10 min na arena. Esse script é tipo do battlefield, a diferença que não precisaria colocar storage para diferenciar, a "storage" seria a guild em questão... Só jogar 4 global storage e assim cada vez que matasse 1 a storage ia de 4 para 3 e assim sucessivamente. quando matasse o último dava a premiação para os jogadores que estiverem na arena.
  23. domodlib('task_func') LimiteQuestCount = 30 -- coloque de acordo com a quantidade de quests existente no seu servidr QuestCountSystem = 123419 -- é a storage da system, lembre-se, não deve existe outra igual function getQuestCompletCount(uid, storage) if isPlayer(uid) then if getPlayerStorageValue(uid, storage) == -1 then return 0 end return getPlayerStorageValue(uid, storage) end end 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)..']['..(getPlayerStorageValue(thing.uid, 13540) - os.time() > 0 and 'VIP' or 'FREE')..'], [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48913)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48902)) or 0))..']\nQuests Completas: ['..getQuestCompletCount(thing.uid, QuestCountSystem)..'/'..LimiteQuestCount..']\n'..(getPlayerSex(thing.uid) == 0 and 'She' or 'He')..' is a '..GetRankTask(thing.uid)) return true elseif thing.uid == cid then doPlayerSetSpecialDescription(cid,' [Frags: '..getPlayerFrags(cid)..']['..(getPlayerStorageValue(cid, 13540) - os.time() > 0 and 'VIP' or 'FREE')..'], [Critical: '..math.max(0,(tonumber(getCreatureStorage(cid,48913)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(cid,48902)) or 0))..']\nQuests Completas: ['..getQuestCompletCount(cid, QuestCountSystem)..'/'..LimiteQuestCount..']\n'..(getPlayerSex(cid) == 0 and 'She' or 'He')..' is a '..GetRankTask(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
  24. o action do bau local t = { storage = 678678, -- storage, so mude se tiver usando pra outra coisa. tempo = 24, -- Tempo em horas. qt = 250, -- quatidade. itemidxx = 6527 -- Item que ira ganhar. } function onUse(cid, item, fromPos, itemEx, toPos) if getPlayerStorageValue(cid, t.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "Você só poderá abrir seu bau em "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,t.storage))..".") end setPlayerStorageValue(cid, t.storage, os.time() + t.tempo * 60 * 60) doPlayerSendTextMessage(cid, 25, "Voce ganhou "..t.qt.." "..t.itemidxx.." diário, espere até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,t.storage)).." para pegar novamente.") doPlayerAddItem(cid,t.itemidxx,t.qt) return true end o tile: local storage = 678678 function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end return doPlayerSendTextMessage(cid, 25, getPlayerStorageValue(cid,storage) <= os.time() and "Você está apto a pegar a recompesa do báu" or "Você só poderá abrir seu bau em "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,storage))..".") end

Informação Importante

Confirmação de Termo