Ir para conteúdo

MaXwEllDeN

Héroi
  • Registro em

  • Última visita

Tudo que MaXwEllDeN postou

  1. É porque, hoje em dia está muito difícil de se encontrar pessoas que fazem os códigos simples, limpos e bem claros sabe, a maioria faz grandes gambiarras para pouca coisa .-.
  2. Parabéns cara, gostei muito da sua organização e uso das funcionalidades que lua te dispõe, gostei do código, muito bem feito, REP +
  3. MaXwEllDeN postou uma resposta no tópico em Suporte Tibia OTServer
    Mano, "KIT", Keep It Simple, não tinha pra que usar esse loop ai véi u.U Ow Gambiarra hein.... local array = { [1] = 2160, [2] = 2160, [3] = 2160, [4] = 2160 } function onDeath(cid, corpse) doTransformItem(corpse.uid, array[getPlayerVocation(cid)], 1) doDecayItem(corpse.uid) return true end
  4. Bem legal esse tutorial, aprendí a lógica da programação com Ele, grande Skyen...
  5. Não que eu saiba...
  6. Essa versão é tensa, nem pasta lib tem, foi derivada de uma versão antiga, creio eu, então não tem o creaturescript statschange, não pode usar nesse serv...
  7. Qual a versão do seu servidor?
  8. Usa esse exemplo: <event type="statschange" name="ArenaPVP" event="script" value="PVPArena.lua"/> registerCreatureEvent(cid, "PVPArena")
  9. tipo, o if, só executa o escopo se a condição for verdadeira, então não precisa por se a função for true. testa ai: function onStatsChange(cid, attacker, type, combat, value) if (type == STATSCHANGE_HEALTHGAIN) then return true end if (getCreatureHealth(cid)-value <= 0) then doCreatureAddHealth(cid, lifeToFull) doTeleportThing(cid,{ x=113, y=138, z=7 }) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.") doPlayerAddMana(cid, manaToFull) return false end return true end não esquece de por o registerCreatureEvent, se ajudei REP+
  10. <?xml version="1.0" encoding="UTF-8"?> <npc name="Bobby" script="VocationAddon.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="131" head="79" body="76" legs="49" feet="94" addons="1"/> <parameters> <parameter key="message_greet" value="Olá, você tem os items necessários para adquirir a vocation?."/> </parameters> </npc> VocationAddon.lua local ConfiG = { item = { {2160, 100}, -- Itemid, count {2110, 30}, -- Itemid, count }, outfit = 173, -- Outfit LookType addons = 3, -- 3 = FUll, 2 = Somente a segunda Addon, 1 = Primeira Addon, 0 = Sem Addons vocation = 5, } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, typea, msg) if(not npcHandler:isFocused(cid)) then return false end local msg = msg:lower() local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'vocation') and (getPlayerStorageValue(cid, 72371) < 1) then for _, v in pairs(ConfiG.item) do if (getPlayerItemCount(cid, v[1]) < v[2]) then local msg = "" for _, v in pairs(ConfiG.item) do msg = msg .. ", " .. v[2] .. " ".. getItemNameById(v[1]) .. (v[2] > 1 and "s" or "") end return selfSay("Você não tem ".. msg:sub(3, #msg) .. ".", cid) end end selfSay("Aí está!", cid) setPlayerStorageValue(cid, 72371, 1) doPlayerAddOutfit(cid, ConfiG.outfit, ConfiG.addons) doPlayerSetVocation(cid, ConfiG.vocation) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  11. Storages são gravadas no banco de dados, a única vantagem que eu penso sobre isso, é que poderia ser feito outro sistema para integrar com o site..
  12. Legal fazer assim: local msg = "Bem-Vindo \play\\ acesse www.tibiaking.com e cadastre-se" local msg, _ = msg:gsub("\play\\", getCreatureName(cid)) doPlayerSendTextMessage(cid, 22, msg) em todos lugar que o cara digitasse \play\\ seria substituido pelo nome do player .-.
  13. MaXwEllDeN postou uma resposta no tópico em Suporte & Pedidos
    Ai o sistema do Thriller:
  14. #Introdução Bem, este é um sistema no qual você pode protejer o seu locker(depot) com senha, assim evitando hackers http://forums.otserv.com.br/images/smilies/biggrin.gif. #Instalação http://1.imgland.net/3CaRNl.png Primeiro faça o download do sistema e cole na sua pasta data. Após ter instalado os arquivos nas suas respectivas pastas adicione as tags: @Actions <action itemid="2589; 2590; 2591; 2592" event="script" value="DPPass.lua"/> <!-- DP Pass --> @Creaturescripts <event type="login" name="LockerPass" event="script" value="DPPass.lua"/> <!-- DPPass --> @Movements <movevent type="StepOut" actionid="96475" event="script" value="DPPass.lua"/> <!-- DPPass --> @Talkactions <talkaction words="!locker" script="DPPass.lua"/> <!-- DP Pass --> Talvez eu poste uma V. 2, podendo recuperar a senha via Recovery Key! Abraço.
  15. Author: Maxwell Denisson (MaXwEllDeN) Testado em: TFS 0.3.6 <?xml version="1.0" encoding="UTF-8"?> <mod name="Max - Halloween Thriller" version="1.0" author="MaXwEllDeN" contact="[email protected]" enabled="yes"> <config name="MaXLIB"><![CDATA[ ]]></config> <globalevent name="Thriller Dance" type="start" event="script"><![CDATA[ --[[ Thriller Dance Author: Maxwell Denisson(MaXwEllDeN) Version: 1.0 ]] local coreo = {0, 0, 2, 2, "'Cause this is thriller, thriller night", {0, 2, 3, 1}, "And no one's gonna save you from the beast about to strike", 1, 1, 2, 0, 3, 3, {0, 2, 3, 1, 2, 0, 1, 2, 3, 0, 1, 2}} local figurino = {65, 68, 18, 311, 33} function getUidsInArea(ext1, ext2) -- By MaXwEllDeN local UiDes = {} for xiz = 0, ext2.x-ext1.x do for yiz = 0, ext2.y-ext1.y do local creature = getThingFromPos({x = ext1.x+xiz, y = ext1.y+yiz, z = ext1.z, stackpos = 255}).uid if (isCreature(creature)) then table.insert(UiDes, creature) end end end return UiDes end function printTableSX(aff) -- BETA ~ By MaXwEllDeN local s = "{" for a, b in pairs(aff) do if (type(b) == "table") then value = printTableSX(b) elseif (type(b) == "string") then value = '"'.. b .. '"' else value = b end s = s .. value .. ", " end s = "{" .. s:sub(2, #s) return (#s < 3) and "{}" or (s:sub(1, #s-2) .. "}") end local config = { interval = {say = 750, walk = 500, turn = 350} } function TeamWalk(cid, direction) if isCreature(cid) then local cp = getThingPos(cid) local ext1 = {x = cp.x-1, y = cp.y-1, z = cp.z} local ext2 = {x = cp.x+1, y = cp.y+1, z = cp.z} local creatures = getUidsInArea(ext1, ext2) for _, uid in pairs(creatures) do if not(isInArray(figurino, getCreatureOutfit(uid).lookType)) and (getCreatureOutfit(uid).lookType ~= 308) then doSetCreatureOutfit(uid, {lookType = figurino[math.random(#figurino)]}, 60*60*1000) end doMoveCreature(uid, direction) end addEvent(doCoreo, 150, cid) end end function TeamTurn(cid, turns) if (isCreature(cid)) then local function Turn(direction, n) if (n == #turns) then addEvent(doCoreo, 150, cid) end local cp = getThingPos(cid) local ext1 = {x = cp.x-1, y = cp.y-1, z = cp.z} local ext2 = {x = cp.x+1, y = cp.y+1, z = cp.z} local creatures = getUidsInArea(ext1, ext2) for _, uid in pairs(creatures) do if not(isInArray(figurino, getCreatureOutfit(uid).lookType)) and (getCreatureOutfit(uid).lookType ~= 308) then doSetCreatureOutfit(uid, {lookType = figurino[math.random(#figurino)]}, 60*60*1000) end doCreatureSetLookDir(uid, direction) end end for int, dir in pairs(turns) do addEvent(Turn, int*config.interval.turn, dir, int) end end end function Saysz(cid, val) doCreatureSay(cid, val, 19) addEvent(doCoreo, 150, cid) end local function StAR() local coreo_LZ = loadstring("return ".. printTableSX(coreo))() print("OKAY") local k = "Dancer" local w = "Michael Jackson" local area = {{k, k, k}, {k, w, k}, {k, k, k} } local ip = {x = 926, y = 1012, z = 7} for x = 1, #area do for y = 1, #area[x] do local pos = {x = ip.x+x-1, y = ip.y+y-1, z = ip.z, stackpos = 253} doSummonCreature(area[x][y], pos) end end local strZN = "" function doCoreo(uid) if not(isCreature(uid)) then return false end for in1, val in pairs(coreo_LZ) do if (type(val) == "number") then addEvent(TeamWalk, config.interval.walk, uid, val) elseif (type(val) == "table") then addEvent(TeamTurn, config.interval.turn, uid, val) elseif (type(val) == "string") then Saysz(uid, val) end table.remove(coreo_LZ, in1) break end strZN = strZN .. "1" if (#strZN > #coreo) then strZN = "" coreo_LZ = loadstring("return ".. printTableSX(coreo))() doCoreo(uid) end end local ip2 = {x = ip.x+2, y = ip.y+2, z = ip.z} local mons = getUidsInArea(ip, ip2) or {} for _, v in pairs(mons) do if (getCreatureName(v) == "Michael Jackson") then doCoreo(v) break end end return true end function onStartup() addEvent(StAR, 1500) return true end ]]></globalevent> <monster name="Dancer" file="Thriller/Dancer.xml"/> <monster name="Michael Jackson" file="Thriller/Michael Jackson.xml"/> </mod> Coreográfia totalmente editável: local coreo = {0, 0, 2, 2, "'Cause this is thriller, thriller night", {0, 2, 3, 1}, "And no one's gonna save you from the beast about to strike", 1, 1, 2, 0, 3, 3, {0, 2, 3, 1, 2, 0, 1, 2, 3, 0, 1, 2}} Tabelas contém as direções que ele vira /\, >, \/, strings são as palavras que ele o Michael Jackson dirá. configuração dos intervalos em milisegundos, 1000 = 1 segundo. local config = { interval = {say = 750, walk = 500, turn = 350} }
  16. post_pattern = { author = "Maxwell Denisson(MaXwEllDeN)", developed_in = "The Forgotten Server 0.3.6", code_version = 1.0 } Introdução Com esse sistema, você pode criar enquetes no seu servidor, para saber a opniao de seus players. Instalação Abra a pasta creatureevents, dentro da pasta scripts copie qualquer arquivo com extenção .lua, renomeie para PollMaX, abra com algum editor de texto, apague tudo que tiver dentro e cole o seguinte conteúdo: --[[ Poll System Author: Maxwell Denisson(MaXwEllDeN) Version: 1.0 ]] local POLL = _POLL_SYS function onLogin(cid) if (POLL.on) then local PVotes = string.explode(POLL.func.playerGetVotes (cid), ", ") for _, a in pairs(PVotes) do if not (POLL.func.hasPoll(a)) then POLL.func.removePlayerVote(cid, a) end end local kyz = 0 local polls = {} local msgeX = "MaX Poll System:\nParticipe de nossa(s) enquete(s) -> " for _, a in pairs(POLL.func.getPolls()) do kyz = 1 table.insert(polls, a[1]) msgeX = msgeX .. a[1] .. ", " end if (kyz ~= 0) then doPlayerSendTextMessage(cid, 27, msgeX:sub(1, #msgeX-2)) end end return true end Abra a pasta lib na sua pasta data, copie qualquer arquivo com extenção .lua, renomeie para PollMaX, abra com algum editor de texto, apague tudo que tiver dentro e cole o seguinte conteúdo: --[[ Poll System Author: Maxwell Denisson(MaXwEllDeN) Version: 1.0 ]] _POLL_SYS = { func = {}, VotdSto = 42873, on = true } local InStalled = false function printTableSI(aff) -- BETA ~ By MaXwEllDeN local s = "{" for a, b in pairs(aff) do local index = "[".. a .. "]" if (type(a) == "string") then index = '["'.. a ..'"]' end if (type(b) == "table") then value = printTableSI(b) elseif (type(b) == "string") then value = '"'.. b .. '"' else value = b end s = s .. index .. " = " .. value .. ", " end s = "{" .. s:sub(2, #s) return (#s < 3) and "{}" or (s:sub(1, #s-2) .. "}") end _POLL_SYS.func.install = function () return (db.getResult("ALTER TABLE `server_config` ADD COLUMN `polls` VARCHAR( 255 ) NOT NULL DEFAULT ('{}');")) and true or false end _POLL_SYS.func.getPolls = function () local get = db.getResult("SELECT `polls` FROM `server_config` WHERE `config` = 'db_version';") local resultado = get:getDataString('polls') return (resultado) and loadstring("return " .. resultado)() or nil end _POLL_SYS.func.setPolls = function (newpoll) return (db.getResult("UPDATE `server_config` SET `polls` = '".. newpoll .."' WHERE `config` = `db_version`;")) and true or false end _POLL_SYS.func.addPoll = function (poll, options) local Apoll = _POLL_SYS.func.getPolls() table.insert(Apoll, {poll, options}) return _POLL_SYS.func.setPolls(printTableSI(Apoll)) end _POLL_SYS.func.removePoll = function (poll) local Apoll = _POLL_SYS.func.getPolls() local Npoll = {} for _, b in pairs(Apoll) do if (b[1]:lower() ~= poll:lower()) then table.insert(Npoll, b) end end local Npoll = printTableSI(Npoll) return _POLL_SYS.func.setPolls(Npoll) end _POLL_SYS.func.hasPoll = function (poll) local polls = _POLL_SYS.func.getPolls() for _, b in pairs(polls) do if (b[1]:lower() == poll:lower()) then return true end end return false end _POLL_SYS.func.hasPollOption = function (poll, option) local polls = _POLL_SYS.func.getPolls() for _, b in pairs(polls) do if (b[1]:lower() == poll:lower()) then if (b[2][option:lower()]) then return true end end end return false end _POLL_SYS.func.playerSetVotes = function (player, votes) return setPlayerStorageValue(player, 77734, votes) end _POLL_SYS.func.playerGetVotes = function (player) if (getPlayerStorageValue(player, 77734) == -1) then setPlayerStorageValue(player, 77734, "") end return getPlayerStorageValue(player, 77734) end _POLL_SYS.func.playerAddVote = function (player, poll) return setPlayerStorageValue(player, 77734, getPlayerStorageValue(player, 77734) .. ", ".. poll .. "") end _POLL_SYS.func.hasPlayerVote = function (player, poll) local _, votes = _POLL_SYS.func.playerGetVotes(player):gsub(poll:lower(), "fuu") return (votes > 0) and true or false end _POLL_SYS.func.removePlayerVote = function (player, poll) local _, votes = _POLL_SYS.func.playerGetVotes(player):gsub(poll:lower(), " ") return (votes > 0) and _POLL_SYS.func.playerSetVotes(player, _) or false end _POLL_SYS.func.removeAllPlayersVote = function (poll) for _, cid in pairs(getOnlinePlayers()) do local cid = getPlayerByNameWildcard(cid) _POLL_SYS.func.removePlayerVote(cid, poll) end end _POLL_SYS.func.addVote = function (poll, option, player) local polls = _POLL_SYS.func.getPolls () for _, b in pairs(polls) do if (b[1]:lower() == poll:lower()) then print(UHU) for a, _ in pairs(b[2]) do if (a:lower() == option:lower()) then b[2][a] = _ + 1 _POLL_SYS.func.playerAddVote (player, poll) _POLL_SYS.func.setPolls (printTableSI(polls)) return true end end end end return false end _POLL_SYS.func.getPollHighestValue = function (poll) local value = "" local polls = _POLL_SYS.func.getPolls() for _, a in pairs(polls) do if (a[1]:lower() == poll:lower()) then for b, c in pairs(a[2]) do for _, d in pairs(a[2]) do if (_ ~= b) then if (c > d) then value = b end end end end end end return value end if not(InStalled) then local file = io.open("data/lib/PollSystem.lua", "r") local content = file:read("*all") local content, _ = content:gsub("In".. string.upper("s") .."talled = false", "InStalled = true") file:close() local file = io.open("data/lib/PollSystem.lua", "w+") file:write(content) file:close() return _POLL_SYS.func.install() end Abra a pasta talkactions, dentro da pasta scripts copie qualquer arquivo com extenção .lua, renomeie para PollMaX, abra com algum editor de texto, apague tudo que tiver dentro e cole o seguinte conteúdo: --[[ Poll System Author: Maxwell Denisson(MaXwEllDeN) Version: 1.0 ]] function onSay(cid, words, param) local funcs = {"add", "result", "finalize", "list", "vote"} local POLL = _POLL_SYS if not(POLL.on) then return false end local paramCHECK = param:lower() local param = param:lower() local params = string.explode(param, ";") local param = params[1] local helpE = "Max Poll System Help: \n \n * vote - serve para votar em uma enquete. \n" local helpE = helpE .." Exemplo de uso: " .. words .. " vote; enquete; opção " .. words .. " vote; Quem é o mais gato?; Maxwell\n" local helpE = helpE .."\n * list - lista as enquetes existentes. \n" local helpE = helpE .." Exemplo de uso: " .. words .. " list" if (getPlayerAccess(cid) >= 4) then helpE = helpE .. "\n\n * add - serve para adicionar uma enquete. \n Exemplo de uso: " .. words .. " add; Você votaria no sim?; {'Não', 'Sim'}\n" helpE = helpE .. "\nVocê votaria no sim? é a enquete, o que estiver dentro de {} são as opções, ATENÇÃO: TODAS OPÇÕES DEVEM SER FEITAS DENTRO DE \'\', E SEPARADAS POR VIRGULA!" helpE = helpE .. "\n\n * finalize - serve para finalizar uma enquete. \n Exemplo de uso: ".. words .. " finalize; Você votaria no sim?\n\nVocê votaria no sim é a enquete que você deseja finalizar." end if not(isInArray(funcs, param)) then return doShowTextDialog(cid, 1953, helpE) end if (param == "add") and (getPlayerAccess(cid) >= 4) then if not(params[3]) then return doShowTextDialog(cid, 1953, helpE) end local optionS = loadstring("return " .. params[3]:lower())() if (type(optionS) ~= "table") then return doShowTextDialog(cid, 1953, helpE) end local _, paramCHECK = paramCHECK:gsub(";", "a") if (paramCHECK > 2) then return doPlayerSendTextMessage(cid, 27, "Você não pode usar \";\" nas opções") end if not (optionS[2]) then return doPlayerSendTextMessage(cid, 27, "Sua enquete deve ter no mínimo 2 opções") end local Opt = {} for _, b in pairs(optionS) do Opt[b] = 0 end if (POLL.func.hasPoll(params[2])) then return doPlayerSendTextMessage(cid, 27, "Já existe uma enquete nomeada ".. params[2]) end POLL.func.addPoll(''..params[2]..'', Opt) doPlayerSendTextMessage(cid, 27, "A enquete ".. params[2] .." foi adicionada com as opções: ".. params[3]:lower() ..".") elseif (param == "finalize") and (getPlayerAccess(cid) >= 4) then if not (params[2]) then return doShowTextDialog(cid, 1953, helpE) end if not (POLL.func.hasPoll(params[2])) then return doPlayerSendTextMessage(cid, 27, "Não existe nenhum enquete no banco de dados nomeada ".. params[2] .. "!") end local HValue = POLL.func.getPollHighestValue(params[2]) if (HValue == "") then doBroadcastMessage("A enquete " .. params[2] .. " foi finalizada, sem opções vencedoras!") else doBroadcastMessage("A enquete " .. params[2] .. " foi finalizada, e a opção que recebeu mais votos foi: ".. HValue ..".") end doPlayerSendTextMessage(cid, 27, "A enquete ".. params[2] .." foi finalizada.") POLL.func.removePoll (params[2]) POLL.func.removeAllPlayersVote (params[2]) elseif (param == "list") then local polls = POLL.func.getPolls() local kizizim = 0 mszi = "MaX Poll System:\n\nEnquetes Ativas:\n" local function getPollsOptions(poll) local fukZz = "" for _, b in pairs(polls) do if (b[1] == poll:lower()) then for c, _ in pairs(b[2]) do fukZz = fukZz .. "\n " .. c end return fukZz end end end for a, b in pairs(polls) do kizizim = 1 mszi = mszi .. "\n * ".. b[1] .. getPollsOptions(b[1]) end mszi = mszi .. "\n~-~-~-~-~-~-~-~-~-~-~-~-~-" if (kizizim == 0) then return doPlayerSendTextMessage(cid, 27, "Não existe nenhuma enquete no momento!") end doShowTextDialog(cid, 1953, mszi) elseif (param == "vote") then if not (params[3]) then return doShowTextDialog(cid, 1953, helpE) end if not (POLL.func.hasPoll(params[2])) then return doPlayerSendTextMessage(cid, 27, "Não existe nenhum enquete nomeada \"".. params[2] .. "\"! Para ver a lista das enquetes disponíveis digite: ".. words .. " list") end if (POLL.func.hasPlayerVote(cid, params[2])) then return doPlayerSendTextMessage(cid, 27, "Você já votou nesta enquete.") end if not(POLL.func.hasPollOption(params[2], params[3])) then return doPlayerSendTextMessage(cid, 27, "A enquete ".. params[2] .. " não tem nenhuma opção nomeada ".. params[3] .. "! Para ver a lista das enquetes e suas opções disponíveis digite: ".. words .. " list") end POLL.func.addVote(params[2], params[3], cid) doPlayerSendTextMessage(cid, 27, "Obrigado por participar da enqute ".. params[2] .. ".") elseif (param == "result") then local polls = POLL.func.getPolls() local kizizim = 0 mszi = "MaX Poll System:\n\nResultado das enquetes:\n" local function getPollsOptions(poll) local fukZz = "" for _, b in pairs(polls) do if (b[1] == poll:lower()) then for c, d in pairs(b[2]) do fukZz = fukZz .. "\n " .. c .. " - ".. d .. " voto(s)." end return fukZz end end end for a, b in pairs(polls) do kizizim = 1 mszi = mszi .. "\n * ".. b[1] .. getPollsOptions(b[1]) end mszi = mszi .. "\n~-~-~-~-~-~-~-~-~-~-~-~-~" if (kizizim == 0) then return doPlayerSendTextMessage(cid, 27, "Não existe nenhuma enquete no momento!") end doShowTextDialog(cid, 1953, mszi) end return true end Depois instale as seguintes Tags: #Creatureevents.xml <event type="login" name="PollLogin" event="script" value="PollMax.lua"/> <!-- Poll System By MaXwEllDeN --> #Talkactions.xml <talkaction words="!polls" event="script" value="PollMax.lua"/> <!-- Poll System By MaXwEllDeN --> Condiderações Finais Faz tempo que eu fiz esse sistema, por isso pode conter vários bugs, quem encontrar faça o favor de reportar!
  17. #Introdução Este é um sistema de rouba bandeira, no qual tem dois times, que se enfrentam e tentam se infiltrar na fortaleza do inimigo, roubar a bandeira dele e retornar para sua base com ela. #Instalação Faça o download do sistema e cole na pasta do seu servidor. Após ter instalado os arquivos nas suas respectivas pastas abra a pasta do seu servidor, e em seguida abra a pasta spells/scripts/support, e abra o arquivo invisible.lua com algum editor de texto, depois de function onCastSpell(cid, var) cole isso: if (getPlayerStorageValue(cid, _CTF_LIB.teamssto) > 0) then return doPlayerSendCancel(cid, "Você não pode usar invisible durante o CTF!") and doSendMagicEffect(getThingPos(cid), 2) end ficando assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) setCombatCondition(combat, condition) function onCastSpell(cid, var) if (getPlayerStorageValue(cid, _CTF_LIB.teamssto) > 0) then return doPlayerSendCancel(cid, "Você não pode usar invisible durante o CTF!") and doSendMagicEffect(getThingPos(cid), 2) end return doCombat(cid, combat, var) end #Configuração Como na maioria dos meus códigos: as configurações ficam na lib, então: _CTF_LIB.flags = { [_CTF_LIB.redid] = {pos = {x = 744, y = 638, z = 6}, posEflag = {x = 744, y = 644, z = 6}, id = 1435, color = 180, na = "Vermelho", temple = 3, temple = 3, Esse é o id do templo que os players do time vermelho serão teletransportados. pos = {x = 744, y = 638, z = 6}, Posição de onde a bandeira do time fica posEflag = {x = 744, y = 644, z = 6}, Posição de onde os players do time entregam a bandeira. winp = 2, recompCTF = {{2160, 2}}, nopen = true, -- Precisa usar o comando para abrir? false não true sim TownExit = 1, -- Templo que o player será teletransportado quando acabar o evento ou ele sair dele. price = false, -- Preço para entrar no Evento, caso não precise Digite false. winp = 2, recompCTF = {{2160, 2}}, winp : pontos que um time precisará fazer para ganhar o evento. recompCTF: recompensa que o time ganhará ao vencer o CTF. para adicionar mais só é você fzer assim: recompCTF = {{2160, 2}, {7542, 1}}, 2160 é o id do item que vai adicionar, e 2 é a quantidade. 7542 é o id do item que vai adicionar, e 1, é a quantidade. nopen = true, -- Precisa usar o comando para abrir? false não true sim se precisar usar o comando /ctf open para abrir o evento coloque true, se não precisar coloque false. TownExit = 1, -- Templo que o player será teletransportado quando acabar o evento ou ele sair dele. price = false, -- Preço para entrar no Evento, caso não precise Digite false. TownExit: id do templo que o player será teletransportado quando ele sair do evento ou quando o adm usar /ctf close. price: preço para entrar no evento em gold coins, caso não precise deixe false. Não esqueçam de criar um teleport dentro do evento, com a actionid 47521, caso os players queiram sair do evento E aqui acabamos mais um código.. '-' Flw ae xD . Qualquer bug não se acanhe em falar Abraço.
  18. MaXwEllDeN postou uma resposta no tópico em Suporte & Pedidos
    A primeira é DotA - Basshunter, a segunda é Thriller - Michael Jackson
  19. MaXwEllDeN postou uma resposta no tópico em Suporte & Pedidos
    Não chei uma área adequada para postar, então vai aqui mesmo....
  20. Olá Galera, hoje vou postar um tutorial que ensina você a deixar seu código mais bonito, legível e organizado. Vamos lá. Em primeiro lugar vamos aprender oque é indentação ou identação. Exemplo de um código com indentação: function doPlayerCompleteQuest(uid, quest) doPlayerAddItem(uid, quest[1], quest[2]) setPlayerStorageValue(uid, quest[3], 1) doTeleportThing(uid, getTownPosition(getPlayerTown(uid))) doPlayerSendTextMessage(uid, 27, "Você completou a quest ".. quest[4] ..".") if (getPlayerStorageValue(uid, quest[5]) > 0) then doPlayerSendTextMessage(uid, 27, "E recebeu um bônus por ter completado outra quest.") end return true end Este mesmo código, mas agora sem indentação: function doPlayerCompleteQuest(uid,quest) doPlayerAddItem(uid,quest[1],quest[2]) setPlayerStorageValue(uid,quest[3],1) doTeleportThing(uid,getTownPosition(getPlayerTown(uid))) doPlayerSendTextMessage(uid,27,"Você completou a quest "..quest[4]..".") if (getPlayerStorageValue(uid,quest[5])>0) then doPlayerSendTextMessage(uid,27,"E recebeu um bônus por ter completado outra quest.") end return true end Um código com indentação, a primeira vista pode não ser nada de mais. Porém se você fizer um código grande, com muitas funções, condições e declarações, uma boa indentação deixa seu código muito mais fácil de ser lido por outros programadores e até por você mesmo e ser modificado também. Enquanto eu lia um livro sobre C++, encontrei uma lista de algumas boas práticas para programar que eu já conhecia e outras que aprendí. Listarei algumas delas aqui. Bem, com essas dicas ai eu acho que muitas pessoas podem melhorar o estilo de programar , Falous galera. Abraço. OBS: A maioria das dicas listadas aqui foram tiradas do Livro: Deitel - Como Programar C++ 5ª Edição
  21. Gostei cara, só precisava de uma Identação legal ai né...

Informação Importante

Confirmação de Termo