Tudo que Storm postou
-
Bug saveplayer
@Magalhaes92 local configs = { players_db = {}, save_delay = 5, -- Segundos } function savePlayer() if #configs.players_db > 0 then doPlayerSave(configs.players_db[1]) table.remove(configs.players_db, 1) addEvent(function() if isCreature(configs.players_db[1]) then savePlayer() end end, configs.save_delay * 1000) end return true end function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do table.insert(configs.players_db, cid) end savePlayer() return true end
-
[Dúvida] Transformar tfs 0.3.6 em 0.4 [8.54]
@Absolute Luffy Sim, algumas funções são exclusivas do 0.4. Sobre os erros de compilação é provável que você esteja fazendo algo de errado. Qual distro 0.4 você está tentando compilar?
-
(Resolvido)[PEDIDO] Ganhar recompensa ao matar jogador
@OinomedRellik Testa aí, eu tinha esquecido de nomear as variáveis corretamente (muito tempo sem programar da nisso) local config = { storageX = 1001, itemX = 5943, countX = 1, StorageY = 1002, itemY = 5808, countY = 1, item0 = 5805, count0 = 1 } function onKill(cid, target, lastHit) if isPlayer(target) then if getPlayerStorageValue(target, config.storageX) == 1 then doPlayerAddItem(cid, config.itemX, config.countX) elseif getPlayerStorageValue(target, config.storageY) == 1 then doPlayerAddItem(cid, config.itemY, config.countY) else doPlayerAddItem(cid, config.item0, config.count0) end end return true end
-
(Resolvido)[PEDIDO] Ganhar recompensa ao matar jogador
@OinomedRellik Script: local config = { storageX = 1001, itemX = 5943, countX = 1, StorageY = 1002, itemY = 5808, countY = 1, item0 = 5805, count0 = 1 } function onKill(cid, target, lastHit) if isPlayer(target) then if getPlayerStorageValue(target, storageX) == 1 then doPlayerAddItem(cid, itemX, countX) elseif getPlayerStorageValue(target, storageY) == 1 then doPlayerAddItem(cid, itemY, countY) else doPlayerAddItem(cid, item0, count0) end end return true end XML: <event type="kill" name="Recompensa" event="script" value="recompensa.lua"/> Não se esqueça de registrar o comando abaixo no login.lua: registerCreatureEvent(cid, "Recompensa")
-
Bug saveplayer
@Magalhaes92 local configs = { players_db = {}, save_delay = 5, -- Segundos } local function savePlayer() if #configs.players_db > 0 then doPlayerSave(configs.players_db[1]) table.remove(configs.players_db, 1) return addEvent(saveP, configs.save_delay * 1000) end return true end local function saveP() if isCreature(configs.players_db[1]) then savePlayer() end return true end function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do table.insert(configs.players_db, cid) end savePlayer() return true end
-
[Dúvida] Transformar tfs 0.3.6 em 0.4 [8.54]
@wesquel Cara, sobre as funções creio que irão funcionar normalmente, já que a TFS 0.4 é um upgrade da 0.3.6. Irá ter alguns erros na distro sim, mas é coisa que se conserta rapidamente, basta pedir ajuda no fórum. Não entendi o que você quis dizer com as variáveis, mas se você tiver se referindo as variáveis de C++ e de Lua não terá problema algum. Se tiver algum problema, não será nada que demore pra resolver. Um provável problema com variáveis que teria seria nas LIB's, mas como eu disse, é só pegar também a de algum 8.6 ou procurar ajuda aqui no fórum. Alias @Absolute Luffy, recomendo você pegar uma database 8.6 nova também, já tive problemas ao trocar de distro com a database, por isso é bom pegar uma zerada.
-
[Dúvida] Transformar tfs 0.3.6 em 0.4 [8.54]
@Absolute Luffy Basta pegar uma distro 0.4 e 8.60 e colocar a datapack e a pasta mods do seu servidor lá. Irão aparecer alguns erros ao ligar a distro, mas nada que não dê para resolver. Acredito eu que alterar pela source será mais complicado.
-
Server Caindo c/ [Warning - Protocol::RSA_decrypt] Not valid packet size
@leozincorsair Esse erro ocorre provavelmente quando o jogador, através de bot's enviam packets de dados que o servidor não reconhece ou então usam clients modificados. Existem algumas soluções e nem todas funcionam, testa solução por solução e veja se alguma irá resolver o problema. config.lua -- Isso fará com que todo jogador que tentar enviar packets não reconhecidos, seja automaticamente banido. autoBanishUnknownBytes = true config.lua allowedMaxSizePackets = 20 Se estiver 20, tente ir aumentando e veja se esse erro continuará a ocorrer. Por ultimo, executar esse comando no mySql CREATE TABLE `z_ots_comunication` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `action` varchar(255) NOT NULL, `param1` varchar(255) NOT NULL, `param2` varchar(255) NOT NULL, `param3` varchar(255) NOT NULL, `param4` varchar(255) NOT NULL, `param5` varchar(255) NOT NULL, `param6` varchar(255) NOT NULL, `param7` varchar(255) NOT NULL, `delete_it` int(2) NOT NULL default '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
QUEST QUE DE ITEM ALEATÓRIOS( configuráveis)
@louco3626 Troca if var[1] <= math.random(1, 100) then Para: if math.random(1, 100) <= var[1] then
-
Spell Mod God
@Phineasz
-
Spell Mod God
@Phineasz
-
QUEST QUE DE ITEM ALEATÓRIOS( configuráveis)
@louco3626 local config = { time = 20, -- HORAS de exaust storage = 25455, -- Storage do exaust position = {x = 100, y = 250, z = 7} -- Position que será teleportado. } local items = { [1] = {100, 10, 2160}, -- {CHANCE de 1 a 100, quantidade que ganhará, itemID) [2] = {50, 1, 2155}, [3] = {25, 1, 2154}, [4] = {10, 1, 2156}, [5] = {5, 1, 2170} } function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if exhaustion.check(cid, config.storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Aguarde ".. math.floor(exhaustion.get(cid, config.storage) / 60 * 60) .." Horas para usar esse bau novamente!") doSendMagicEffect(pos, CONST_ME_POFF) return false end exhaustion.set(cid, config.storage, config.time*60*60) doTeleportThing(cid, config.position) for _, var in pairs(items) do if var[1] <= math.random(1, 100) then doPlayerAddItem(cid, var[3], var[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce recebeu ".. var[2] .." ".. getItemNameById(var[3]) ..".") end end return true end
-
(Resolvido)!akatsuki
@REI DAVID local storage = 43455 local t = { [1] = {lookType = 203}, -- [vocation ID] = {lookType = outfit id} [2] = {lookType = 204}, } function onSay(cid, words, param, channel) local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, storage) == 1 then local outfit = t[getPlayerVocation(cid)] if outfit then if outfit ~= getCreatureOutfit(cid).lookType then doChangeCreatureOutfit(cid, outfit) db.executeQuery("UPDATE `players` SET `looktype`=".. outfit .." WHERE `players`.`id`= ".. getPlayerGUID(cid) .."") doSendMagicEffect(pos, 10) doCreatureSay(cid, "AKATSUKI!!", TALKTYPE_MONSTER) return true else doPlayerSendTextMessage(cid, 27, "Voce ja esta transformado!") doSendMagicEffect(pos, 4) return true end else doPlayerSendTextMessage(cid, 27, "Sua vocacao nao se transformar em akatsuki") doSendMagicEffect(pos, 4) return true end else doPlayerSendTextMessage(cid, 27, "Voce nao tem a storage") doSendMagicEffect(pos, 4) return true end return true end
-
(Resolvido)!akatsuki
@REI DAVID Muda setPlayerStorageValue(cid,8974555,6) Para: setPlayerStorageValue(cid, 8974555, 1) E na talkaction você coloca essa storage a cima.
-
(Resolvido)!akatsuki
@REI DAVID Verifique se a storage é setada como 1
-
QUEST QUE DE ITEM ALEATÓRIOS( configuráveis)
@Vim Rusha Tenta trocar o action ID e o diretório da script value="warzone I.lua" para outro nome e teste.
-
AJUDA COM SCRIPT PARA MAGIA
Optimizando a script; local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 10) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497) local arr = { {1, 1, 1, 1, 1, 1.}, {1, 0, 0, 0, 0, 1.}, {1, 0, 0, 0, 0, 1,}, {1, 0, 0, 2, 0, 1,}, {1, 0, 0, 0, 0, 1,}, {1, 0, 0, 0, 0, 1,}, {1, 1, 1, 1, 1, 1,}, } local area = createCombatArea(arr) setCombatArea(combat, area) local storage = 50054 -- nao mexer caso nao saiba do que se trata local waittime = 30 -- tempo em segundos ate poder usar de novo function onCastSpell(cid, var) if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Espere "..exhaustion.get(cid, storage).." para usar essa magia novamente.") return false end exhaustion.set(cid, storage, waittime) return doCombat(cid, combat, var) end
-
(Resolvido)!akatsuki
@REI DAVID local storage = 43455 local t = { [1] = {lookType = 203}, -- [vocation ID] = {lookType = outfit id} [2] = {lookType = 204}, } function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, storage) == 1 then local outfit = t[getPlayerVocation(cid)] if outfit then if outfit ~= getCreatureOutfit(cid).lookType then doChangeCreatureOutfit(cid, outfit) db.executeQuery("UPDATE `players` SET `looktype`=".. outfit .." WHERE `players`.`id`= ".. getPlayerGUID(cid) .."") doSendMagicEffect(pos, 10) doCreatureSay(cid, "AKATSUKI!!", TALKTYPE_MONSTER) return true else doPlayerSendTextMessage(cid, 27, "Voce ja esta transformado!") doSendMagicEffect(pos, 4) return true end else doPlayerSendTextMessage(cid, 27, "Sua vocacao nao se transformar em akatsuki") doSendMagicEffect(pos, 4) return true end else doPlayerSendTextMessage(cid, 27, "Voce nao tem a storage") doSendMagicEffect(pos, 4) return true end return true end
-
QUEST QUE DE ITEM ALEATÓRIOS( configuráveis)
@Vim Rusha Não aparece nenhum erro na distro? Se não, verifique se você colocou o actionID pelo RME.
-
Item BUG SLOT [AJUDA]
@KR3 <movevent type="Equip" itemid="7880" slot="shield" level="1" event="function" value="onEquipItem"> <movevent type="DeEquip" itemid="7880" slot="shield" level="1" event="function" value="onDeEquipItem">
-
piso que avisa que estão invadindo o castel 24hrs
@Emooooo Manda a script do que avisa apenas uma vez.
-
BUG DURING ARENA [?]
@KR3 Você tem que pesquisar no seu servidor, provavelmente é alguma creaturescript.
-
QUEST QUE DE ITEM ALEATÓRIOS( configuráveis)
@Vim Rusha Na pasta actions, é igual a quest de um bau normal.
-
(PEDIDO) Um item que ao ser usado invoca um monstro que ajuda o invocador.
@louco3626 Troca if table.maxn(getCreatureSummons(cid)) <= config.max then Para if table.maxn(getCreatureSummons(cid)) < config.max then
-
war system erro
@Emooooo Muda if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then Para if not guild then