Ir para conteúdo

FlavioHulk

Membro
  • Registro em

  • Última visita

Tudo que FlavioHulk postou

  1. Apenas reforçando o script do Gui ! function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:hasMount(23) then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have this mount.") return true end player:addMount(23) -- Id da Mount player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:say('You received Armoured War Horse.', TALKTYPE_ORANGE_1) return true end
  2. Qual TFS?
  3. local items = { [1] = 2293, -- item id [2] = 2294, } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == 1945 then if not player:removeMoney(100) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have a money.") return true end if math.random(1, 100) > 50 then local item = items[math.random(1, #items)] player:addItem(item, 1) Game.broadcastMessage("O jogador '"..player:getName().."' Acabou de ganhar um : "..item:getName()..".", MESSAGE_STATUS_WARNING) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You Lose") end item:transform(1946) player:getPosition():sendMagicEffect(CONST_ME_POFF) elseif item:getId() == 1946 then item:transform(1945) end return true end
  4. Então já que tu se acha o espertalhão, coisa que já vi agora, procura mais e vê se alguém te atende
  5. Cara, essa feature é do Static, esse sistema funciona perfeitamente no TFS 1.3
  6. Qual a distro? É realmente um desafio haha
  7. Então me desculpe, meu caro ! Ótimo trabalho a você, e continue ajudando como todo fórum deve ser :D
  8. Editei meu post, copie o script novamente...
  9. Tag XML: Adicionar em creaturescripts.xml <event type="kill" name="nomedoevento" script="nomedoscript.lua" /> Adicionar nome do evento em creaturescripts/others/login.lua, na tabela de events Script Lua: Adicionar na pasta scripts em creaturescripts local monster = 'nome do monstro' -- coloque o nome todo minusculo local storage = 63567 -- valor da Storage local msg = 'mensagem que ira aparecer' -- Configure a gosto function onKill(creature, target) local targetMonster = target:getMonster() if not targetMonster then return true end if targetMonster:getName():lower() ~= monster then return true end local player = creature:getPlayer() player:setStorageValue(storage, 1) player:sendTextMessage(MESSAGE_INFO_DESCR, msg) return true end Tag XML: Adicionar em actions.xml <action actionid="63567" script="nomedoarquivo.lua" /> Script Lua: Adicionar na pasta scripts em actions local config = { storage = 63567, -- ID da storage pos = Position(31821, 31918, 15) -- Posição que o jogador vai ser teletransportado } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.actionid ~= 63567 then return false end if player:getStorageValue(config.storage) < 1 then player:sendCancelMessage("You need kill the boss.") return true end player:teleportTo(config.pos) return true end
  10. Como assim? Cooldown na alavanca ou nos players que acessaram a quest?
  11. Qual TFS?
  12. local config = { levelRequiredToAdd = 20, maxOffersPerPlayer = 5, SendOffersOnlyInPZ = true, blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if param == '' then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = param:split(",") if t[1] == "add" then if not t[2] or not t[3] or not t[4] then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if not tonumber (t[3]) or not tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.") return true end if string.len(t[3]) > 7 or string.len(t[4]) > 3 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.") return true end local item = getItemIdByName(t[2]) if not item then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end if player:getLevel() < config.levelRequiredToAdd then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.") return true end if table.contains(config.blocked_items, item.itemid) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.") return true end if player:getItemCount(item) < tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).") return true end local check = db.storeQuery("SELECT `id` FROM `auction_system` WHERE `player` = " .. player:getGuid() .. ";") if check:getID() == -1 then -- elseif check:getRows(true) >= config.maxOffersPerPlayer then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.") return true end end if tonumber(t[4]) < 1 or tonumber(t[3]) < 1 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.") return true end local itemcount, costgp = math.floor(t[4]), math.floor(t[3]) player:removeItem(item, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.") end if t[1] == "buy" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end local buy = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if buy:getID() ~= -1 then if player:getMoney() < buy:getNumber("cost") then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enough GP.") buy:free() return true end if player:getName() == getPlayerGUIDByName(buy:getNumber("player")) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.") buy:free() return true end if player:getFreeCapacity() < getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getString("item_name") .. ". It weight " .. getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.") buy:free() return true end local itemStacks = ItemType(buy:getString("item_id")):isStackable() if itemStacks then player:addItem(buy:getString("item_id"), buy:getNumber("count")) else for i = 1, buy:getNumber("count") do player:addItem(buy:getString("item_id"), 1) end end player:removeMoney(buy:getNumber("cost")) db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "You bought " .. buy:getNumber("count") .. " ".. buy:getString("item_name") .. " for " .. buy:getNumber("cost") .. " gps!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getNumber("cost") .. " WHERE `id` = " .. buy:getNumber("player") .. ";") buy:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "remove" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end local delete = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if delete:getID() ~= -1 then if player:getGuid() == delete:getNumber("player")) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") local itemStack = ItemType(delete:getString("item_id")):isStackable() if itemStack then player:addItem(delete:getString("item_id"), delete:getNumber("count")) else for i = 1, delete:getNumber("count") do player:addItem(delete:getString("item_id"), 1) end end player:sendTextMessage(MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!") end delete:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end if t[1] == "withdraw" then local balance = db.storeQuery("SELECT `auction_balance` FROM `players` WHERE `id` = " .. player:getGuid() .. ";") if balance:getNumber("auction_balance") < 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You don't have money on your auction balance.") balance:free() return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You got " .. balance:getNumber("auction_balance") .. " gps from auction system!") player:addMoney(balance:getNumber("auction_balance")) db.query("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. player:getGuid() .. ";") balance:free() end if t[1] == "list" then local result = db.storeQuery("SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC") if result:getID() == -1 then return true end local msg = "Trade Offline:\n\n!offer buy, ID\n!offer remove, ID\n!offer add, ItemName, ItemPrice, ItemCount\n\n" while true do local id = result:getString("id") local name = getPlayerNameByGUID(result:getString("player")) local item_name = getItemNameById(result:getString("item_id")) local count = result:getString("count") local custo = result:getString("cost")/1000 local custo2 = result:getString("cost") if isPlayer() then msg = ""..msg.."ID : "..id.."\nItem Name : "..item_name.." - Item Count : "..count.." - Item Cust : "..custo.."k("..custo2.."GP) - Dono : "..name.."\n" end if not result:next() then break end end player:popupFYI(msg) end return true end
  13. Porra kk, bastante interessante, vou trabalhar nele também! É bastante parecido com o que o outro cara pediu !
  14. Me explica, como isso funciona? oh man haha, it's going to be a job kk But come on, I will make this system, and return response
  15. FlavioHulk postou uma resposta no tópico em Suporte Tibia OTServer
    Mano, você tem que editar no OTB pra que ele seja reconhecido como teleport....
  16. Estou disponibilizando um pouco do meu conhecimento para ajudar um pouco a comunidade ! Prestem atenção nas seguintes regras: 1 - Um pedido por vez 2 - Cada usuário terá direito à dois pedidos (Porém deve ser feito cada um por vez) 3 - Não tenho disponibilidade em fazer scripts extensos, então, economize meu tempo... 4 - Somente atendo à TFS 1.3 ou OTX 3 5 - Sem spam no post, ou cobrança contínua... Levando a desconsideração do pedido... Serviço Temporário Serviços em andamento: 1 - Dungeon System 2 - Fly System ** O serviço será feito em ordem de pedido...
  17. FlavioHulk postou uma resposta no tópico em Suporte Tibia OTServer
    Qual o ID desse teleport? E qual distro você está utilizando?
  18. Qual sua distro? 0.x ou 1.x ?
  19. local config = { levelRequiredToAdd = 20, maxOffersPerPlayer = 5, SendOffersOnlyInPZ = true, blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if param == '' then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = param:split(",") if t[1] == "add" then if not t[2] or not t[3] or not t[4] then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if not tonumber (t[3]) or not tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.") return true end if string.len(t[3]) > 7 or string.len(t[4]) > 3 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.") return true end local item = getItemIdByName(t[2]) if not item then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end if player:getLevel() < config.levelRequiredToAdd then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.") return true end if table.contains(config.blocked_items, item.itemid) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.") return true end if player:getItemCount(item) < tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).") return true end local check = db.storeQuery("SELECT `id` FROM `auction_system` WHERE `player` = " .. player:getGuid() .. ";") if check:getID() == -1 then elseif check:getRows(true) >= config.maxOffersPerPlayer then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.") return true end end if tonumber(t[4]) < 1 or tonumber(t[3]) < 1 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.") return true end local itemcount, costgp = math.floor(t[4]), math.floor(t[3]) player:removeItem(item, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.") end if t[1] == "buy" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end local buy = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if buy:getID() ~= -1 then if player:getMoney() < buy:getNumber("cost") then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.") buy:free() return true end if player:getName() == getPlayerGUIDByName(buy:getNumber("player")) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.") buy:free() return true end if player:getFreeCapacity() < getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")))then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getString("item_name") .. ". It weight " .. getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.") buy:free() return true end local itemStacks = ItemType(buy:getString("item_id")):isStackable() if itemStacks then player:addItem(buy:getString("item_id"), buy:getNumber("count")) else for i = 1, buy:getNumber("count") do player:addItem(buy:getString("item_id"), 1) end end player:removeMoney(buy:getNumber("cost")) db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "You bought " .. buy:getNumber("count") .. " ".. buy:getString("item_name") .. " for " .. buy:getNumber("cost") .. " gps!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getNumber("cost") .. " WHERE `id` = " .. buy:getNumber("player") .. ";") buy:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "remove" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end local delete = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if delete:getID() ~= -1 then if player:getGuid() == delete:getNumber("player")) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") local itemStack = ItemType(delete:getString("item_id")):isStackable() if itemStack then player:addItem(delete:getString("item_id"), delete:getNumber("count")) else for i = 1, delete:getNumber("count") do player:addItem(delete:getString("item_id"), 1) end end player:sendTextMessage(MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!") end delete:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "withdraw" then local balance = db.storeQuery("SELECT `auction_balance` FROM `players` WHERE `id` = " .. player:getGuid() .. ";") if balance:getNumber("auction_balance") < 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You don't have money on your auction balance.") balance:free() return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You got " .. balance:getNumber("auction_balance") .. " gps from auction system!") player:addMoney(balance:getNumber("auction_balance")) db.query("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. player:getGuid() .. ";") balance:free() end if t[1] == "list" then local result = db.storeQuery("SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC") if result:getID() == -1 then return true end local msg = "Trade Offline:\n\n!offer buy, ID\n!offer remove, ID\n!offer add, ItemName, ItemPrice, ItemCount\n\n" while true do local id = result:getString("id") local name = getPlayerNameByGUID(result:getString("player")) local item_name = getItemNameById(result:getString("item_id")) local count = result:getString("count") local custo = result:getString("cost")/1000 local custo2 = result:getString("cost") if isPlayer() then msg = ""..msg.."ID : "..id.."\nItem Name : "..item_name.." - Item Count : "..count.." - Item Cust : "..custo.."k("..custo2.."GP) - Dono : "..name.."\n" end if not result:next() then break end end player:popupFYI(msg) return true end return true end
  20. local config = { levelRequiredToAdd = 20, maxOffersPerPlayer = 5, SendOffersOnlyInPZ = true, blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(player, words, param) if param == '' then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = param:split(",") if t[1] == "add" then if not t[2] or not t[3] or not t[4] then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if not tonumber (t[3]) or not tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.") return true end if string.len(t[3]) > 7 or string.len(t[4]) > 3 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.") return true end local item = getItemIdByName(t[2]) if not item then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end if player:getLevel() < config.levelRequiredToAdd then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.") return true end if table.contains(config.blocked_items, item) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.") return true end if player:getItemCount(item) < tonumber(t[4]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).") return true end local check = db.storeQuery("SELECT `id` FROM `auction_system` WHERE `player` = " .. player:getGuid() .. ";") if check:getID() == -1 then elseif check:getRows(true) >= config.maxOffersPerPlayer then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.") return true end end if tonumber(t[4]) < 1 or tonumber(t[3]) < 1 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.") return true end local itemcount, costgp = math.floor(t[4]), math.floor(t[3]) player:removeItem(item, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.") end if t[1] == "buy" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end local buy = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if buy:getID() ~= -1 then if player:getMoney() < buy:getNumber("cost") then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.") buy:free() return true end if player:getName() == getPlayerGUIDByName(buy:getNumber("player")) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.") buy:free() return true end if player:getFreeCapacity() < getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")))then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getString("item_name") .. ". It weight " .. getItemWeightById(buy:getNumber("item_id"), buy:getNumber("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.") buy:free() return true end local itemStacks = ItemType(buy:getString("item_id")):isStackable() if itemStacks then player:addItem(buy:getString("item_id"), buy:getNumber("count")) else for i = 1, buy:getNumber("count") do player:addItem(buy:getString("item_id"), 1) end end player:removeMoney(buy:getNumber("cost")) db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "You bought " .. buy:getNumber("count") .. " ".. buy:getString("item_name") .. " for " .. buy:getNumber("cost") .. " gps!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getNumber("cost") .. " WHERE `id` = " .. buy:getNumber("player") .. ";") buy:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "remove" then if not tonumber(t[2]) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end if config.SendOffersOnlyInPZ then if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end local delete = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = " .. tonumber(t[2]) .. ";") if delete:getID() ~= -1 then if player:getGuid() == delete:getNumber("player")) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") local itemStack = ItemType(delete:getString("item_id")):isStackable() if itemStack then player:addItem(delete:getString("item_id"), delete:getNumber("count")) else for i = 1, delete:getNumber("count") do player:addItem(delete:getString("item_id"), 1) end end player:sendTextMessage(MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!") end delete:free() else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if t[1] == "withdraw" then local balance = db.storeQuery("SELECT `auction_balance` FROM `players` WHERE `id` = " .. player:getGuid() .. ";") if balance:getNumber("auction_balance") < 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You don't have money on your auction balance.") balance:free() return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You got " .. balance:getNumber("auction_balance") .. " gps from auction system!") player:addMoney(balance:getNumber("auction_balance")) db.query("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. player:getGuid() .. ";") balance:free() end if t[1] == "list" then local result = db.storeQuery("SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC") if result:getID() == -1 then return true end local msg = "Trade Offline:\n\n!offer buy, ID\n!offer remove, ID\n!offer add, ItemName, ItemPrice, ItemCount\n\n" while true do local id = result:getString("id") local name = getPlayerNameByGUID(result:getString("player")) local item_name = getItemNameById(result:getString("item_id")) local count = result:getString("count") local custo = result:getString("cost")/1000 local custo2 = result:getString("cost") if isPlayer() then msg = ""..msg.."ID : "..id.."\nItem Name : "..item_name.." - Item Count : "..count.." - Item Cust : "..custo.."k("..custo2.."GP) - Dono : "..name.."\n" end if not result:next() then break end end player:popupFYI(msg) return true end return true end
  21. Configure tudo corretamente, e irá funcionar... local vocs = { [1] = { look = xxxx, -- Outfit que será adicionado o addon addon = xxx, -- Addon a ser adicionado storage = xxxx -- Storage dado ao player }, [2] = { look = xxxx, -- Outfit que será adicionado o addon addon = xxx, -- Addon a ser adicionado storage = xxxx -- Storage dado ao player }, [3] = { look = xxxx, -- Outfit que será adicionado o addon addon = xxx, -- Addon a ser adicionado storage = xxxx -- Storage dado ao player }, [4] = { look = xxxx, -- Outfit que será adicionado o addon addon = xxx, -- Addon a ser adicionado storage = xxxx -- Storage dado ao player } } function onAdvance(player, skill, oldLevel, newLevel) local voc = vocs[player:getVocation():getId()] if not voc then return true end if player:getStorageValue(voc.storage) > 0 or player:hasOutfit(voc.look, voc.addon) then return true end player:addOutfitAddon(voc.look, voc.addon) player:setStorage(voc.storage, 1) return true end
  22. npcHandler:say('Splendid! Here take your pickaxe.', cid)
  23. local time = 10 -- Time in seconds function TopEffect(cid) local player = Player(cid) if not player then return true end player:say("[TOP]", TALKTYPE_MONSTER_SAY, false, creature, fromPosition) player:sendMagicEffect(CONST_ME_FIREWORK_RED) addEvent(TopEffect, time * 1000, player.uid) return true end function onLogin(player) query = db.storeQuery("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1") if query:getID() ~= -1 then name = query:getString("name") if player:getName() == name then player:registerEvent("TopEffect") TopEffect(player.uid) end end return true end
  24. A distro dele é o TFS 1.3... function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end local id,amount = 2160, 1 if player:getItemCount(id) < amount then player:teleportTo(fromPosition, true) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only pass if have " .. amount .. " " .. id:getName() .. ".") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) return true end return true end Apenas atualizei o script do @Vabrindox, o crédito é todo ele

Informação Importante

Confirmação de Termo