Jump to content

Secuencia de Problemas - DayZ login


Sergioks

Recommended Posts

Buenas! Tengo estos problemas en mi DayZ... ambos son de getAccountData, y no se que sucede aqui .-. Este DayZ Me lo paso un amigo, supongo que por no poder con estos errores que pueden causar incluso la caida del server :| Me desvie del tema xD. bueno, mis dudas son las siguientes:

PRIMER PROBLEMA, AL INICIAR EL SCRIPT:

Debugscript:

WARNING: login.lua:553: Bad argument @ 'getAccountData' [Expected account at argument 1, got boolean] 
  
WARNING: login.lua:610: Bad argument @ 'getAccountData' [Expected account at argument 1, got boolean] 

Honestamente no se que tiene alli de malo, por eso pido ayuda en estos AccountData's.

Lua:

function createVehicleOnServerStart() 
  local vehicleManager = getAccount("vehicleManager", "ds4f9$") 
  for i = 1, getAccountData(vehicleManager, "vehicleamount") or 0 do -- LINEA #553 
    wastedVehicle = false 
    vehicle = getAccount("vehicle_number_" .. i, "ds4f9$") 
    if not vehicle then 
      break 
    end 
    if getAccountData(vehicle, "isExploded") == true then 
      setAccountData(vehicle, "health", 1000) 
      wastedVehicle = true 
    end 
    local veh = createVehicle(getAccountData(vehicle, "model"), getAccountData(vehicle, "last_x"), getAccountData(vehicle, "last_y"), getAccountData(vehicle, "last_z"), getAccountData(vehicle, "last_rx"), getAccountData(vehicle, "last_ry"), getAccountData(vehicle, "last_rz")) 
    vehCol = createColSphere(getAccountData(vehicle, "last_x"), getAccountData(vehicle, "last_y"), getAccountData(vehicle, "last_z"), 4) 
    attachElements(vehCol, veh, 0, 0, 0) 
    setElementData(vehCol, "parent", veh) 
    setElementData(veh, "parent", vehCol) 
    setElementData(vehCol, "vehicle", true) 
    setElementData(vehCol, "MAX_Slots", getAccountData(vehicle, "MAX_Slots")) 
    setElementHealth(veh, getAccountData(vehicle, "health")) 
    xxx, yyy, zzz = getAccountData(vehicle, "spawn_x"), getAccountData(vehicle, "spawn_y"), getAccountData(vehicle, "spawn_z") 
    setElementData(vehCol, "spawn", { 
      getAccountData(vehicle, "model"), 
      xxx, 
      yyy, 
      zzz 
    }) 
    if wastedVehicle then 
      if getAccountData(vehicle, "model") == 497 then 
        item_id = math.random(table.size(hunterSpawns)) 
        xxx, yyy, zzz = hunterSpawns[item_id][1], hunterSpawns[item_id][2], hunterSpawns[item_id][3] 
      end 
      if getAccountData(vehicle, "model") == 487 then 
        local item_id = math.random(table.size(maverikSpawns)) 
        x, y, z = maverikSpawns[item_id][1], maverikSpawns[item_id][2], maverikSpawns[item_id][3] 
      end 
      setElementPosition(veh, xxx, yyy, zzz + 1) 
      setElementRotation(veh, 0, 0, 0) 
      local tires, engine = getVehicleAddonInfos(getElementModel(veh)) 
      setElementData(vehCol, "Tire_inVehicle", math.random(0, tires)) 
      setElementData(vehCol, "Engine_inVehicle", math.random(0, engine)) 
    end 
    setElementData(vehCol, "fuel", getAccountData(vehicle, "fuel")) 
    if not wastedVehicle then 
      for i, data in ipairs(vehicleDataTable) do 
        setElementData(vehCol, data[1], getAccountData(vehicle, data[1])) 
      end 
    else 
      if getElementModel(veh) == 433 or getElementModel(veh) == 470 then 
        for i, items in ipairs(lootItems.helicrashsides) do 
          local randomNumber = math.random(1, 10) 
          if randomNumber == 5 then 
            setElementData(vehCol, items[1], math.random(1, 2)) 
          end 
        end 
      end 
      setElementData(vehCol, "fuel", 10) 
    end 
  end 
  for i = 1, getAccountData(vehicleManager, "tentamount") or 0 do --- LINEA #610 
    tentData = getAccount("tent_number_" .. i, "ds4f9$") 
    if not tentData then 
      break 
    end 
    tent = createObject(3243, getAccountData(tentData, "last_x"), getAccountData(tentData, "last_y"), getAccountData(tentData, "last_z"), 0, 0, getAccountData(tentData, "last_rz") or 0) 
    setObjectScale(tent, 1.3) 
    tentCol = createColSphere(getAccountData(tentData, "last_x"), getAccountData(tentData, "last_y"), getAccountData(tentData, "last_z"), 4) 
    attachElements(tentCol, tent, 0, 0, 0) 
    setElementData(tentCol, "parent", tent) 
    setElementData(tent, "parent", tentCol) 
    setElementData(tentCol, "tent", true) 
    setElementData(tentCol, "vehicle", true) 
    setElementData(tentCol, "MAX_Slots", 100) 
    for i, data in ipairs(vehicleDataTable) do 
      setElementData(tentCol, data[1], getAccountData(tentData, data[1])) 
    end 
  end 
