
Solutions
-
Cjaker's post in (Resolvido)(PEDIDO) Adicionar limitação ao comando /goto, /c was marked as the answerConfigs = { RestrictNames = {"gm fulano de tal"} -- lista de nomes proibidos para se usar /goto } local function tableContains(table, value) for index = 1, #table do if table[index]:lower() == value:lower() then return true end end end function onSay(cid, words, param) local player = Player(cid) if getPlayerGroupId(cid) > 3 then local target = Creature(param) if target == nil or tableContains(Configs.RestrictNames, player:getName()) then player:sendCancelMessage("Creature not found.") return false end player:teleportTo(target:getPosition()) return false end end Configs = { RestrictNames = {"gm fulano de tal"} } local function tableContains(table, value) for index = 1, #table do if table[index]:lower() == value:lower() then return true end end end function onSay(player, words, param) if not player:getGroup():getAccess() then return true end local creature = Creature(param) if not creature or tableContains(Configs.RestrictNames, player:getName()) then player:sendCancelMessage("A creature with that name could not be found.") return false end local oldPosition = creature:getPosition() local newPosition = creature:getClosestFreePosition(player:getPosition(), false) if newPosition.x == 0 then player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".") return false elseif creature:teleportTo(newPosition) then if not creature:isInGhostMode() then oldPosition:sendMagicEffect(CONST_ME_POFF) newPosition:sendMagicEffect(CONST_ME_TELEPORT) end end return false end
-
Cjaker's post in (Resolvido)Mensagem No BUff was marked as the answerConfigs = { CooldownBuff = 30.0 -- segundos } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 30000) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, 25) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 10) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setCombatCondition(combat, condition) function onCastSpell(cid, var) if exhaustion.check(cid, 13101) == TRUE then doPlayerSendCancel(cid, "Podera usar novamente dentro de " ..math.floor(Configs.CooldownBuff).. " segundos.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end for k = 1, math.floor(Configs.CooldownBuff) do addEvent(function() if isCreature(cid) then local pos1 = {x = getPlayerPosition(cid).x + 0, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z} doSendMagicEffect(pos1, 112) doPlayerSendCancel(cid, "Faltam " ..(math.floor(Configs.CooldownBuff)-k).." segundos para o buff sumir.") end end, (k-1) * 1000) end exhaustion.set(cid, 13101, Configs.CooldownBuff) return doCombat(cid, combat, var) end
-
Cjaker's post in (Resolvido)(DUVIDA) ITENS usaveis no OB/IE was marked as the answerNo object builder tem que deixa-lo como possível para ser usado no jogo.
Em actions você registra o ID do item que vai ser usado.
-
Cjaker's post in (Resolvido)(Dúvida sobre Dev-Cpp) - Parâmetros no compilador was marked as the answerEsses parâmetros são as livrarias que, ao compilar, será chamado junto.
Elas servem para implementar novos recursos, como por exemplo: lua5.1 -> possibilita o uso da livraria .lua em c++ (no caso), assim tendo as funções em .lua scripting e em C.
Procure nas sources por isso "LuaScriptInterface" lhe dará um exemplo legal das funções usadas em .lua.