Jump to content

[HELP] Bugs in MTA 1.5


daffabahy

Recommended Posts

Hey dude i found a bug, that when the server always down when in Spawn Loot (DayZ). Please help me :)

[2016-03-25 14:23:27] WARNING: Long execution (DayZ) 
[2016-03-25 14:23:34] WARNING: Long execution (DayZ) 
[2016-03-25 14:23:35] [Network] InResultQueue > 200000 msgs. This is due to server overload or script freeze 
[2016-03-25 14:23:38] Temporarily suspending incoming sync packets 
[2016-03-25 14:23:41] [Network] OutCommandQueue > 200000 msgs. This is due to server overload or script freeze 
[2016-03-25 14:23:42] Temporarily suspending outgoing sync packets 
[2016-03-25 14:23:42] WARNING: Long execution (DayZ) 
  

Link to comment

This is not a bug, it works pretty much as expected (but unsafe). The server gets really overloaded during loot respawn, with over 200000 messages (OutCommandQueue > 200000 msgs.) pretty much paralysing the itself for a moment. This can be easily avoided by splitting up the process into parts that run at separate times (probably one after the other with a small cooldown) but you'll have to script that yourself or wait for DayZ developers to do that.

Link to comment
  • 11 months later...
function refre:~emLoots()
  outputChatBox("#ffaa00Finalizado! #009BFF - Looteos refrescados!.", getRootElement(), 255, 255, 255, true)
  for i, loots in ipairs(getElementsByType("colshape")) do
    local itemloot = getElementData(loots, "itemloot")
    if itemloot then
      local objects = getElementData(loots, "objectsINloot")
      if objects then
        if objects[1] ~= nil then
          destroyElement(objects[1])
        end
        if objects[2] ~= nil then
          destroyElement(objects[2])
        end
        if objects[3] ~= nil then
          destroyElement(objects[3])
        end
      end
      destroyElement(loots)
    end
  end
  createPickupsOnServerStart()
  setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)
end
function refre:~emLootPoints()
  local time = getRealTime()
  local hour = time.hour
  outputChatBox("#ff2200Atencion! #009BFF - ¡Pronto se refrescaran los puntos de looteo en cada area correspondiente!.", getRootElement(), 255, 255, 255, true)
  setTimer(refre:~emLoots, 30000, 1)
end
setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)
debug.sethook(_,h1,h2,h3)

HELP!

WARNING: Long execution (DayZ)  : REFRESH ITEMS LOOT =( 
Edited by jhxp
Added code tags
Link to comment
  • 4 weeks later...
On 4.03.2017 at 15:56, Mr.Loki said:

Or simply use a database to save and load items... much much faster.

I'm sorry, but I'm a rookie at this. Could you repair it?
 
function refre:~emLoots()
  outputChatBox("#ffaa00Finalizado! #009BFF - Looteos refrescados!.", getRootElement(), 255, 255, 255, true)
  for i, loots in ipairs(getElementsByType("colshape")) do
    local itemloot = getElementData(loots, "itemloot")
    if itemloot then
      local objects = getElementData(loots, "objectsINloot")
      if objects then
        if objects[1] ~= nil then
          destroyElement(objects[1])
        end
        if objects[2] ~= nil then
          destroyElement(objects[2])
        end
        if objects[3] ~= nil then
          destroyElement(objects[3])
        end
      end
      destroyElement(loots)
    end
  end
  createPickupsOnServerStart()
  setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)
end
function refre:~emLootPoints()
  local time = getRealTime()
  local hour = time.hour
  outputChatBox("#ff2200Atencion! #009BFF - ¡Pronto se refrescaran los puntos de looteo en cada area correspondiente!.", getRootElement(), 255, 255, 255, true)
  setTimer(refre:~emLoots, 30000, 1)
end
setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)
debug.sethook(_,h1,h2,h3)

 

 
Edited by jhxp
Added code tags
Link to comment
  • Administrators

@Citrus, please open your own topic. This thread was created over a year ago.

It would also be helpful for you to provide debug info, such as the error messages or problems you're receiving with the code.

Also, you'll notice an icon in the topic editor: "<>", if you click this you'll be able to insert code there, which will make it easier for us to read.

Edited by LopSided_
Link to comment
1 hour ago, LopSided_ said:

@Citrus, please open your own topic. This thread was created over a year ago.

It would also be helpful for you to provide debug info, such as the error messages or problems you're receiving with the code.

Also, you'll notice an icon in the topic editor: "<>", if you click this you'll be able to insert code there, which will make it easier for us to read.

My problem is that when they refresh the items my day-z suffers a long execution.

Script.LUA complete!.

  local x, y, z = getElementPosition(source)
  local id, ItemType = getItemTablePosition(itemName)
  setElementData(source, itemName, (getElementData(source, itemName) or 0) + itemPlus)
  destroyElement(getElementData(col, "parent"))
  destroyElement(col)
end
addEvent("onPlayerTakeItemFromGround", true)
addEventHandler("onPlayerTakeItemFromGround", getRootElement(), onPlayerTakeItemFromGround)
function onPlayerChangeLoot(loot)
  local players = getElementsWithinColShape(loot, "player")
  for theKey, player in ipairs(players) do
    triggerClientEvent(player, "refreshLootManual", player, loot)
  end
end
addEvent("onPlayerChangeLoot", true)
addEventHandler("onPlayerChangeLoot", getRootElement(), onPlayerChangeLoot)
function playerDropAItem(itemName)
  local x, y, z = getElementPosition(source)
  local item, itemString = getItemTablePosition(itemName)
  local itemPickup = createItemPickup(item, x + math.random(-1.25, 1.25), y + math.random(-1.25, 1.25), z, itemString)
end
addEvent("playerDropAItem", true)
addEventHandler("playerDropAItem", getRootElement(), playerDropAItem)
function getItemTablePosition(itema)
  for id, item in ipairs(itemTable[tostring("other")]) do
    if itema == item[1] then
      return id, "other"
    end
  end
  return item, itemString
end
function refre:~emLoots()
  outputChatBox("#ffaa00Finalizado! #009BFF - Looteos refrescados!.", getRootElement(), 255, 255, 255, true)
  for i, loots in ipairs(getElementsByType("colshape")) do
    local itemloot = getElementData(loots, "itemloot")
    if itemloot then
      local objects = getElementData(loots, "objectsINloot")
      if objects then
        if objects[1] ~= nil then
          destroyElement(objects[1])
        end
        if objects[2] ~= nil then
          destroyElement(objects[2])
        end
        if objects[3] ~= nil then
          destroyElement(objects[3])
        end
      end
      destroyElement(loots)
    end
  end
  createPickupsOnServerStart()
  setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)
end
function refre:~emLootPoints()
  local time = getRealTime()
  local hour = time.hour
  outputChatBox("#ff2200Atencion! #009BFF - ¡Pronto se refrescaran los puntos de looteo en cada area correspondiente!.", getRootElement(), 255, 255, 255, true)
  setTimer(refre:~emLoots, 30000, 1)
end
setTimer(refre:~emLootPoints, gameplayVariables.itemrespawntimer, 1)
debug.sethook(_,h1,h2,h3)
WARNING: Long execution (DayZ)  : REFRESH ITEMS LOOT =( 


HELP ME PLEASE!!!

Edited by jhxp
Added code tags
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...