Narutimmy Posted May 6, 2014 Share Posted May 6, 2014 Hola a todos el dia de hoy vengo con algo que me urge y demaciado ya busque 1,000 y 1 forma y nada por lo que investigue esta parte del codigo se encarga de guardarlas pero no lo hace alguna idea function saveallvehicles(ps, command) counter = 0 counterTent = 0 local vehicleManager = getAccount("vehicleManager", "ds4f9$") for i, col in ipairs(getElementsByType("colshape")) do 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 do 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 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) setAccountData(vehicleManager, "tentamount", counterTent) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), saveallvehicles) Link to comment
UserToDelete Posted May 6, 2014 Share Posted May 6, 2014 Hola a todos el dia de hoy vengo con algo que me urge y demaciado ya busque 1,000 y 1 forma y nada por lo que investigue esta parte del codigo se encarga de guardarlas pero no lo hace alguna idea function saveallvehicles(ps, command) counter = 0 counterTent = 0 local vehicleManager = getAccount("vehicleManager", "ds4f9$") for i, col in ipairs(getElementsByType("colshape")) do 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 do 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 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) setAccountData(vehicleManager, "tentamount", counterTent) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), saveallvehicles) onResourceStop? No deberia ser "onPlayerQuit"? igual es por eso, la raazon por la que no se guarda Link to comment
Narutimmy Posted May 6, 2014 Author Share Posted May 6, 2014 Hola a todos el dia de hoy vengo con algo que me urge y demaciado ya busque 1,000 y 1 forma y nada por lo que investigue esta parte del codigo se encarga de guardarlas pero no lo hace alguna idea function saveallvehicles(ps, command) counter = 0 counterTent = 0 local vehicleManager = getAccount("vehicleManager", "ds4f9$") for i, col in ipairs(getElementsByType("colshape")) do 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 do 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 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) setAccountData(vehicleManager, "tentamount", counterTent) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), saveallvehicles) onResourceStop? No deberia ser "onPlayerQuit"? igual es por eso, la raazon por la que no se guarda nono, esque esto guarda las tiendas de campaña o los autos en el mapa por eso es en stop. Link to comment
Francko967 Posted May 18, 2014 Share Posted May 18, 2014 Amigo mio, esto es muy facil solo has esto, ./stop DayZ --> /shutdown y cuando lo vuelvas a abrir veras todo en su lugar Link to comment
Narutimmy Posted May 24, 2014 Author Share Posted May 24, 2014 Amigo mio, esto es muy facil solo has esto, ./stop DayZ --> /shutdown y cuando lo vuelvas a abrir veras todo en su lugar eso no funciona... el problema es que nose porque no hace el bakup, si lo ago en servidor local funciona pero si lo ago en host no. Link to comment
Tomas Posted May 24, 2014 Share Posted May 24, 2014 Amigo mio, esto es muy facil solo has esto, ./stop DayZ --> /shutdown y cuando lo vuelvas a abrir veras todo en su lugar eso no funciona... el problema es que nose porque no hace el bakup, si lo ago en servidor local funciona pero si lo ago en host no. Hay hosts que no admiten el GM DayZ ya que consume mucho ram, quizás sea eso. Link to comment
Narutimmy Posted May 24, 2014 Author Share Posted May 24, 2014 Amigo mio, esto es muy facil solo has esto, ./stop DayZ --> /shutdown y cuando lo vuelvas a abrir veras todo en su lugar eso no funciona... el problema es que nose porque no hace el bakup, si lo ago en servidor local funciona pero si lo ago en host no. Hay hosts que no admiten el GM DayZ ya que consume mucho ram, quizás sea eso. uso un VPS en NFOServers. Link to comment
Alexs Posted May 24, 2014 Share Posted May 24, 2014 Si el apagado es demasiado rápido, es decir, el servidor colapso o la maquina se apago, ese código no tendría el tiempo necesario para ser ejecutado. Link to comment
Narutimmy Posted May 25, 2014 Author Share Posted May 25, 2014 Si el apagado es demasiado rápido, es decir, el servidor colapso o la maquina se apago, ese código no tendría el tiempo necesario para ser ejecutado. en servidor local apago el resource DayZ me da log execution Dayz osea que esta usando muchos recursos porque esta guardando, pero en servidor nose porque no lo guarda. Link to comment
Tomas Posted May 27, 2014 Share Posted May 27, 2014 Te recomiendo usar IPB para saber si el recurso ocupa mucha CPU. Link to comment
Narutimmy Posted May 28, 2014 Author Share Posted May 28, 2014 Te recomiendo usar IPB para saber si el recurso ocupa mucha CPU. ya lo uso no consume mucho lo que consume son los slotoboth un 40% Link to comment
Recommended Posts