Tudo que zolax postou
-
Minning woodcutting problem
Hello im using avesta 7.6 distro and when im trying to use mining: --By:Cykotitan Improvised Version-- local config = { stones = {1285, 1356, 1357, 1358, 1359, 3608, 3615, 3607, 3609, 3616, 3666, 3667, 3668, 3670, 1295, 1290}, level = 20, skill = SKILL_CLUB, skillReq = 15, effect = CONST_ME_BLOCKHIT, addTries = 3, debris = 1336, msgType = 11, soul = 5 } local t = { [{1, 100}] = {msg = "Oh no, you missed and picked a hole in the ground and a rat came out of it!", summon = "Rat"}, [{101, 200}] = {msg = "You found %A %N.", item = 2157, amountmax = 5}, [{201, 300}] = {msg = "You found %A %N.", item = 2145, amountmax = 5}, [{301, 400}] = {msg = "You found %A %N.", item = 2225}, [{401, 500}] = {msg = "You found %A %N.", item = 2148, amountmax = 100}, [{501, 600}] = {msg = "You found %A %N.", item = 2146, amountmax = 5}, [{601, 700}] = {msg = "You found %A %N.", item = 2149, amountmax = 5}, [{701, 800}] = {msg = "You found %A %N.", item = 2150, amountmax = 3}, [{1001, 1100}] = {msg = "You found %A %N.", item = 2147, amountmax = 2}, [{1101, 1200}] = {msg = "You found %A %N.", item = 2143, amountmax = 4}, [{1201, 1300}] = {msg = "You found %A %N.", item = 2144, amountmax = 5}, [{1301, 1400}] = {msg = "An angry dwarf came out of the rock piles!", summon = "Dwarf"}, [{1401, 1500}] = {msg = "A badger got unstuck and it looks angry!", summon = "Badger"}, [{1501, 1600}] = {msg = "A rotworm came from a hole you made on the ground!", summon = "Rotworm"}, [{1701, 1800}] = {msg = "A weak troll has appeared from the pile of rocks!", summon = "Troll"}, [{1801, 1900}] = {msg = "Woah! A skeleton just appeared from the pile of rocks!", summon = "Skeleton"}, [{1901, 2000}] = {msg = "Your pick has been heavily damaged and it broke...", destroy = true} } function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(config.stones, itemEx.itemid) and config.level <= getPlayerLevel(cid) and config.skillReq <= getPlayerSkill(cid, config.skill) and config.soul <= getPlayerSoul(cid) then local v, amount, damage = math.random(2000), 1, nil for i, k in pairs(t) do if v >= i[1] and v <= i[2] then if k.destroy then doRemoveItem(item.uid) end if k.summon then doSummonCreature(k.summon, toPosition) end if k.item then if k.amountmax then amount = math.random(k.amountmax) end doPlayerAddItem(cid, k.item, amount) end if k.msg then local msg = k.msg if msg:find("%%") then if msg:find("%%A") and k.item then msg = msg:gsub("%%A", amount > 1 and amount or getItemDescriptions(k.item)) end if msg:find("%%N") and k.item then msg = msg:gsub("%%N", amount > 1 and getItemDescriptions(k.item).plural or getItemName(k.item)) end if msg:find("%%D") and damage then msg = msg:gsub("%%D", damage) end end doPlayerSendTextMessage(cid, config.msgType, msg) end doTransformItem(itemEx.uid, config.debris) doPlayerAddSoul(cid, -config.soul) doSendMagicEffect(toPosition,config.effect) doPlayerAddSkillTry(cid, config.skill, config.addTries) return true end end end return doPlayerSendCancel(cid, "You either aren't experienced, skilled or don't have enough soul, or this isn't a breakable rock.") end and woodcutting scripts: local config = { trees = {2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2712,2717,2718,2720,2722}, t = { [{1, 100}] = {tree = 2701}, [{101, 200}] = {tree = 2702}, [{201, 300}] = {tree = 2703}, [{301, 400}] = {tree = 2704}, [{401, 500}] = {tree = 2705}, [{501, 600}] = {tree = 2706}, [{601, 700}] = {tree = 2707}, [{701, 800}] = {tree = 2708}, [{801, 900}] = {tree = 2709}, [{901, 1000}] = {tree = 2710}, [{1001, 1100}] = {tree = 2712}, [{1101, 1200}] = {tree = 2717}, [{1201, 1300}] = {tree = 2718}, [{1301, 1400}] = {tree = 2720}, [{1401, 1500}] = {tree = 2722} }, level = 15, skill = SKILL_AXE, skillReq = 10, effect = CONST_ME_BLOCKHIT, addTries = 100, branches = 2767, msgType = MESSAGE_EVENT_ADVANCE, soul = 3, minutes = 1 } local t = { [{1, 500}] = {msg = "You choped the tree and got some wood", item = 2149, amountmax = 3}, [{501, 750}] = {msg = "You have damaged your axe and it broke!", destroy = true}, [{751, 1550}] = {msg = "You choped the tree down, but the the wood was not good."}, [{1551, 1650}] = {msg = "oh no the tree had a Wasps nest in it!", summon = "Wasp"}, [{1751, 2000}] = {msg = "You choped the tree and got some wood", item = 2148, amountmax = 5}, [{2001, 2250}] = {msg = "A Spider that was stuck jumped from the choped tree", summon = "Spider"}, [{2251, 2500}] = {msg = "There was a bird's nest in the tree and you took some eggs from the nest", item = 2695, amountmax = 5}, [{2501, 2750}] = {msg = "Hahaa! You found a sack with coins in it!", item = 2148, amountmax = 50}, [{2751, 3000}] = {msg = "A rat jumped at you!", summon = "Rat"} } function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(config.trees, itemEx.itemid) and config.level <= getPlayerLevel(cid) and config.skillReq <= getPlayerSkill(cid, config.skill) and config.soul <= getPlayerSoul(cid) then local v, amount, damage = math.random(3000), 1, nil for i, k in pairs(t) do if v >= i[1] and v <= i[2] then if k.destroy then doRemoveItem(item.uid) end if k.summon then doSummonCreature(k.summon, toPosition) end if k.item then if k.amountmax then amount = math.random(k.amountmax) end doPlayerAddItem(cid, k.item, amount) end if k.msg then local msg = k.msg doPlayerSendTextMessage(cid, config.msgType, msg) end local function regen(parameter) doCreatureAddHealth(cid, 20) addEvent(regen, 10*1000, {cid = cid}) end local function stopRegen(parameter) stopEvent(regen) end addEvent(stopRegen, 61*1000, {cid = cid}) doCreatureAddHealth(cid, 20) addEvent(regen, 10*1000, {cid = cid}) doRemoveItem(item.uid) doTransformItem(itemEx.uid, config.branches) doPlayerAddSoul(cid, -config.soul) doSendMagicEffect(toPosition, k.destroy and CONST_ME_HITAREA or config.effect) return doPlayerAddSkillTry(cid, config.skill, config.addTries) end end end return doPlayerSendCancel(cid, "Either this tree can't be choped or you don't have enough experience, skill or soul to chop this tree.") end but when im using axe or pick i have an errors: i cant find error, plz help.
-
talkaction debug plz help
Hello i have a problem with banmanager talkaction. Im using avesta 7.6 and when i used command i have an error: here is error.txt : Debug Assertion time: Fri Aug 16 16:57:41 2013 line: 102 module: Talk assertion: false position: [154,52,7] ---------------------------------------- and here is banmanager.lua: -- BANNING -- usage /ban add, player, character_name, lenght_in_days_numeric_number (default until server save) -- will ban Player -- usage /ban add, ip , character_name, lenght_in_days_numeric_number (default until server save) -- will ban IP -- usage /ban add, account, character_name, lenght_in_days_numeric_number (default until server save) -- will ban whole account -- usage /ban remove, player, character_name -- will delete ban on player -- usage /ban remove, account, character_name -- will delete ban on account -- usage /ban remove, ip, character_name -- will delete ban on IP (Warning if you want to unban a character with specific IP instead of character_name you have to first ban it in that way) -- CHECKING -- usage /ban all -- shows all bans -- usage /ban player -- shows player bans -- usage /ban account -- shows account bans -- usage /ban ip -- shows ip bans function convertSecondsToText(s) if s == 0 then return "0 seconds" end text = "" local days = 0 if s >= 60*60*24 then days = math.floor(s / (60*60*24)) if days == 1 then text = text .. "one day" else text = text .. days .. " days" end s = s % (60*60*24) end local hours = 0 if s >= 60*60 then hours = math.floor(s / (60*60)) if days > 0 then text = text .. ", " end if hours == 1 then text = text .. "one hour" else text = text .. hours .. " hours" end s = s % (60*60) end local minutes = 0 if s >= 60 then minutes = math.floor(s / 60) if days > 0 or hours > 0 then text = text .. ", " end if minutes == 1 then text = text .. "one minute" else text = text .. minutes .. " minutes" end s = s % (60) end local seconds = s if days > 0 or hours > 0 or minutes > 0 and seconds > 0 then text = text .. " and " end if seconds == 1 then text = text .. "one second" else text = text .. seconds .. " seconds" end return text end function parseTime(str) n = tonumber(string.match(str, "(%d+)")) + 0.0 or 1 t = string.match(str, "([%a%*]+)") or "d" if t == "*" or t == "forever" then n = 4294967295 elseif t == "ss" or t == "serversave" then n = 0 elseif t == "y" or t == "year" or t == "years" then n = n * 60*60*24*365 elseif t == "m" or t == "month" or t == "months" then n = n * 60*60*24*30 elseif t == "w" or t == "week" or t == "weeks" then n = n * 60*60*24*7 elseif t == "d" or t == "day" or t == "days" then n = n * 60*60*24 elseif t == "h" or t == "hour" or t == "hours" then n = n * 60*60 elseif t == "m" or t == "min" or t == "minute" or t == "minutes" then n = n * 60 else --n = n end return n end function doSendBanListMessage(creature, format) for v in string.gmatch(format, "$(%w+)") do local ss = "" if v == "player" then ss = "Player bans:\n" local banlist = getPlayerBanList() if #banlist == 0 then doPlayerSendTextMessage(creature, 11, "No players are banned.") else for index, ban in pairs(banlist) do local dt = "serversave" if ban["expires"] > 0 then dt = os.date("%c", ban["expires"]) if dt == nil then dt = "serversave" end end local bantext = "\"" .. ban["playername"] .. "\" until " .. dt .. "\n" if #ss + #bantext > 250 then -- Can't find in one message doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, ss) ss = bantext else ss = ss .. bantext end end end elseif v == "account" then ss = "Account bans:\n" local banlist = getAccountBanList() if #banlist == 0 then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No accounts are banned.") else for index, ban in pairs(banlist) do local dt = "serversave" if ban["expires"] > 0 then dt = os.date("%c", ban["expires"]) end local bantext = "#" .. ban["account"] .. " until " .. dt .. "\n" if #ss + #bantext > 250 then -- Can't find in one message doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, ss) ss = bantext else ss = ss .. bantext end end end elseif v == "ip" then ss = "IP bans:\n" local banlist = getIPBanList() if #banlist == 0 then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No IPs are banned.") else for index, ban in pairs(banlist) do local dt = "serversave" if ban["expires"] > 0 then dt = os.date("%c", ban["expires"]) end local bantext = convertIntToIP(ban["ip"], ban["mask"]) .. -- The +0.0 is required to circumvent lua's shortcomings with string->number conversion " until " .. dt .. "\n" if #ss + #bantext > 250 then -- Can't find in one message doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, ss) ss = "\n" .. bantext else ss = ss .. bantext end end end end if string.find(ss, "\n", string.find(ss, "\n") + 1) then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, ss) end end end function doBanPlayerChild(creature) doRemoveCreature(creature) end function doBanPlayer(gm, creature) local access = getPlayerAccess(creature) if access ~= LUA_ERROR and access < 3 then return end doPlayerSendTextMessage(creature, MESSAGE_EVENT_ADVANCE, "You have been banned.") addEvent(doBanPlayerChild, 1000, creature) end function onSay(creature, words, param) local access = getPlayerAccess(creature) if access ~= LUA_ERROR and access < 3 then return TRUE end local params = string.explode(param, ",") for k,v in pairs(params) do params[k] = v:strip_whitespace() end if #params == 0 then -- Print all bans doSendBanListMessage(creature, "$player $account $ip") elseif #params == 1 then if params[1] == "ip" then doSendBanListMessage(creature, "$ip") elseif params[1] == "player" or params[1] == "p" then doSendBanListMessage(creature, "$player") elseif params[1] == "account" or params[1] == "acc" or params[1] == "a" then doSendBanListMessage(creature, "$account") else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid syntax.") end return TRUE elseif #params == 2 then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid syntax.") return TRUE else -- Params greater than or equal to 3 local op = params[1] if op == "add" or op == "a" or op == "r" or op == "rem" or op == "remove" then local do_add = op == "add" or op == "a" local bantype = params[2] local target = params[3] if bantype == "a" or bantype == "account" or bantype == "acc" then local accno = 0 local isname = false if target:find("[^0-9]") == nil then -- No characters, an account number accno = target else -- Else a character name accno = getAccountNumberByPlayerName(target) isname = true end if accno ~= 0 then if do_add then local length = 0 -- Default until shutdown if #params >= 4 then length = parseTime(params[4]) end players = getPlayersByAccountNumber(accno) for _, pid in pairs(players) do doBanPlayer(creature, pid) end local ret = addAccountBan(accno, length, getPlayerGUID(creature)) if ret then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, target .. (isname and "'s account" or "") .. " was banned " .. (length ~= 0 and (" for " .. convertSecondsToText(length)) or " until serversave") .. ".") else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No account was banned.") end else local ret = removeAccountBan(accno) if ret == TRUE then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, target .. (isname and "'s account" or "") .. " was unbanned.") else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No account was unbanned.") end end else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "The account does not exist.") end elseif bantype == "p" or bantype == "player" then local guid = getPlayerGUIDByName(target) if guid ~= 0 then if do_add then local length = 0 -- Default until shutdown if #params >= 4 then length = parseTime(params[4]) end pid = getPlayerByName(target) if pid ~= 0 then doBanPlayer(creature, pid) end local ret = addPlayerBan(target, length, getPlayerGUID(creature)) if ret then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, target .. " was banned " .. (length ~= 0 and (" for " .. convertSecondsToText(length)) or " until serversave") .. ".") else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No player was banned.") end else local ret = removePlayerBan(target) if ret == TRUE then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, target .. " was unbanned.") else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No player was unbanned.") end end else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "The player does not exist.") end elseif bantype == "ip" or bantype == "i" then local isname = false local ip, mask = 0, 0 if target:find("[^0-9x%.%:]") == nil and target:find(".") ~= nil then -- No characters, an ip ip, mask = convertIPToInt(target) else -- Else a character name ip = getIPByPlayerName(target) mask = 4294967295 isname = true end if ip ~= 0 then if do_add then local length = 0 -- Default until shutdown if #params >= 4 then length = parseTime(params[4]) end players = getPlayersByIPAddress(ip, mask) for _, pid in pairs(players) do doBanPlayer(creature, pid) end local ret = addIPBan(ip, mask, length, getPlayerGUID(creature)) if ret then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, target .. (isname and "'s IP" or "") .. " was banned " .. (length ~= 0 and (" for " .. convertSecondsToText(length)) or " until serversave") .. ".") else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No IP was banned.") end else if removeIPBan(ip, mask) == TRUE then doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, target .. (isname and "'s IP" or "") .. " was unbanned.") else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "No IP was unbanned.") end end else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid IP address.") end else doPlayerSendTextMessage(creature, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid ban type.") end end end return TRUE end
-
Sistema de Pet V1.0 By PsyMcKenzie
Hello when i click right on empty pokeball(7632) or destroyed pokeball(7633) i got error [23/05/2013 16:29:09] [Error - Action Interface] [23/05/2013 16:29:09] data/actions/scripts/inne/pet_system.lua:onUse [23/05/2013 16:29:09] Description: [23/05/2013 16:29:09] (luaGetCreatureHealth) Creature not found how i can fix it?