Solutions
-
Jamison Collins's post in (Resolvido)Comando !frags was marked as the answerTente isso:
local useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) function onSay(cid, words, param, channel) if(not useFragHandler) then return false end local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = { name = result:getDataString("name"), level = result:getDataInt("level"), date = result:getDataInt("date") } if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month), dayred = getConfigValue('dailyFragsToRedSkull'), dayblack = getConfigValue('dailyFragsToBlackSkull'), weekred = getConfigValue('weeklyFragsToRedSkull'), weekblack = getConfigValue('weeklyFragsToBlackSkull'), monthred = getConfigValue('monthlyFragsToRedSkull'), monthblack = getConfigValue('monthlyFragsToBlackSkull') } doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Day: " .. size.day .. " (red skull: " .. size.dayred .." / black skull: " .. size.dayblack .. ")") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Week: " .. size.week .. " (red skull: " .. size.weekred .. " / black skull: " .. size.weekblack .. ")") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Month: " .. size.month .. " (red skull: " .. size.monthred .. " / black skull: " .. size.monthblack .. ")") local skullEnd = getPlayerSkullEnd(cid) if(skullEnd > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)) end return true end -
Jamison Collins's post in (Resolvido)Variavel local t = string.explode(string.lower(param), ",") was marked as the answerExemplo:
"/addon citizen"
Com isso,
local t = string.explode(string.lower(param), ",")
Nós podemos fazer isso:
if t[2] == "citizen" then
do...
end
É uma variável usada para verificar posições de palavras separadas por virgula ou não.
-
Jamison Collins's post in (Resolvido)[Urgente] Erro ao logar was marked as the answerQual é o WorldID que está no seu config.lua?
-
Jamison Collins's post in (Resolvido)[Pedido] Script se alguem morrer em uma área ganhe um storage was marked as the answerTente isso:
local fromPos = {x = 1000, y = 1000, z = 7} local toPos = {x = 2000, y = 2000, z = 7} local storage, stor_amount = 1000, 1 function onPrepareDeath(cid, deathlist) if not isPlayer(cid) then return true end if isPlayer(cid) and isInArea(getPlayerPosition(cid), fromPos, toPos) then setPlayerStorageValue(cid, storage, stor_amount) end return true end Sabe configurar e adicionar no creature.xml/login.lua, não é?
-
Jamison Collins's post in (Resolvido)[AJUDA] Receber todos os addons por Clique was marked as the answerBem, tente isso:
Crie um arquivo .lua na pasta script de Actions, com nome addons.lua e adicione isso:
function onUse(cid, item, frompos, item2, topos) local level = 10 -- Level necessário para poder usar o item. if item.itemid == 9693 then if getPlayerLevel(cid) >= level then doPlayerAddAddons(cid, 3) -- 3 significa os dois addons. doSendMagicEffect(getThingPos(cid), 28) doPlayerSendCancel(cid, "You have received all addons.") doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "You don't have level enought.") end end return true end Abra o action.xml e adicione essa tag:
<action itemid="9693" event="script" value="addons.lua"/> -
Jamison Collins's post in (Resolvido)Account manager e escolher vocação ao clicar na estatua was marked as the answerTente esse script:
Cria um arquivo .lua na pasta action > script, chamado statue_vocation, e cole isso dentro:
modaldialog = { title = "Statue of Destiny", message = "Choose your vocation.", buttons = { { id = 1, value = "Ok" }, { id = 2, value = "Cancel" }, }, buttonEnter = 1, buttonEscape = 2, choices = { { id = 1, value = "[Sorcerer]" }, { id = 2, value = "[Druid]" }, { id = 3, value = "[Paladin]" }, { id = 4, value = "[Knight]" } }, popup = false } local templeID = 1 function callback(cid, button, choice) if button == 1 or button == 29 or button == 0 then if (choice == 1) then doPlayerSetVocation(cid, 1) doTeleportThing(cid, getTownTemplePosition(templeID)) doSendMagicEffect(getTownTemplePosition(templeID), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation, now you are a sorcerer!") elseif (choice == 2) then doPlayerSetVocation(cid, 2) doTeleportThing(cid, getTownTemplePosition(templeID)) doSendMagicEffect(getTownTemplePosition(templeID), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation, now you are a druid!") elseif (choice == 3) then doPlayerSetVocation(cid, 3) doTeleportThing(cid, getTownTemplePosition(templeID)) doSendMagicEffect(getTownTemplePosition(templeID), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation, now you are a paladin!") elseif (choice == 4) then doPlayerSetVocation(cid, 4) doTeleportThing(cid, getTownTemplePosition(templeID)) doSendMagicEffect(getTownTemplePosition(templeID), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulation, now you are a knight!") end end end function onUse(cid, item, fromPosition, itemEx, toPosition) addDialog(modaldialog, 2345, cid, callback); return true end Bem, esse script é para uma unica estatua.
Adicione isso no action.xml:
<action actionid="5505" event="script" value="statue_vocation.lua"/> ...
Não se esqueça de configurar no script.
local templeID = 1 Você vai por o número do Templo ID para onde o player será teleportado após escolher a vocação.
-
Jamison Collins's post in (Resolvido)como colocar uma magia pra healar por magic level? was marked as the answerSó você fazer o seguinte:
Nas spells que você gostaria de modificar, você apaga essa linha de COMBAT_FORMULA_LEVELMAGIC, ?, ?, ?, ?)
E embaixo, você cola isso:
function onGetFormulaValues(cid, level, maglevel) min = (maglevel * 100) max = (maglevel * 100) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") É só você alterar o valor acima representado como "100" para o valor desejado. Isso serve para todas as magias.
Ficará assim:
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onGetFormulaValues(cid, level, maglevel) min = ((level / 5) + (maglevel * 1.4) + 8) max = ((level / 5) + (maglevel * 1.8) + 11) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end -
Jamison Collins's post in (Resolvido)Script ADD extra attack a cada skill ganhado; was marked as the answerTente esse:
function onAdvance(cid, skill, oldlevel, newlevel) if(skill == SKILL__EXPERIENCE) then return true end local extra_attack_speed = (getPlayerSkillLevel(cid, SKILL_FIST) - 10) * 3 if skill == 0 then doPlayerSetExtraAttackSpeed(cid, extra_attack_speed) return true end return true end -
Jamison Collins's post in (Resolvido)Staff que ataca por magic level script pf was marked as the answer<wand id="7410" level="3500" mana="15" type="holy" event="script" value="wand3.lua"> <!-- Vip Wand 3 -->
<vocation id="2"/>
<vocation id="1"/>
</wand>
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0) setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY) function onGetFormulaValues(cid, level, maglevel) min = -(maglevel*20) max = -(maglevel*20) return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onUseWeapon(cid, var) local ret = doCombat(cid, combat, var) if(ret == LUA_ERROR) then return LUA_ERROR end return true end -
Jamison Collins's post in (Resolvido)[Ajuda] Distro was marked as the answerBem, para o Baiak, o distro mais usado, é o TFS 0.4 ... Eu por exemplo já usei muito TFS 0.4 e TFS 0.3.6.
-
Jamison Collins's post in (Resolvido)BAU DE QUEST QUE DE +1 DE SKILL OU ML was marked as the answerBem, tente isso:
Crie um arquivo .lua na pasta action/scripts chamado skillreward e cole isso dentro:
local config = { skills_amount = 1, -- quantidade de skills que o player ganhará se ele for Knight ou Paladin magiclevel_amount = 1, -- quantidade de magic levels o player ganhará se ele for Druid ou Sorcerer storage = 10000, -- Storage para quest. uniqueID = 1000, -- UniqueID que você colocará no Map Editor mensagem = "Voce recebeu "..config.skills_amount.." skills e "..config.magiclevel_amount.." magic levels.", } local skills_id = {1, 2, 3, 4, 5} -- Não mexer. function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.uid == config.uniqueID) then if getPlayerStorageValue(cid, config.storage) == -1 then if isInArray({1, 2, 5, 6}, getPlayerVocation(cid)) then for i = 1, table.maxn(skills_id) do doPlayerAddSkill(cid, skills_id[i], config.skills_amount) end else doPlayerAddMagLevel(cid, config.magiclevel_amount) end doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, config.mensagem) setPlayerStorageValue(cid, config.storage, 1) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce ja recebeu seu premio.") end end return true end Depois abra seu action.xml e cole essa tag dentro:
<action uniqueid="10000" script="skillreward.lua"/> No script você pode configurar o UniqueID e a quantidade de skills que o player vai ganhar, eu separei que os knights e paladins não ganharão magic level, apenas skills.
Espero ter ajudado, qualquer dúvida ou erro, pode retornar.
-
Jamison Collins's post in (Resolvido)Groups Bugado was marked as the answerBem, vamos lá...
Primeiramente, deixe tudo do jeito que você baixou, sem alterações.
Agora, você mudará o group id do seu personagem para 3.
Logo depois, você entrará na tabela de accounts, e na mesma conta onde tiver o seu personagem, você alterará o type para 5.
Assim :
Desculpa a demora.
-
Jamison Collins's post in (Resolvido)[PEDIDO] Script deixar player Mudo. was marked as the answerCrie um arquivo .lua na pasta Talkaction chamado mute.lua, e adicione isso :
function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local pid = getPlayerByNameWildcard(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " is not currently online.") return true end if(getPlayerAccess(cid) <= getPlayerAccess(pid) or getPlayerFlagValue(pid, PLAYERFLAG_CANNOTBEMUTED)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.") return true end if(words:sub(2, 2) == "u") then doRemoveCondition(pid, CONDITION_MUTED, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been unmuted.") return true end local time = tonumber(t[2]) if(not time or time < 1) then time = -1 end doMutePlayer(pid, time) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been muted for" .. (time < 1 and "ever" or " " .. time .. " seconds") .. ".") return true end Abra talkaction.xml e adicione essa tag :
<talkaction log="yes" words="/mute;/unmute" access="3" event="script" value="mute.lua"/> Para utilizar o comando basta falar :
/mute player, tempo
Lembrando que o tempo é em segundos.
-
Jamison Collins's post in (Resolvido)Globalevents que teleporta players. was marked as the answerTente criar uma função do tipo :
Adicione isso em uma lib functions :
Lembre-se de mudar STORAGE_PLAYER para o número que você quer...
function getPlayersWithStorage() local players = {} for _, cid in pairs(getPlayersOnline()) do if(getPlayerStorageValue(cid, STORAGE_PLAYER) > 0) then table.insert(players, cid) end end return players end Depois em seu script, coloque isso :
for _, cid in ipairs(getPlayersWithStorage()) do doTeleportThing(getThingPos(cid), {x = 1005, y = 1139, z = 7}, true) end E bla bla bla...
-
Jamison Collins's post in (Resolvido)[PEDIDO] Ao clicar em alavanca ganha vip was marked as the answerlocal config = { effect = 28, premiumdays = 31, -- quantidade de premium days que o player receberá. position = {x = 1027, y = 913, z = 5}, -- posição para onde o player será teleportado coin = 2160, -- ID da moeda (crystal coin no caso) amount_coins = 100, -- quantidade de moeda uid = 4500 -- UniqueID que você colocará no RME map editor e na TAG action.xml } function onUse(cid, item, frompos, item2, topos) if (item.itemid == 1945 or item.itemid == 1946) and item.uid == config.uid then doTeleportThing(cid, config.position) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doSendMagicEffect(getThingPos(cid), config.effect) doPlayerAddPremiumDays(cid, config.premiumdays) doBroadcastMessage(getCreatureName(cid) .." has received ".. config.premiumdays .." premium account days!") doPlayerAddItem(cid, config.coin, config.amount_coins) end return true end Tente esse, eu sem querer havia esquecido do "end"
-
Jamison Collins's post in (Resolvido)Comando que da premmium was marked as the answerTente isso :
Crie um arquivo .lua chamado : addpremium.lua. Cole esse script dentro :
function onSay(cid, words, param, channel) local t = string.explode(param, ",") if(param == '') then pid = getCreatureTarget(cid) if(pid == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end else pid = getPlayerByNameWildcard(t[1]) end if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " is not currently online.") return true end local m = tonumber(t[2]) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received ".. m .." premium account days") doPlayerAddPremiumDays(pid, m) return true end Depois crie a TAG na talkaction.xml assim :
<talkaction log="yes" words="/addpremium" access="5" event="script" value="addpremium.lua"/> Você usará assim :
/addpremium nomedoplayer, diasdepremium
-
Jamison Collins's post in (Resolvido)[Pedido] Como colocar X item pra aparecer em Y sqm? was marked as the answerAqui está :
local config = { actionID = 7580, dices_table = {x=34, y=28, z=7, stackpos = 2}, -- Posição da mesa do dado. coal_basin = {x=32, y=28, z=7, stackpos = 2}, -- Posição do coal basin. effect = 30, -- Efeito. ID_do_dice = 5792, -- Aqui você altere para o Id do dice (dado) coal_basin_ID = 9772, teleport = {x=34, y=21, z=7}, -- Posição que o player será teleportado após sair do tile. } function onStepIn(cid, item, position, fromPosition) if isPlayer(cid) == true then if item.actionid == config.actionID and getThingfromPos(config.dices_table).itemid ~= config.ID_do_dice then doCreateItem(config.ID_do_dice, 1, config.dices_table) doCreateItem(config.coal_basin_ID, 1, fromPosition) doSendMagicEffect(config.dices_table, config.effect) end end return true end function onStepOut(cid, item, position, fromPosition) if isPlayer(cid) == true then if item.actionid == config.actionID then doRemoveThing(getTileItemById(config.coal_basin, config.coal_basin_ID).uid, 1) doSendMagicEffect(config.dices_table, CONST_ME_POFF) doSendMagicEffect(config.coal_basin, CONST_ME_POFF) doTeleportThing(cid, config.teleport) end end return true end -
Jamison Collins's post in (Resolvido)Help 10.31 Atualização de Server. was marked as the answerInfelizmente TFS 1.0 (o único que suporta a versão 10.31 até então) é totalmente distinto de outros distros... Há sim como reverter, porém eu estimo que 90% de seus scripts terião que ser revisados e refeitos. Eu como usuário do TFS 1.0 sugiro que você use-o apenas para um projeto próprio.
-
Jamison Collins's post in (Resolvido)AddonDoll TALKACTIONS was marked as the answerfunction onSay(cid, words, param) local femaleOutfits = { ["citizen"]={136}, ["hunter"]={137}, ["mage"]={138}, ["knight"]={139}, ["nobleman"]={140}, ["summoner"]={141}, ["warrior"]={142}, ["barbarian"]={147}, ["druid"]={148}, ["wizard"]={149}, ["oriental"]={150}, ["pirate"]={155}, ["assassin"]={156}, ["beggar"]={157}, ["shaman"]={158}, ["norseman"]={252}, ["nightmare"]={269}, ["jester"]={270}, ["brotherhood"]={279}, ["demonhunter"]={288}, ["yalaharian"]={324}, ["warmaster"]={336}, ["wayfarer"]={367} } local maleOutfits = { ["citizen"]={128}, ["hunter"]={129}, ["mage"]={130}, ["knight"]={131}, ["nobleman"]={132},["summoner"]={133}, ["warrior"]={134}, ["barbarian"]={143}, ["druid"]={144}, ["wizard"]={145}, ["oriental"]={146}, ["pirate"]={151}, ["assassin"]={152}, ["beggar"]={153}, ["shaman"]={154}, ["norseman"]={251}, ["nightmare"]={268}, ["jester"]={273}, ["brotherhood"]={278}, ["demonhunter"]={289}, ["yalaharian"]={325}, ["warmaster"]={335}, ["wayfarer"]={366} } local msg = {"Digite o nome correto!", "Voçe não tem um Addon Doll!", "Bad param!", "Full Addon Adicionado!", "Você não tem 1KK"} local param = string.lower(param) local addon_preco = 1000000 -- 1kk if(getPlayerItemCount(cid, 2112) > 0) then if(param ~= "" and maleOutfits[param] and femaleOutfits[param]) then if (doPlayerRemoveMoney(cid, addon_preco) == TRUE) then doPlayerRemoveItem(cid, 2112, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[4]) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) if(getPlayerSex(cid) == 0)then doPlayerAddOutfit(cid, femaleOutfits[param][1], 3) else doPlayerAddOutfit(cid, maleOutfits[param][1], 3) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[5]) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[1]) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg[2]) end end Tente esse.
-
Jamison Collins's post in (Resolvido)[AJUDA] Item que uma outfit ao equipa-lo. was marked as the answerTente mudar o script por isso (apenas os scripts, pois as tags estão certas) :
function onEquip(cid, item, slot) local outfit = {lookType = 104} -- looktype doCreatureSay(cid, "SUBA.", TALKTYPE_ORANGE_1) doSetCreatureOutfit(cid, outfit, -1) doSendMagicEffect(getCreaturePosition(cid), 34) doChangeSpeed(cid, 500) -- speed almenta return TRUE end function onDeEquip(cid, item, slot) doRemoveCondition(cid, CONDITION_OUTFIT) doChangeSpeed(cid, -500) -- speed volta doSendMagicEffect(getCreaturePosition(cid), 34) doCreatureSay(cid, "DESCE.", TALKTYPE_ORANGE_1) return TRUE end -
Jamison Collins's post in (Resolvido)Heal Paladin e ml was marked as the answerOcorrerá que o MagicLevel demorará para subir (ficará mais lerdo, e da forma padrão da vocação Paladin).
-
Jamison Collins's post in (Resolvido)Spell sem WORDS was marked as the answerBem, não sei... mas se for isso, sugiro por uma "word" bem estranha, do tipo : awn1j3214! (sei lá, qualquer coisa mesmo).