end 

este es al iniciar el script...

SEGUNDO PROBLEMA, El mismo anterior, solo que al detener el script.

El Problema aqui es cuando doy Stop al Script. Le da un Network Trouble a todos los usuarios del servidor, aveces se cae el servidor inclusive.

Debugscript:

WARNING: [DayZ-MTA]\DayZ\login.lua:546: Bad argument @ 'setAccountData' [Expected account at argument 1, got boolean] 
  
WARNING: [DayZ-MTA]\DayZ\login.lua:547: Bad argument @ 'setAccountData' [Expected account at argument 1, got boolean] 

LUA:

function saveallvehicles(ps, command) 
  counter = 0 
  counterTent = 0 
  for i, col in ipairs(getElementsByType("colshape")) do 
  local vehicleManager = getAccount("vehicleManager", "ds4f9$") 
    local veh = getElementData(col, "vehicle") 
    local helicrash = getElementData(col, "helicrash") 
    local hospitalbox = getElementData(col, "hospitalbox") 
    local tent = getElementData(col, "tent") 
    if veh and not helicrash or veh and not hospitalbox then 
      if tent then 
        counterTent = counterTent + 1 
        account = getAccount("tent_number_" .. counterTent, "ds4f9$") or false 
        if not account then 
          account = addAccount("tent_number_" .. counterTent, "ds4f9$") 
        end 
        local tent = getElementData(col, "parent") 
        local x, y, z = getElementPosition(tent) 
        local rx, ry, rz = getElementRotation(tent) 
        setAccountData(account, "last_x", x) 
        setAccountData(account, "last_y", y) 
        setAccountData(account, "last_z", z) 
        setAccountData(account, "last_rx", rx) 
        setAccountData(account, "last_ry", ry) 
        setAccountData(account, "last_rz", rz) 
        for i, data in ipairs(vehicleDataTable) do 
          setAccountData(account, data[1], getElementData(col, data[1])) 
        end 
      else 
        counter = counter + 1 
        account = getAccount("vehicle_number_" .. counter, "ds4f9$") or false 
        if not account then 
          account = addAccount("vehicle_number_" .. counter, "ds4f9$") 
        end 
        setAccountData(account, "spawn_x", getElementData(col, "spawn")[2]) 
        setAccountData(account, "spawn_y", getElementData(col, "spawn")[3]) 
        setAccountData(account, "spawn_z", getElementData(col, "spawn")[4]) 
        for i, data in ipairs(vehicleDataTable) do 
          setAccountData(account, data[1], getElementData(col, data[1])) 
        end 
        local vehicle = getElementData(col, "parent") 
        local model = getElementModel(vehicle) 
        local x, y, z = getElementPosition(vehicle) 
        local rx, ry, rz = getElementRotation(vehicle) 
        local health = getElementHealth(vehicle) 
        setAccountData(account, "last_x", x) 
        setAccountData(account, "last_y", y) 
        setAccountData(account, "last_z", z) 
        setAccountData(account, "last_rx", rx) 
        setAccountData(account, "last_ry", ry) 
        setAccountData(account, "last_rz", rz) 
        setAccountData(account, "health", health) 
        setAccountData(account, "model", model) 
        setAccountData(account, "isExploded", getElementData(vehicle, "isExploded") or false) 
      end 
    end 
    setAccountData(vehicleManager, "vehicleamount", counter) --- LINEA 546 
    setAccountData(vehicleManager, "tentamount", counterTent) --- LINEA 547 
  end 
end 
addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), saveallvehicles) 

Plz necesito ayuda en esto. :(

- Gracias de Antemano.

Link to comment
  • Recently Browsing   0 members

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