Histórico de Curtidas
-
jotape1322 recebeu reputação de BrunoWots em (Resolvido)exercise dummy.Qual servidor ou website você utiliza como base?
1.3
Qual o motivo deste tópico?
seguinte, o script ta funcionando lindo e perfeito, exceto quando eu estou treinando e deslogo o char sem parar de treinar, ai quando eu relogo o char ele fala pra mim que eu já estou treinando daí não consigo treinar mais, sei que tem algo a ver com o storage do player que ta setado como treinando preciso que quando ele deslogue ele mude esse storage
Está surgindo algum erro? Se sim coloque-o aqui.
Você tem o código disponível? Se tiver publique-o aqui:
local skills = { [32384] = {id=SKILL_SWORD,voc=4}, -- KNIGHT [32385] = {id=SKILL_AXE,voc=4}, -- KNIGHT [32386] = {id=SKILL_CLUB,voc=4}, -- KNIGHT [32387] = {id=SKILL_DISTANCE,voc=3,range=CONST_ANI_SIMPLEARROW}, -- PALADIN [32388] = {id=SKILL_MAGLEVEL,voc=2,range=CONST_ANI_SMALLICE}, -- DRUID [32389] = {id=SKILL_MAGLEVEL,voc=1,range=CONST_ANI_FIRE}, -- SORCERER [32124] = {id=SKILL_SWORD,voc=4}, -- KNIGHT [32125] = {id=SKILL_AXE,voc=4}, -- KNIGHT [32126] = {id=SKILL_CLUB,voc=4}, -- KNIGHT [32127] = {id=SKILL_DISTANCE,voc=3,range=CONST_ANI_SIMPLEARROW}, -- PALADIN [32128] = {id=SKILL_MAGLEVEL,voc=2,range=CONST_ANI_SMALLICE}, -- DRUID [32129] = {id=SKILL_MAGLEVEL,voc=1,range=CONST_ANI_FIRE} -- SORCERER } local houseDummies = {32143, 32144, 32145, 32146, 32147, 32148} local freeDummies = {32142, 32149} local skillRateDefault = configManager.getNumber(configKeys.RATE_SKILL) local magicRateDefault = configManager.getNumber(configKeys.RATE_MAGIC) local function removeExerciseWeapon(player, exercise) exercise:remove(1) player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training weapon vanished.") stopEvent(training) player:setStorageValue(Storage.isTraining,0) end local function start_train(pid,start_pos,itemid,fpos, bonusDummy, dummyId) local player = Player(pid) if player ~= nil then if Tile(fpos):getItemById(dummyId) then local pos_n = player:getPosition() if start_pos:getDistance(pos_n) == 0 and getTilePzInfo(pos_n) then if player:getItemCount(itemid) >= 1 then local exercise = player:getItemById(itemid,true) if exercise:isItem() then if exercise:hasAttribute(ITEM_ATTRIBUTE_CHARGES) then local charges_n = exercise:getAttribute(ITEM_ATTRIBUTE_CHARGES) if charges_n >= 1 then exercise:setAttribute(ITEM_ATTRIBUTE_CHARGES,(charges_n-1)) local voc = player:getVocation() if skills[itemid].id == SKILL_MAGLEVEL then local magicRate = getRateFromTable(magicLevelStages, player:getMagicLevel(), magicRateDefault) if not bonusDummy then player:addManaSpent(math.ceil(500*magicRate)) else player:addManaSpent(math.ceil(500*magicRate)*1.1) -- 10% end else local skillRate = getRateFromTable(skillsStages, player:getEffectiveSkillLevel(skills[itemid].id), skillRateDefault) if not bonusDummy then player:addSkillTries(skills[itemid].id, 7*skillRate) else player:addSkillTries(skills[itemid].id, (7*skillRate)*1.1) -- 10% end end fpos:sendMagicEffect(CONST_ME_HITAREA) if skills[itemid].range then pos_n:sendDistanceEffect(fpos, skills[itemid].range) end if exercise:getAttribute(ITEM_ATTRIBUTE_CHARGES) == 0 then removeExerciseWeapon(player, exercise) else local training = addEvent(start_train, voc:getAttackSpeed(), pid,start_pos,itemid,fpos,bonusDummy,dummyId) player:setStorageValue(Storage.isTraining,1) end else removeExerciseWeapon(player, exercise) end end end end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training has stopped.") stopEvent(training) player:setStorageValue(Storage.isTraining,0) end else stopEvent(training) player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training has stopped.") player:setStorageValue(Storage.isTraining, 0) end else stopEvent(training) if player then player:sendTextMessage(MESSAGE_INFO_DESCR, "Your training has stopped.") player:setStorageValue(Storage.isTraining,0) end end return true end function onUse(player, item, fromPosition, target, toPosition, isHotkey) local start_pos = player:getPosition() if player:getStorageValue(Storage.isTraining) == 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You are already training.") return false end if target:isItem() then if isInArray(houseDummies,target:getId()) then if not skills[item.itemid].range and (start_pos:getDistance(target:getPosition()) > 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Get closer to the dummy.") stopEvent(training) return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You started training.") start_train(player:getId(),start_pos,item.itemid,target:getPosition(), true, target:getId()) elseif isInArray(freeDummies, target:getId()) then if not skills[item.itemid].range and (start_pos:getDistance(target:getPosition()) > 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Get closer to the dummy.") stopEvent(training) return true end player:sendTextMessage(MESSAGE_INFO_DESCR, "You started training.") start_train(player:getId(),start_pos,item.itemid,target:getPosition(), false, target:getId()) end end return true end
Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
sendo que ele não está treinando
resolvido, em login lua na function onlogin adicionei
player:setStorageValue(Storage.isTraining,0)
e toda vez que ele loga ele seta o storage do trainer pra 0
-
jotape1322 deu reputação a Kralifezik1 em Ajuda com para Liberar Acessos Script Login.lua Helpcarai muito obrigado irmao
-
jotape1322 recebeu reputação de Kralifezik1 em Ajuda com para Liberar Acessos Script Login.lua Helpaqui tem meu login.lua da mesma base que a sua, aqui no meu ta funcionando, não estão todas as quests ai mas da pra vc ter uma noção
function Player.sendTibiaTime(self, hours, minutes) -- TODO: Migrate to protocolgame.cpp local msg = NetworkMessage() msg:addByte(0xEF) msg:addByte(hours) msg:addByte(minutes) msg:sendToPlayer(self) msg:delete() return true end local function onMovementRemoveProtection(cid, oldPos, time) local player = Player(cid) if not player then return true end local playerPos = player:getPosition() if (playerPos.x ~= oldPos.x or playerPos.y ~= oldPos.y or playerPos.z ~= oldPos.z) or player:getTarget() then player:setStorageValue(Storage.combatProtectionStorage, 0) return true end addEvent(onMovementRemoveProtection, 1000, cid, oldPos, time - 1) end local playerLogin = CreatureEvent("PlayerLogin") function playerLogin.onLogin(player) local items = { {2120, 1}, {2148, 3} } if player:getLastLoginSaved() == 0 then local backpack = player:addItem(1988) if backpack then for i = 1, #items do backpack:addItem(items[i][1], items[i][2]) end end player:addItem(2050, 1, true, 1, CONST_SLOT_AMMO) else player:sendTextMessage(MESSAGE_STATUS_DEFAULT, string.format("Your last visit in ".. SERVER_NAME ..": %s.", os.date("%d. %b %Y %X", player:getLastLoginSaved()))) --In Service of Yalahar player:setStorageValue(Storage.InServiceofYalahar.Questline, 5) player:setStorageValue(Storage.InServiceofYalahar.Mission01, 6) player:setStorageValue(Storage.InServiceofYalahar.Mission02, 8) player:setStorageValue(Storage.InServiceofYalahar.Mission03, 6) player:setStorageValue(Storage.InServiceofYalahar.Mission04, 6) player:setStorageValue(Storage.InServiceofYalahar.Mission05, 8) player:setStorageValue(Storage.InServiceofYalahar.Mission06, 5) player:setStorageValue(Storage.InServiceofYalahar.Mission07, 5) player:setStorageValue(Storage.InServiceofYalahar.Mission08, 4) player:setStorageValue(Storage.InServiceofYalahar.Mission09, 2) player:setStorageValue(Storage.InServiceofYalahar.Mission10, 1) --ape player:setStorageValue(Storage.TheApeCity,1) --zao player:setStorageValue(Storage.TheNewFrontier.Questline, 1) player:setStorageValue(Storage.TheNewFrontier.Mission01, 3) player:setStorageValue(Storage.TheNewFrontier.Mission02, 6) player:setStorageValue(Storage.TheNewFrontier.Mission03, 3) player:setStorageValue(Storage.TheNewFrontier.Mission04, 2) player:setStorageValue(Storage.TheNewFrontier.Mission05, 7) player:setStorageValue(Storage.TheNewFrontier.Mission06, 3) player:setStorageValue(Storage.TheNewFrontier.Mission07, 3) player:setStorageValue(Storage.TheNewFrontier.Mission08, 2) player:setStorageValue(Storage.TheNewFrontier.Mission09, 3) player:setStorageValue(Storage.TheNewFrontier.Mission10, 1) player:setStorageValue(Storage.TheNewFrontier.TomeofKnowledge, 12) --Feryst player:setStorageValue(Storage.ThreatenedDreams.Start, 1) player:setStorageValue(Storage.ThreatenedDreams.TroubledMission01, 17) player:setStorageValue(Storage.ThreatenedDreams.TroubledMission02, 1) --Rashid player:setStorageValue(Storage.TravellingTrader.Mission01, 1) player:setStorageValue(Storage.TravellingTrader.Mission01, 2) player:setStorageValue(Storage.TravellingTrader.Mission02, 5) player:setStorageValue(Storage.TravellingTrader.Mission03, 3) player:setStorageValue(Storage.TravellingTrader.Mission04, 3) player:setStorageValue(Storage.TravellingTrader.Mission05, 3) player:setStorageValue(Storage.TravellingTrader.Mission06, 2) player:setStorageValue(Storage.TravellingTrader.Mission07, 1) --Iquin player:setStorageValue(Storage.TheInquisition.Questline, 2) player:setStorageValue(Storage.TheInquisition.Mission01, 7) player:setStorageValue(Storage.TheInquisition.Mission02, 3) player:setStorageValue(Storage.TheInquisition.Mission03, 6) player:setStorageValue(Storage.TheInquisition.Mission04, 3) player:setStorageValue(Storage.TheInquisition.Mission05, 3) player:setStorageValue(Storage.TheInquisition.Mission06, 3) player:setStorageValue(Storage.TheInquisition.Mission07, 1) --WOTE player:setStorageValue(Storage.WrathoftheEmperor.Questline, 1) player:setStorageValue(Storage.WrathoftheEmperor.Mission01, 3) player:setStorageValue(Storage.WrathoftheEmperor.Mission02, 3) player:setStorageValue(Storage.WrathoftheEmperor.Mission03, 3) player:setStorageValue(Storage.WrathoftheEmperor.Mission04, 3) player:setStorageValue(Storage.WrathoftheEmperor.Mission05, 3) player:setStorageValue(Storage.WrathoftheEmperor.Mission06, 4) player:setStorageValue(Storage.WrathoftheEmperor.Mission07, 6) player:setStorageValue(Storage.WrathoftheEmperor.Mission08, 2) player:setStorageValue(Storage.WrathoftheEmperor.Mission09, 2) player:setStorageValue(Storage.WrathoftheEmperor.Mission10, 6) --Imbuiment player:setStorageValue(Storage.ForgottenKnowledge.Tomes, 1) player:setStorageValue(Storage.ForgottenKnowledge.LastLoreKilled, 1) player:setStorageValue(Storage.ForgottenKnowledge.TimeGuardianKilled, 1) player:setStorageValue(Storage.ForgottenKnowledge.HorrorKilled, 1) player:setStorageValue(Storage.ForgottenKnowledge.DragonkingKilled, 1) player:setStorageValue(Storage.ForgottenKnowledge.ThornKnightKilled, 1) player:setStorageValue(Storage.ForgottenKnowledge.LloydKilled, 1) player:setStorageValue(Storage.ForgottenKnowledge.LadyTenebrisKilled, 1) player:setStorageValue(Storage.ForgottenKnowledge.AccessMachine, 1) --SearoutsYalahar player:setStorageValue(Storage.SearoutesAroundYalahar.Darashia, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.AbDendriel, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.Venore, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.Ankrahmun, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.PortHope, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.Thais, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.LibertyBay, 1) player:setStorageValue(Storage.SearoutesAroundYalahar.Carlin, 1) end local playerId = player:getId() DailyReward.init(playerId) player:loadSpecialStorage() if player:getGroup():getId() >= 4 then player:setGhostMode(true) end -- Boosted creature player:sendTextMessage(MESSAGE_LOOT, "Today's boosted creature: " .. BoostedCreature.name .. " \ Boosted creatures yield more experience points, carry more loot than usual and respawn at a faster rate.") -- Bestiary tracker player:refreshBestiaryTracker() -- Stamina nextUseStaminaTime[playerId] = 1 -- EXP Stamina nextUseXpStamina[playerId] = 1 -- Prey Small Window for slot = CONST_PREY_SLOT_FIRST, CONST_PREY_SLOT_THIRD do player:sendPreyData(slot) end -- New prey nextPreyTime[playerId] = { [CONST_PREY_SLOT_FIRST] = 1, [CONST_PREY_SLOT_SECOND] = 1, [CONST_PREY_SLOT_THIRD] = 1 } if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then local msg = [[:: Tutor Rules 1 *> 3 Warnings you lose the job. 2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it. 3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible. 4 *> Always be on time, if you do not have a justification you will be removed from the staff. 5 *> Help is only allowed to ask questions related to tibia. 6 *> It is not allowed to divulge time up or to help in quest. 7 *> You are not allowed to sell items in the Help. 8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail. 9 *> Always keep the Tutors Chat open. (required). 10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can. 11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual. 12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. " - Commands - Mute Player: /mute nick, 90 (90 seconds) Unmute Player: /unmute nick. - Commands -]] player:popupFYI(msg) end -- Open channels if table.contains({TOWNS_LIST.DAWNPORT, TOWNS_LIST.DAWNPORT_TUTORIAL}, player:getTown():getId())then player:openChannel(3) -- World chat else player:openChannel(3) -- World chat player:openChannel(5) -- Advertsing main end -- Rewards local rewards = #player:getRewardList() if(rewards > 0) then player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward")) end -- Update player id local stats = player:inBossFight() if stats then stats.playerId = player:getId() end if player:getStorageValue(Storage.combatProtectionStorage) < 1 then player:setStorageValue(Storage.combatProtectionStorage, 1) onMovementRemoveProtection(playerId, player:getPosition(), 10) end -- Set Client XP Gain Rate local baseExp = 100 if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then baseExp = getRateFromTable(experienceStages, player:getLevel(), configManager.getNumber(configKeys.RATE_EXP)) end local staminaMinutes = player:getStamina() local doubleExp = false --Can change to true if you have double exp on the server local staminaBonus = (staminaMinutes > 2400) and 150 or ((staminaMinutes < 840) and 50 or 100) if doubleExp then baseExp = baseExp * 2 end player:setStaminaXpBoost(staminaBonus) player:setBaseXpGain(baseExp) local worldTime = getWorldTime() local hours = math.floor(worldTime / 60) local minutes = worldTime % 60 player:sendTibiaTime(hours, minutes) if player:getStorageValue(Storage.isTraining) == 1 then --Reset exercise weapon storage player:setStorageValue(Storage.isTraining,0) end return true end playerLogin:register()
-
jotape1322 recebeu reputação de Vodkart em (Resolvido)Erro script trade OFF16:45 Você somente pode sacar o total de 74.
16:45 Você tem que digitar um valor maior que 0.
Muito agradecido, agora funcionou perfeito!
-
jotape1322 deu reputação a Vodkart em (Resolvido)Erro script trade OFFué, testa assim
local config = { level_add = 20, max_ofertas = 5, ofertas_pz = true, itens_bloqueados = {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 == 'saldo') then local consulta = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local saldo = result.getNumber(consulta, "auction_balance") player:sendTextMessage(MESSAGE_INFO_DESCR, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Seu saldo é de " .. saldo .. " gps de suas vendas no mercado!") return true end if(param == '') or (param == 'info') then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Comandos para utilizar este sistema:\n!oferta saldo\nUse este comando para verificar o saldo de suas vendas.\n!oferta add, nomedoitem, preço, qtd\nexemplo: !oferta add,plate armor,500,1\n\n\n!oferta comprar,id_da_compra\nexemplo: !oferta comprar,1943\n\n\n!oferta remover,id_da_compra\nexemplo: !oferta remover,1943\n\n\n!oferta sacar, qtd\nexemplo: !oferta sacar, 1000.\n") return true end local split = param:split(",") if split[2] == nil then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parâmetros necessários. Use !oferta info para mais informações!") return false end split[2] = split[2]:gsub("^%s*(.-)$", "%1") _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `player` = " .. player:getGuid()) if(split[1] == "add") then if(not tonumber(split[3]) or (not tonumber(split[4]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use somente números.") return true end if(string.len(split[3]) > 7 or (string.len(split[4]) > 3)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Este preço ou a quantidade itens é muito alta.") return true end local itemType, item_s = ItemType(split[2]), ItemType(split[2]):getId() if(not item_s) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O item "..itemType.." não existe!") return true end if(player:getLevel() < config.level_add) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas vcê precisa de level igual ou superior a (" .. config.level_add .. ") para continuar.") return true end if(isInArray(config.itens_bloqueados, item_s)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar este item.") return true end if(player:getItemCount(item_s) < tonumber(split[4])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não tem este item.") return true end local amount, tmp_BUSCA_DB = 0, _BUSCA_DB while tmp_BUSCA_DB ~= false do tmp_BUSCA_DB = result.next(_BUSCA_DB) amount = amount + 1 end if _BUSCA_DB ~= false then local limit = amount >= config.max_ofertas if limit then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você atingiu o limite máximo(" .. config.max_ofertas .. ") de publicações de venda de itens.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você só pode usar este comando estando em protection zone.") return true end end end if(tonumber(split[4]) < 1 or (tonumber(split[3]) < 1)) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você precisa informar um número maior que 0.") return true end local itemcount, costgp = math.floor(split[4]), math.floor(split[3]) player:removeItem(item_s, itemcount) db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. player:getGuid() .. ", \"" .. split[2] .. "\", " .. item_s .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você adicionou para à venda " .. itemcount .." " .. split[2] .." por " .. costgp .. " gps!") end if(split[1] == "comprar") then _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if(not tonumber(split[2])) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(_BUSCA_DB ~= false) then local total_custo = costs - player:getMoney() if(player:getMoney() < costs) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não possuí a quantia necessária para comprar. São necessários: "..costs.."gps para comprar o item: "..item_names..". Você tem: " .. player:getMoney() .. "gps. Você precisa de: "..total_custo.." gps.") return true end if(player_id == player_vendas) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você não pode comprar seu próprio item.") return true end if player:removeMoney(costs) then if(isItemStackable((item_ids))) then player:addItem(item_ids, counts) else for i = 1, counts do player:addItem(item_ids, 1) end end db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você comprou " .. counts .. " ".. item_names .. " por " .. costs .. " gps com sucesso!") db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. costs .. " WHERE `id` = " .. player_vendas .. ";") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas o ID "..split[2].." não existe!.") end end if(split[1] == "remover") then local _BUSCA_DB = db.storeQuery("SELECT * FROM `auction_system` WHERE `id` = ".. tonumber(split[2])) local player_id, player_vendas, item_ids, costs, item_names, counts = player:getGuid(), result.getNumber(_BUSCA_DB, "player"), result.getNumber(_BUSCA_DB, "item_id"), result.getNumber(_BUSCA_DB, "cost"), result.getString(_BUSCA_DB, "item_name"), result.getNumber(_BUSCA_DB, "count") if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(player:getPosition())) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end if(_BUSCA_DB ~= false) then if(player_id == player_vendas) then db.query("DELETE FROM `auction_system` WHERE `id` = " .. split[2] .. ";") if(isItemStackable(item_ids)) then player:addItem(item_ids, counts) else for i = 1, counts do player:addItem(item_ids, 1) end end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns! A oferta "..split[2].." foi removida com sucesso do mercado.\nVocê recebeu: "..counts.." "..item_names..".") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas essa oferta não é sua.") end result.free(resultado) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas este ID não existe.") end end if(split[1] == "sacar") then if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end local balance = db.storeQuery("SELECT * FROM `players` WHERE `id` = " .. player:getGuid() .. ";") local auction_balance = result.getNumber(balance, "auction_balance") <= 0 and 0 or result.getNumber(balance, "auction_balance") if(auction_balance < 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Você não possuí saldo suficiente para sacar.") result.free(balance) return true elseif tonumber(split[2]) <= 0 or tonumber(split[2]) > auction_balance then player:sendTextMessage(MESSAGE_INFO_DESCR,tonumber(split[2]) <= 0 and "Você tem que digitar um valor maior que 0." or "Você somente pode sacar o total de "..auction_balance..".") result.free(balance) return true end local tz = auction_balance - tonumber(split[2]) player:sendTextMessage(MESSAGE_INFO_DESCR, "Você sacou " .. split[2] .. " gps de suas vendas no mercado! Seu saldo é de: "..tz.."gps.") player:addMoney(tz) db.query("UPDATE `players` SET `auction_balance` = ".. tz .." WHERE `id` = " .. player:getGuid() .. ";") result.free(balance) end return true end
-
jotape1322 deu reputação a Vodkart em (Resolvido)Erro script trade OFFnessa linha:
for i = 1, count do
o certo seria
for i = 1, counts do
-
jotape1322 recebeu reputação de Vodkart em (Resolvido)Erro script trade OFFProblema resolvido, muita gratidão!
estou com outro problema, quando o player vai sacar o valor das vendas se ele saca o valor certo nao acontece nada, mas se ele bota um valor maior do que tem disponivel o cliente da debug e não consigo mais logar no char, preciso reiniciar o server para conseguir logar novamente