Ir para conteúdo
  • Cadastre-se

[Resolvido] Erro LIB 32 dps de ter colocado zombie event


Posts Recomendados

Coloquei o zombievent no meu serve so que fica dando esse bug no distro

ygl.png

ta ae os arquivos

esse ae éo arquivo do zombie q ta dando erro no console \/

function loseOnZombieArena(cid)

	kickPlayerFromZombiesArea(cid)

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")

	local players = getZombiesEventPlayers()

	if(#players <= 1) then

		local winner = players[1]

		if(winner) then

			doPlayerAddItem(winner, 2157, 5, true)

			doPlayerAddItem(winner, 6119, 1, true)

			doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")

			doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")

			kickPlayerFromZombiesArea(winner)

		else

			doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")

		end

		doSetStorage(ZE_STATUS, 0)

		doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)

		doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)

		doSetStorage(ZE_ZOMBIES_SPAWNED, 0)

		local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1

		local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1

		local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}

		for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do

			centerPos.z = z

			for i, uid in pairs(getSpectators(centerPos, width, height, false)) do

				if(isMonster(uid)) then

					doRemoveCreature(uid)

				end

			end

		end

	end

end

function onStatsChange(target, cid, changetype, combat, value)

	if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then

		doCreatureAddHealth(target, getCreatureMaxHealth(target))

		loseOnZombieArena(target)

		return false

	end

	return true

end
eo lib aqui
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

function getDistanceBetween(firstPosition, secondPosition)

local x, y = math.abs(firstPosition.x - secondPosition.x), math.abs(firstPosition.y - secondPosition.y)

local diff = math.max(x, y)

if(firstPosition.z ~= secondPosition.z) then

  diff = diff + 9 + 6

end

return diff

end

function getDirectionTo(pos1, pos2)

local dir = NORTH

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

else

  if(pos1.y > pos2.y) then

   dir = NORTH

  elseif(pos1.y < pos2.y) then

   dir = SOUTH

  end

end

return dir

end

function getCreatureLookPosition(cid)

return getPosByDir(getThingPos(cid), getCreatureLookDirection(cid))

end

function getPosByDir(fromPosition, direction, size)

local n = size or 1

local pos = fromPosition

if(direction == NORTH) then

  pos.y = pos.y - n

elseif(direction == SOUTH) then

  pos.y = pos.y + n

elseif(direction == WEST) then

  pos.x = pos.x - n

elseif(direction == EAST) then

  pos.x = pos.x + n

elseif(direction == NORTHWEST) then

  pos.y = pos.y - n

  pos.x = pos.x - n

elseif(direction == NORTHEAST) then

  pos.y = pos.y - n

  pos.x = pos.x + n

elseif(direction == SOUTHWEST) then

  pos.y = pos.y + n

  pos.x = pos.x - n

elseif(direction == SOUTHEAST) then

  pos.y = pos.y + n

  pos.x = pos.x + n

end

return pos

end

function doComparePositions(pos, posEx)

return pos.x == posEx.x and pos.y == posEx.y and pos.z == posEx.z

end

function getArea(pos, rangeX, rangeY)

local t = {}

for i = (pos.x - rangeX), (pos.x + rangeX) do

  for j = (pos.y - rangeY), (pos.y + rangeY) do

   table.insert(t, {x = i, y = j, z = pos.z})

  end

end

return t

end

Editado por Kimoszin (veja o histórico de edições)


Regras Gerais 

 

"Califórnia Brasileira :cool: "

Link para o post
Compartilhar em outros sites

tenta esse:

function loseOnZombieArena(cid)

kickPlayerFromZombiesArea(cid)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")

local players = getZombiesEventPlayers()

if(#players <= 1) then

local winner = players[1]

if(winner) then

doPlayerAddItem(winner, 2157, 5, true)

doPlayerAddItem(winner, 6119, 1, true)

doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")

doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game

versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")

kickPlayerFromZombiesArea(winner)

else

doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")

end

doSetStorage(ZE_STATUS, 0)

doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)

doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)

doSetStorage(ZE_ZOMBIES_SPAWNED, 0)

local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1

local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1

local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y,

ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}

for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do

centerPos.z = z

for i, uid in pairs(getSpectators(centerPos, width, height, false)) do

if(isMonster(uid)) then

doRemoveCreature(uid)

end

end

end

end

end

function onStatsChange(target, cid, changetype, combat, value)

if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype ==

STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then

doCreatureAddHealth(target, getCreatureMaxHealth(target)

loseOnZombieArena(target)

return false

end

return true

end

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por 001rafa
      Galera como faz para poder criar um slot a mais no otcliente para poder equipar com itens por exemplo mais um ring e mais um colar?
      sei que tem q modificar no source do cliente e no distro alguem poderia me ajudar com um tutorial?

      grato pela atenção.

      up
    • Por M Cronos
      Boa Noite amigos, eu estava usando o Object builder e o item editor para adicionar uns sprites no meu servidor para usar com um script, este aqui >>> 
       que o @Comedinha postou para ajudar um outro membro.
      Bom a questão é que o script parece estar funcionando,por que não dá nenhum erro, mas o item também não é usado. bom eu fucei bastante e ainda  não consegui resultado então eu pensei que talvez eu tivesse que setar o item como usável no OB ou no IE, pois me lembro de ter visto isso em algum lugar, mas não consigo achar onde eu faço isso. alguém pode me ajudar? se possível. obrigado.
    • Por fezeRa
      Estou com um problema chato. Seguinte:
       
      O player pega , compra promotion, dai fica lá "Elder Druid", dai se ele reloga, ele volta pra Druid.
      Ou seja não ta salvando a vocation, é algum problema no login.lua que nao salva a vocation atual? Alguem sabe?
    • Por Bryan Robert
      Olá Eu tenho um server 8.0 ou 8.1 e para ligar o server utilizamos Serve.exe ou restarter.bat mas eu queria o server.exe em bat para eu editalo ou fazer ele volter a ser bat se alguem poder me passar link do server.bat ou programa q faz ele votar a ser bat vlw
       
       
      dboeternal.servegame.com:8090
    • Por thiaguinhuh
      gente eu qero saber como eu crio um npc q vc da 20k e vc vira a vocacion Troll e nova chegou hj e a mais forte ai vc compra com 20 k de gb =Gold Bar ai qero saber pf ajudem ai
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo