Postado Abril 30, 2018 7 anos 4 minutos atrás, kbpaulo disse: vodkart tem que ver como ADms no Forum , pq qui tb ta assim , quando pego script dentro do Code[ ] ele ta vindo cheio de ??????/ pelo script....e uns acento em alguns numeros tb... percebi isso tbm, e ta me deixando com raiva, vou começar a simplesmente jogar o código num quote mesmo 2 minutos atrás, mullino disse: function isInRange(position, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end tem issu na primeira linha pode add o seu asim memo? adc la na ultima linha msm, na sua lib... [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Abril 30, 2018 7 anos Autor 6 minutos atrás, Vodkart disse: percebi isso tbm, e ta me deixando com raiva, vou começar a simplesmente jogar o código num quote mesmo adc la na ultima linha msm, na sua lib... add na 032-position.lib ficou asim function isInRange(position, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end function getDistanceBetween(fromPosition, toPosition) local x, y = math.abs(fromPosition.x - toPosition.x), math.abs(fromPosition.y - toPosition.y) local diff = math.max(x, y) if(fromPosition.z ~= toPosition.z) then diff = diff + 9 + 6 end return diff end function getDirectionTo(pos1, pos2) local dir = SOUTH if(pos1.x > pos2.x) then dir = WEST if(pos1.y > pos2.y) then dir = NORTHWEST elseif(pos1.y < pos2.y) then dir = SOUTHWEST end elseif(pos1.x < pos2.x) then dir = EAST if(pos1.y > pos2.y) then dir = NORTHEAST elseif(pos1.y < pos2.y) then dir = SOUTHEAST end elseif(pos1.y > pos2.y) then dir = NORTH elseif(pos1.y < pos2.y) then dir = SOUTH end return dir end function getCreatureLookPosition(cid) return getPositionByDirection(getThingPosition(cid), getCreatureLookDirection(cid)) end function getPositionByDirection(position, direction, size) local n = size or 1 if(direction == NORTH) then position.y = position.y - n elseif(direction == SOUTH) then position.y = position.y + n elseif(direction == WEST) then position.x = position.x - n elseif(direction == EAST) then position.x = position.x + n elseif(direction == NORTHWEST) then position.y = position.y - n position.x = position.x - n elseif(direction == NORTHEAST) then position.y = position.y - n position.x = position.x + n elseif(direction == SOUTHWEST) then position.y = position.y + n position.x = position.x - n elseif(direction == SOUTHEAST) then position.y = position.y + n position.x = position.x + n end return position end function doComparePositions(position, positionEx) return position.x == positionEx.x and position.y == positionEx.y and position.z == positionEx.z end function getArea(position, x, y) local t = {} for i = (position.x - x), (position.x + x) do for j = (position.y - y), (position.y + y) do table.insert(t, {x = i, y = j, z = position.z}) end end return t end function Position(x, y, z, stackpos) local position = {x = 0, y = 0, z = 0} if(isNumeric(x .. y .. z)) then position = {x = x, y = y, z = z} if(isNumeric(stackpos)) then position.stackpos = stackpos end end return position end function isValidPosition(position) return (isNumeric(position.x .. position.y .. position.z) and position.x > 0 and position.y > 0 and position.z >= 0 and position.z <= 15) end function isInRange(pos, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end ae esse erro Account Manager has logged in. [Error - CreatureScript Interface] function onLogin(cid) domodlib('arena_config') if isInRange(getCreaturePosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end return true end:onLogin Description: data/lib/032-position.lua:105: attempt to index global 'position' (a nil value) stack traceback: data/lib/032-position.lua:105: in function 'isInRange' [string "LuaInterface::loadBuffer"]:3: in function <[string "LuaInterface::loadBuffer"]:1> Account Manager has logged out. [Error - CreatureScript Interface] In a timer event called from: data/creaturescripts/scripts/antimc.lua:onLogin Description: (internalGetPlayerInfo) Player not found when requesting player info #29 Se trocasse essa função de teleportar os vencedores para o templo por abrir um teleport não resolveria esse bug não? Se trocasse essa função de teleportar os vencedores para o templo por abrir um teleport não resolveria esse bug não? Editado Abril 30, 2018 7 anos por mullino (veja o histórico de edições)
Postado Abril 30, 2018 7 anos Autor Ae @Vodkart Funciou ate emtao mas sempre q clicamos na alvanca fala que nao tem player en todas as posiçoes ja confire as posiçoes estao corretas <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Guild For Arena Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="gfae_config"><![CDATA[ config = { positions = { {{x=21, y=480, z=7}, {x=44, y=279, z=7}}, {{x=21, y=480, z=7}, {x=45, y=279, z=7}}, {{x=21, y=480, z=7}, {x=44, y=280, z=7}}, {{x=21, y=480, z=7}, {x=45, y=280, z=7}}, }, positions2 = { {{x=78, y=448, z=7}, {x=47, y=279, z=7}}, {{x=78, y=448, z=7}, {x=48, y=279, z=7}}, {{x=78, y=448, z=7}, {x=47, y=280, z=7}}, {{x=78, y=448, z=7}, {x=48, y=280, z=7}}, }, money = 1,-- em k hours = 5, -- para voltar a arena storage = 889757, a = {x = 14, y= 442, z=7}, -- pos começo da arena b = {x = 88, y= 493, z=7}, -- pos final da arena exit_pos = {x=151, y=50, z=7} } function getPlayersWithGuildInArena(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end function endArenaEvent(cid, p1, p2) for _, ret in pairs(getPlayersWithGuildInArena(p1, p2)) do if getPlayerGuildId(cid) ~= getPlayerGuildId(ret) then return false end end return true end ]]></config> <event type="login" name="GuildForArenaLogin" event="script"><![CDATA[ domodlib('gfae_config') function onLogin(cid) registerCreatureEvent(cid, "GuildForArenaDeath") if getCreatureName(cid) ~= "Account Manager" and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) end return true end]]></event> <event type="preparedeath" name="GuildForArenaDeath" event="script"><![CDATA[ domodlib('gfae_config') function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) if endArenaEvent(deathList[1], config.a, config.b) then -- qndo acaba o evento for _, ret in pairs(getPlayersWithGuildInArena(config.a, config.b)) do doPlayerAddItem(ret, 1999, 1) -- premio doTeleportThing(ret, config.exit_pos) end doBroadcastMessage("A guild "..getPlayerGuildName(deathList[1]).." Foi a vencedora da arena!") end end return true end]]></event> <action actionid="7124" event="script"><![CDATA[ domodlib('gfae_config') function onUse(cid, item, fromPosition, item2, toPosition) if #getPlayersWithGuildInArena(config.a, config.b) > 0 then return doPlayerSendCancel(cid, "espere, atualmente ha guilds batalhando.") and doSendMagicEffect(getThingPos(cid), 2) end for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Nao existe players em todas as posicoes.") and doSendMagicEffect(getThingPos(cid), 2) end local guild1 = getPlayerGuildId(getTopCreature(config.positions[1][1]).uid) if getPlayerGuildId(creature) ~= guild1 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end -- Checando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Not enough players.") and doSendMagicEffect(getThingPos(cid), 2) end local guild2 = getPlayerGuildId(getTopCreature(config.positions2[1][1]).uid) if getPlayerGuildId(creature) ~= guild2 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end doBroadcastMessage("Começou uma batalha entre ".. getPlayerGuildName(getTopCreature(config.positions[1][1]).uid) .." e ".. getPlayerGuildName(getTopCreature(config.positions2[1][1]).uid)..".") -- Teleportando posições 1 for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid doTeleportThing(creature, config.positions[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end -- Teleportando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid doTeleportThing(creature, config.positions2[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end return true end]]></action> </mod>
Postado Maio 2, 2018 7 anos Autor Olha ae a menssagem que aparece @Vodkart Mesmo com os 8 players nas posiçoes corretas olha o script <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Guild For Arena Event" version="8.6" author="Vodkart" contact="" enabled="yes"> <config name="gfae_config"><![CDATA[ config = { positions = { {{x=44, y=279, z=7}, {x=21, y=480, z=7}}, {{x=45, y=279, z=7}, {x=21, y=480, z=7}}, {{x=44, y=280, z=7}, {x=21, y=480, z=7}}, {{x=45, y=280, z=7}, {x=21, y=480, z=7}}, }, positions2 = { {{x=47, y=279, z=7}, {x=78, y=448, z=7}}, {{x=48, y=279, z=7}, {x=78, y=448, z=7}}, {{x=47, y=280, z=7}, {x=78, y=448, z=7}}, {{x=48, y=280, z=7}, {x=78, y=448, z=7}}, }, money = 500,-- em k hours = 5, -- para voltar a arena storage = 889757, a = {x = 14, y= 442, z=7}, -- pos começo da arena b = {x = 88, y= 493, z=7}, -- pos final da arena exit_pos = {x=151, y=50, z=7} } function getPlayersWithGuildInArena(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end function endArenaEvent(cid, p1, p2) for _, ret in pairs(getPlayersWithGuildInArena(p1, p2)) do if getPlayerGuildId(cid) ~= getPlayerGuildId(ret) then return false end end return true end ]]></config> <event type="login" name="GuildForArenaLogin" event="script"><![CDATA[ domodlib('gfae_config') function onLogin(cid) registerCreatureEvent(cid, "GuildForArenaDeath") if getCreatureName(cid) ~= "Account Manager" and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) end return true end]]></event> <event type="preparedeath" name="GuildForArenaDeath" event="script"><![CDATA[ domodlib('gfae_config') function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) and isInRange(getPlayerPosition(cid), config.a, config.b) then doTeleportThing(cid, config.exit_pos) if endArenaEvent(deathList[1], config.a, config.b) then -- qndo acaba o evento for _, ret in pairs(getPlayersWithGuildInArena(config.a, config.b)) do doPlayerAddItem(ret, 1999, 1) -- premio doTeleportThing(ret, config.exit_pos) end doBroadcastMessage("A guild "..getPlayerGuildName(deathList[1]).." Foi a vencedora da arena!") end end return true end]]></event> <action actionid="7124" event="script"><![CDATA[ domodlib('gfae_config') function onUse(cid, item, fromPosition, item2, toPosition) if #getPlayersWithGuildInArena(config.a, config.b) > 0 then return doPlayerSendCancel(cid, "espere, atualmente ha guilds batalhando.") and doSendMagicEffect(getThingPos(cid), 2) end for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Nao existe players em todas as posicoes.") and doSendMagicEffect(getThingPos(cid), 2) end local guild1 = getPlayerGuildId(getTopCreature(config.positions[1][1]).uid) if getPlayerGuildId(creature) ~= guild1 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end -- Checando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid if not isPlayer(creature) then return doPlayerSendCancel(cid, "Not enough players.") and doSendMagicEffect(getThingPos(cid), 2) end local guild2 = getPlayerGuildId(getTopCreature(config.positions2[1][1]).uid) if getPlayerGuildId(creature) ~= guild2 then return doPlayerSendCancel(cid, "Algum player nao e da guild correta.") and doSendMagicEffect(getThingPos(cid), 2) end if getPlayerStorageValue(creature, config.storage) - os.time() > 0 then return doPlayerSendTextMessage(cid, 25, "o Jogador "..getPlayerName(creature) .." Você só poderá voltar na arena em "..os.date("%d %B %Y %X ", getPlayerStorageValue(creature, config.storage))..".") end if getPlayerMoney(creature) < (config.money * 1000) then return doPlayerSendCancel(cid, "Algum player nao tem "..config.money.."k.") and doSendMagicEffect(getThingPos(cid), 2) end end doBroadcastMessage("Começou uma batalha entre ".. getPlayerGuildName(getTopCreature(config.positions[1][1]).uid) .." e ".. getPlayerGuildName(getTopCreature(config.positions2[1][1]).uid)..".") -- Teleportando posições 1 for i = 1, #config.positions do local creature = getTopCreature(config.positions[1]).uid doTeleportThing(creature, config.positions[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end -- Teleportando posições 2 for i = 1, #config.positions2 do local creature = getTopCreature(config.positions2[1]).uid doTeleportThing(creature, config.positions2[2]) doPlayerSendTextMessage(creature, 27, "You started the quest.") doSendMagicEffect(getThingPos(creature), 33) doPlayerRemoveMoney(creature, (config.money * 1000)) setPlayerStorageValue(creature, config.storage, os.time() + config.hours * 60 * 60) end return true end]]></action> </mod>
Postado Maio 2, 2018 7 anos quando eu te passei o código estava um looping na action, quando voltou, esse looping sumiu misteriosamente... só olhar na action alguem removei o dele. não sei se foi o fórum ou alguém ? descobri!! quando vocês colam o código sem a tag de code ele bugga pq nao reconhece o "" entendeu? fica italico e some... ai ai some o [i] -- some << se não for usado de forma certa, tem que ser no bb code [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.