
Tudo que Celulose postou
-
Cast Channel
em luascript.h Procure por static int32_t luaL_errors(lua_State* L); abaixo adiciona static int32_t luaOpenPrivateChannel(lua_State* L); agora em luascript.cpp procure por lua_register(m_luaState, "doPlayerSendCancel", LuaInterface::luaDoPlayerSendCancel); coloque acima //OpenPrivateChannel(cid) lua_register(m_luaState, "openPrivateChannel", LuaInterface::luaOpenPrivateChannel); ainda em luascript.cpp procure por int32_t LuaInterface::luaGetTileInfo(lua_State* L) int32_t LuaInterface::luaOpenPrivateChannel(lua_State* L) { ScriptEnviroment* env = getEnv(); uint32_t cid = popNumber(L); Player* player = env->getPlayerByUID(cid); if (!player || player->isRemoved() || !player->isPremium()) return false; ChatChannel* channel = g_chat.createChannel(player, 0xFFFF); if (!channel || !channel->addUser(player)) return false; player->sendCreatePrivateChannel(channel->getId(), channel->getName()); return true; } credito joadson
-
Cast Channel
você deve adicionar na source a função , ja que a otx não tem.
-
(Resolvido)Primeiro login
function onLogin(cid) local pos = {x = 70, y = 190, z = 13} if getPlayerStorageValue(cid, 60633) == -1 then doTeleportThing(cid, pos) setPlayerStorageValue(cid, 60633, 1) end return true end <event type="login" name="Teleport" event="script" value="teleport.lua"/>
-
[Super Recomendo] Empresa VPS Qualidade!
Tive problema com 3 host esse ano , falei com pedro ele me ajudo muito descobrir oque ocorria e de que forma poderia arrumar . 4youstart é a melhor !
-
Erro No Autoloot Perfect
@Emanueldk ele não está encontrando o item qual distro você usa ? versão dela
-
Remover Battle ao entrar em PZ
Sei que existe vários tópico no fórum em creaturescripts , porém em distro 0.4 ocorre alguns erros se você entrar rapidamente em área pz e deslogar aparece erros na distro... esse é feito em globalevents ele remove condition ao entrar em pz , alem de fazer a checagem no tile assim não ocorre erro .. crie um arquivo em globalevents com nome removerbatle.lua local function removeBattle(cid) doRemoveCondition(cid, CONDITION_INFIGHT) return false end function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do local pos, tile = getThingPos(cid), getTileThingByPos(getThingPos(cid)) if getTilePzInfo(pos) == true then removeBattle(cid) end end return true end tag xml 1000 é equivalente a 1 segundo em servidores milesegundos , caso contrário você deverá usar "1" <globalevent name="removerbatle" interval="1000" event="script" value="removerbatle.lua"/> Créditos : BDG eu por ter corrigido o final da função adicionando return true end.
-
Erro data/lib
jin_bijuus = { ["shukaku"] = {sto = 1, spells = {}, bijuu_outfit = 273, skill_p = 10, time_buff = 30, effBuff = 3}, ["nibi"] = {sto = 2, spells = {}, bijuu_outfit = 161, skill_p = 10, time_buff = 30, effBuff = 3}, ["sanbi"] = {sto = 3, spells = {}, bijuu_outfit = 303, skill_p = 10, time_buff = 30, effBuff = 3}, ["yonbi"] = {sto = 4, spells = {}, bijuu_outfit = 269, skill_p = 10, time_buff = 30, effBuff = 3}, ["gobi"] = {sto = 5, spells = {}, bijuu_outfit = 399, skill_p = 10, time_buff = 30, effBuff = 3}, ["rokubi"] = {sto = 6, spells = {}, bijuu_outfit = 301, skill_p = 10, time_buff = 30, effBuff = 3}, ["shichibi"] = {sto = 7, spells = {}, bijuu_outfit = 302, skill_p = 10, time_buff = 30, effBuff = 3}, ["hachibi"] = {sto = 8, spells = {}, bijuu_outfit = 318, skill_p = 10, time_buff = 30, effBuff = 3}, ["kyuubi"] = {sto = 9, spells = {}, bijuu_outfit = 557, skill_p = 10, time_buff = 30, effBuff = 3} } id_name = { -- id da storage refrente ao monstro na primeira tabela, lembrando que se for adicionar mais, a variável sto tem que dar um valor de storage referente ao novo monstro adicionado [1] = "Shukaku", [2] = "Nibi", [3] = "Sanbi", [4] = "Yonbi", [5] = "Gobi", [6] = "Rokubi", [7] = "Shichibi", [8] = "Hachibi", [9] = "Kyuubi" } jin_Storage = 1234255 -- Storage que armazena o Jinchuuriki jin_StorageTime = 1234256 -- Storage de quanto tempo o player tem de Jinchuuriki jin_TimeDay = 2 -- Tempo em dias que o player ficará com a Bijuu selada nele jin_percentHp = 20 -- Porcentagem que precisa para selar o Bijuu jin_cond_id = 23 -- Sub-Id da condição do buff, assim não da conflito com outros buffs. jin_cond_id = 24 -- Sub-Id da condição do outfit, assim não da conflito com outros buffs. jin = { -- jin.getPlayerBijuu(uid) getPlayerBijuu = function(uid) -- retorna o nome da biju do player em string. if getPlayerStorageValue(uid, jin_Storage) == -1 then return 0 end return id_name[getPlayerStorageValue(uid, jin_Storage)] end, -- jin.setPlayerBijuu(uid, BijuuId) setPlayerBijuu = function(uid, BijuuId) -- Set no player a Bijuu tornando-o um Jinchuuriki. return doCreatureSetStorage(uid, jin_Storage, BijuuId) end, -- jin.setBijuuTime(uid, days) setBijuuTime = function(uid, days) -- Seta a quantidade de dias que o player ficará com a bijuu. return doCreatureSetStorage(uid, jin_StorageTime, os.time()+days*24*60*60) end, -- jin.getPlayerBijuuTime(uid) getPlayerBijuuTime = function(uid) -- Retorna tempo e hora que falta pra acabar o Jinchuuriki do Player. if getPlayerStorageValue(uid, jin_StorageTime)-os.time() <= 0 then return "Tempo restante é de 0 dias, 0 horas e 0 segundos." end local tempo = getPlayerStorageValue(uid, jin_StorageTime)-os.time() local segundos = tempo % 60 local minutos = math.floor(tempo%3600/60) local horas = math.floor(tempo%86400/3600) local dias = math.floor(tempo%604800/86400) return "Tempo restante é de "..dias.." dia"..(dias > 1 and "s" or "")..", "..horas.." hora"..(horas > 1 and "s" or "")..", "..minutos.." minuto"..(minutos > 1 and "s"or "").." e "..segundos.." segundo"..(segundos > 1 and "s" or "").."" end, -- jin.doPlayerSetSpells(uid, spells) doPlayerSetSpells = function(uid, spells) -- Faz o player aprender mais de 1 spells. if type(spells) == "table" then for i = 1, #spells do doPlayerLearnInstantSpell(uid, spells) end else doPlayerLearnInstantSpell(uid, spells) end end, -- jin.doPlayerRemoveSpells(uid, spells) doPlayerRemoveSpells = function(uid, spells) -- Remove todas as spells aprendidas do player. if type(spells) == "table" then for i = 1, #spells do doPlayerUnlearnInstantSpell(uid, spells) end else doPlayerUnlearnInstantSpell(uid, spells) end end, -- jin.doPlayerRemoveJinchuuriki(uid) doPlayerRemoveJinchuuriki = function(uid) -- Remove o Jinchuuriki do player. if jin.getPlayerBijuu(uid) ~= 0 then jin.doPlayerRemoveSpells(uid, jin_bijuus[jin.getPlayerBijuu(uid):lower()].spells) doCreatureSetStorage(uid, jin_StorageTime, -1) doCreatureSetStorage(uid, jin_Storage, -1) end end }
-
(Resolvido)Anti-clone
otx já tem ant clone bem funcional , tfs é bem complicado você pode usa sistema pra auxiliar ele funciona é bem simples porem creio que é o máximo que você vai conseguir.
-
(Resolvido)Piso com groupid
function onStepIn(cid, item, pos, frompos) if getPlayerGroupId(cid) < 6 then doTeleportThing(cid, frompos) doPlayerSendCancel(cid, 'Somente Staff Tem Acesso') doSendMagicEffect(frompos, CONST_ME_POFF) end return true end <movevent event="StepIn" actionid="60210" script="staffacess.lua"/>
-
Bug OTX 3.x MB, ELFBOT
@Kamiz você não pode colocar mais que 400 de packetsPerSecond Aconselho usar 200 inicial se ainda travar usa 300 até 400 . quanto maior o envio de pacote , a distro vai usar mais CPU e assim vai utilizar o máximo e quando chegar uma quantidade de pessoas vai ter problemas com lag. isso aconteceu comigo muito tempo e fui pesquisar . eu usava 600 e quando voltei pra 200 meu cpu diminuiu 40%
-
(Resolvido)Anti-clone
qual distro você usa ?
-
(Resolvido)Creature not found Magia
@Wakon obrigado era isso
-
Erro no OT
@timaoga posta o arquivo ..
-
(Resolvido)Creature not found Magia
Estou reformulando todas magia do meu game e consegui quase toda , porem estou com problema nessa magia de área . Nome do erro adicionei a função if not isPlayer(parameters.cid) then return true end pra ver se era o erro porem não tive sucesso.
-
Urgente Help
@Ricardo Tibia @Ricardo Tibia estranho apenas mudei a função dates. antes aparecia ? altera pra essa --[[ Capture The Flag System Author: Maxwell Denisson(MaXwEllDeN) Version: 2.0 Contact: [email protected] ]] local CTF = CTF_LIB local function sendEffect() if (getGlobalStorageValue(16505) > 0) then doSendAnimatedText(CTF.tppos, "CTF ON", math.random(180)) addEvent(sendEffect, 750) end end function onThink(interval, lastExecution) local ct = CTF_LIB.days[os.date("%A")] if ct and isInArray(ct, os.date("%X"):sub(1,5)) then doBroadcastMessage("[CTF] Está aberto em Sapeko para novos participantes, em ".. CTF.timeclose .." minuto(s) não será mais possível entrar!") setGlobalStorageValue(16705, 1) addEvent(CTF.start, CTF.timeclose * 60 * 1000) local teelz = doCreateItem(1387, 1, CTF.tppos) doItemSetAttribute(teelz, "aid", 47521) sendEffect() end return true end
-
Urgente Help
@Ricardo Tibia veja o erro na distro e tira print pra saber
-
Urgente Help
@Ricardo Tibia --[[ Capture The Flag System Author: Maxwell Denisson(MaXwEllDeN) Version: 2.0 Contact: [email protected] ]] local CTF = CTF_LIB local function sendEffect() if (getGlobalStorageValue(16505) > 0) then doSendAnimatedText(CTF.tppos, "CTF ON", math.random(180)) addEvent(sendEffect, 750) end end function onThink(interval, lastExecution) local time = CTF.days[os.date("%A")] if time and isInArray(time, os.date("%X"):sub(1,5)) then doBroadcastMessage("[CTF] Está aberto em Sapeko para novos participantes, em ".. CTF.timeclose .." minuto(s) não será mais possível entrar!") setGlobalStorageValue(16705, 1) addEvent(CTF.start, CTF.timeclose * 60 * 1000) local teelz = doCreateItem(1387, 1, CTF.tppos) doItemSetAttribute(teelz, "aid", 47521) sendEffect() end return true end
-
Urgente Help
@Ricardo Tibia posta o CTFMax e leia oque expliquei
-
Urgente Help
@Ricardo Tibia troca por essa <globalevent name="CTFCheck" interval="60000" event="script" value="CTFMax.lua"/> você altera os horario e data aqui ["Monday"] = {"14:47", "18:47"}, no caso Monday = segunda feira vai começa o evento 14:47 e depois 18:47 se der algum erro posta o CTFMax.lua não sei como que está
-
Urgente Help
posta o globalevents a tag para mim ver --[[ Capture The Flag System Author: Maxwell Denisson(MaXwEllDeN) Version: 2.0 Contact: [email protected] ]] CTF_LIB = { waitpos = {x = 94, y = 730, z =7}, -- Posição da sala de espera tppos = {x = 156, y = 44, z =7}, -- Onde o TP vai aparecer days = { ["Monday"] = {"14:47", "18:47"}, ["Tuesday"] = {"14:47", "18:47"}, ["Wednesday"] = {"14:47", "18:47"}, ["Thursday"] = {"14:47", "18:47"}, ["Friday"] = {"14:47", "18:47"}, ["Saturday"] = {"14:47", "18:47"}, ["Sunday"] = {"14:47", "18:47"} }, xp_percent = 0.5, -- Porcentagem de exp que o player vai ganhar timeclose = 3, -- Tempo, em minutos, para iniciar o CTF winp = 15, -- Quantos pontos uma equipe precisa marcar para vencer teams = { ["Vermelho"] = { temple = 1, -- TownID da equipe vermelha outfit = {lookHead = 0, lookBody = 132, lookLegs = 113, lookFeet = 94}, flag = { id = 1435, flag_pos = {x = 71, y = 665, z =6}, -- Posição onde a bandeira vermelha vai ser criada gnd_pos = {x = 67, y = 665, z =6}, -- Onde os players da equipe vermelha entregarão a bandeira. }, }, ["Verde"] = { temple = 1, -- TownID da equipe verde outfit = {lookHead = 0, lookBody = 121, lookLegs = 101, lookFeet = 101}, flag = { id = 1437, flag_pos = {x = 17, y = 665, z =6}, -- Posição onde a bandeira verde vai ser criada gnd_pos = {x = 21, y = 665, z =6}, -- Onde os players da equipe verde entregarão a bandeira. }, }, }, } local CTF = CTF_LIB function CTF.getMembers() local members = {} for _, cid in pairs(getPlayersOnline()) do if getPlayerStorageValue(cid, 16700) ~= -1 then table.insert(members, cid) end end return members end function CTF.getTeamMembers(team) local members = {} for _, cid in pairs(CTF.getMembers()) do if getPlayerStorageValue(cid, 16700) == team then table.insert(members, cid) end end return members end function CTF.removePlayer(uid) setPlayerStorageValue(uid, 16700, -1) doPlayerSetTown(uid, getPlayerStorageValue(uid, 16701)) doTeleportThing(uid, getTownTemplePosition(getPlayerStorageValue(uid, 16701))) setPlayerStorageValue(uid, 16701, -1) doRemoveCondition(uid, CONDITION_OUTFIT) doCreatureAddHealth(uid, getCreatureMaxHealth(uid)) doCreatureAddMana(uid, getCreatureMaxMana(uid)) return true end function CTF.addPlayer(uid) local team = CTF.getTeamLivre() local n_team = CTF.teams[team] setPlayerStorageValue(uid, 16700, team) setPlayerStorageValue(uid, 16701, getPlayerTown(uid)) doPlayerSetTown(uid, n_team.temple) doTeleportThing(uid, CTF.waitpos) doPlayerSendTextMessage(uid, 22, "Você agora faz parte do time ".. team .. ".") local outfit = getCreatureOutfit(uid) for i, v in pairs(n_team.outfit) do outfit = v end registerCreatureEvent(uid, "CTFLogout") registerCreatureEvent(uid, "CTFAttack") registerCreatureEvent(uid, "CTFCombat") registerCreatureEvent(uid, "CTFDeath") doSetCreatureOutfit(uid, outfit, -1) return true end function CTF.getTeamLivre() local teams = {} for i, _ in pairs(CTF.teams) do table.insert(teams, {i, #CTF.getTeamMembers(i)}) end if (teams[1][2] < teams[2][2]) then return teams[1][1] elseif (teams[1][2] > teams[2][2]) then return teams[2][1] end return teams[math.random(2)][1] end function CTF.broadCast(msg, class) for _, uid in pairs(CTF.getMembers()) do doPlayerSendTextMessage(uid, class or 20, msg) end return true end function CTF.getFlagTeam(flag) for i, v in pairs(CTF.teams) do if v.flag.id == flag then return i end end return "" end local score_sto = {} local a = 0 for i, _ in pairs(CTF.teams) do score_sto = 42314 + a a = a + 1 end function CTF.createFlags() for i, v in pairs(CTF.teams) do local flag = doCreateItem(v.flag.id, 1, v.flag.flag_pos) doItemSetAttribute(flag, "aid", 63218) v.flag.gnd_pos.stackpos = 0 local gnd = getThingFromPos(v.flag.gnd_pos).uid doItemSetAttribute(gnd, "aid", 63200) doItemSetAttribute(gnd, "team", i) setGlobalStorageValue(score_sto, 0) end return true end function CTF.removeFlags() for i, v in pairs(CTF.teams) do local flag = doFindItemInPos({v.flag.id}, v.flag.flag_pos)[1] if flag then doRemoveItem(flag.uid, 1) end v.flag.gnd_pos.stackpos = 0 local gnd = getThingFromPos(v.flag.gnd_pos).uid doItemSetAttribute(gnd, "aid", 0) end return true end function CTF.start() doRemoveItem(doFindItemInPos({1387}, CTF.tppos)[1].uid, 1) setGlobalStorageValue(16705, -1) if #CTF.getMembers() < 2 then doBroadcastMessage("O CTF não pôde ser iniciado por falta de players.") for _, cid in pairs(CTF.getMembers()) do CTF.removePlayer(cid) end return false end CTF.broadCast("O CTF foi iniciado. Bom jogo!") for _, uid in pairs(CTF.getMembers()) do doTeleportThing(uid, getTownTemplePosition(getPlayerTown(uid))) end CTF.createFlags() return true end function CTF.returnFlag(uid, status) local team = getPlayerStorageValue(uid, 16702) if status then local msg = "O player ".. getCreatureName(uid) .. ", estava com a bandeira do time ".. team .. " " if status == 1 then msg = msg .. "e foi eliminado. " elseif status == 2 then msg = "e foi removido do evento. " end msg = msg .. "Portanto a bandeira do time ".. team .. " foi devolvida." CTF.broadCast(msg) end if CTF.teams[team] then local flag = doCreateItem(CTF.teams[team].flag.id, 1, CTF.teams[team].flag.flag_pos) doItemSetAttribute(flag, "aid", 63218) setPlayerStorageValue(uid, 16702, -1) end return true end function CTF.addPoint(uid) local finish local msg = "Capture The Flag:" setGlobalStorageValue(score_sto[getPlayerStorageValue(uid, 16700)], getGlobalStorageValue(score_sto[getPlayerStorageValue(uid, 16700)]) + 1) for i, _ in pairs(CTF.teams) do msg = msg .. "\nTime ".. i .. ": ".. getGlobalStorageValue(score_sto) if getGlobalStorageValue(score_sto) >= CTF.winp then finish = i end end CTF.broadCast(getCreatureName(uid) .. " marcou um ponto para o time ".. getPlayerStorageValue(uid, 16700) .. ".", 22) CTF.broadCast(msg) if finish then CTF.close(finish) end return true end function CTF.close(win) for i, _ in pairs(CTF.teams) do setGlobalStorageValue(score_sto, 0) end if not win then doBroadcastMessage("O CTF acabou sem vencedores.") else CTF.broadCast("O time ".. win .. " marcou ".. CTF.winp .. " ponto(s) e venceu o evento.") end for _, cid in pairs(CTF.getMembers()) do if getPlayerStorageValue(cid, 16700) == win then local xp = math.ceil(getPlayerExperience(cid) * (CTF.xp_percent / 100), 215) doPlayerSendTextMessage(cid, 22, "Parabéns! Você ganhou o evento e obteve ".. CTF.xp_percent .."% de sua experiência total(".. xp ..").") doSendAnimatedText(getThingPos(cid), xp, 215) doPlayerAddExperience(cid, xp) end if getPlayerStorageValue(cid, 16702) ~= -1 then CTF.returnFlag(cid) end CTF.removePlayer(cid) end CTF.removeFlags() return true end local function Alert(uid) if (isCreature(uid)) then if getPlayerStorageValue(uid, 16702) == -1 or getPlayerStorageValue(uid, 16700) == -1 then return false end doSendAnimatedText(getThingPos(uid), "Flag!", math.random(50, 200)) local bla = {18, 19, 21, 22, 23, 24} doSendMagicEffect(getThingPos(uid), bla[math.random(#bla)]) if (os.time() - getPlayerStorageValue(uid, 16703) >= 60) then CTF.returnFlag(uid) return setPlayerStorageValue(uid, 16703, -1) end addEvent(Alert, 500, uid) return true end return false end function CTF.stealFlag(uid, team) setPlayerStorageValue(uid, 16702, team) setPlayerStorageValue(uid, 16703, os.time()) CTF.broadCast(getCreatureName(uid) .. " roubou a bandeira do time ".. team .. "!") Alert(uid) return true end function doFindItemInPos(ids, pos) -- By Undead Slayer local results = {} for _ = 0, 255 do local findPos = {x = pos.x, y = pos.y, z = pos.z, stackpos = _} if isInArray(ids, getThingFromPos(findPos).itemid) then table.insert(results, getThingFromPos(findPos)) end end return results end
-
Erro CreatureScript
você tem a função doCreatureSetNick na source? geralmente esse erro acontece na distro 0.3.6 por não ter a função na distro você deve adicionar a função na source
-
(Resolvido)power limiter
olá. você pode deixando os skills e os demais em "stages" onde você pode controla o tanto de rates e limitando o valor máximo , level também você pode fazer isso
-
(Resolvido)!online NÃO MOSTRAR OS PLAYERS ONLINE
@baiakuda function onSay(cid, words, param, channel) local tmp = getWorldUpTime() local hours = math.ceil(tmp / 3600) - 1 local minutes = math.ceil((tmp - (3600 * hours)) / 60) if(minutes == 60) then minutes = 0 hours = hours + 1 end local showGamemasters,on,count = false,getPlayersOnline(),0 for _, cid in pairs(on) do if getPlayerAccess(cid) < 4 then count = count + 1 end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Modo: PVP] - [UpTime: " .. hours .. " hours and " .. minutes .. " minutes.] - [Players Online: " .. (showGamemasters == true and #on or count) .. "]") return TRUE end
-
(Resolvido)!online NÃO MOSTRAR OS PLAYERS ONLINE
@baiakuda function onSay(cid, words, param, channel) local tmp = getWorldUpTime() local hours = math.ceil(tmp / 3600) - 1 local minutes = math.ceil((tmp - (3600 * hours)) / 60) if(minutes == 60) then minutes = 0 hours = hours + 1 end local showGamemasters,on,count = false,getPlayersOnline(),0 for _, cid in pairs(on) do if getPlayerAccess(cid) < 4 then count = count + 1 end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Modo: PVP] - [UpTime: " .. hours .. " hours and " .. minutes .. " minutes.] - [Players Online: " .. (showGamemasters == true and #on or count) .. "]) return TRUE end
-
(Resolvido)[Correção De Script] Matar monstros e spawnar boss
@Brunds entendi no caso creio que teria que ser por storage setando e quando tivesse os 4 nascia o boss . pensei que era pra matar uns dos 4 monstro e nascer o boss ainda to aprendendo as função eles pode te ajuda @Vodkart @Dwarfer