What's new

Problem z save i clena help

KeBereK

Active User
Joined
Oct 9, 2009
Messages
84
Reaction score
0
Witam mam taki problem ze save i clena robi si? co chwile bez przerwy niewiem co jest nie tak dlatego prosz? was o pomoc.

tu jest globalevents.xml

<?xml version="1.0" encoding="UTF-8"?>
<globalevents>
<globalevent name="save" interval="1730" event="script" value="save.lua"/>
<globalevent name="clean" interval="28800" event="script" value="clean.lua"/>

tu save.lua

local config = {
broadcast = "no"
}

config.broadcast = getBooleanFromString(config.broadcast)
local function executeSave(seconds)
if(seconds == 0) then
doSaveServer()
return true
end

if(seconds == 120 or seconds == 30) then
doBroadcastMessage("Full server save within " .. seconds .. " seconds, please stay in safe place!")
end

seconds = seconds - 30
if(seconds >= 0) then
addEvent(executeSave, 30 * 1000, seconds)
end
end

function onThink(interval, lastExecution, thinkInterval)
if(not config.broadcast) then
doSaveServer()
doBroadcastMessage("Server saved")
return true
end

executeSave(120)
return true
end

a tu clena.lua

function executeClean()
doCleanMap()
doBroadcastMessage("Game map cleaned, next clean in 4 hours.")
return true
end

function onThink(interval, lastExecution, thinkInterval)
doBroadcastMessage("Game map cleaning within 60 seconds, please pick up your items!")
addEvent(executeClean, 60000)
return true
end

za pomoc dam repucika
 

Bledis

New User
Joined
Feb 5, 2010
Messages
9
Reaction score
0
Odp: Problem z save i clena help

Masz wklej to do clean.lua

function executeClean()
doCleanMap()
doBroadcastMessage("Game map cleaned, next clean in 2 hours.")
return true
end

function onThink(interval, lastExecution, thinkInterval)
doBroadcastMessage("Game map cleaning within 30 seconds, please pick up your items!")
addEvent(executeClean, 30000)
return true
end


A to do save.lua

local config = {
broadcast = {120, 30},
shallow = "no",
delay = 120,
events = 30
}

config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)
if(isInArray(config.broadcast, seconds)) then
local text = ""
if(not config.shallow) then
text = "Full s"
else
text = "S"
end

text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
doBroadcastMessage(text)
end

if(seconds > 0) then
addEvent(executeSave, config.events * 1000, seconds - config.events)
else
doSaveServer(config.shallow)
end
end

function onThink(interval, lastExecution, thinkInterval)
if(table.maxn(config.broadcast) == 0) then
doSaveServer(config.shallow)
else
executeSave(config.delay)
end

return true
end


Mam nadzieje ze pomog?em ;)
 

KeBereK

Active User
Joined
Oct 9, 2009
Messages
84
Reaction score
0
Odp: Problem z save i clena help

Nie Pomog?o dalej jest ten sam problem ci?gle sie serwer zapisuje nie jest to problem w globalevents.xml? jak tak to jak to ustawi?.

> Broadcasted message: "Full server save within 120 seconds, please mind it may freeze!".
> Broadcasted message: "Full server save within 120 seconds, please mind it may freeze!".
> Broadcasted message: "Full server save within 120 seconds, please mind it may freeze!".
> Broadcasted message: "Full server save within 120 seconds, please mind it may freeze!".
 

texon I

User
Joined
Oct 20, 2009
Messages
24
Reaction score
4
Age
29
Odp: Problem z save i clena help

Masz to wszystko w globalevents.xml
<globalevent name="clean" interval="2200" event="script" value="clean.lua"/>


<globalevent name="save" interval="3200" event="script" value="save.lua"/>

I wklej interval jest to czas liczony w sekundach najlepiej sobie sam przestaw.
 

KeBereK

Active User
Joined
Oct 9, 2009
Messages
84
Reaction score
0
Odp: Problem z save i clena help

Ustawi?em tak jak ty mi tu pokaza?es i ciagle jest tak samo co 1sec sie zapisuje i jest clena szukam dalej pomocy.
 

Jazper

Advanced User
Joined
Nov 22, 2009
Messages
448
Reaction score
31
Odp: Problem z save i clena help

//sorki ale mam taki sam problem ;/ identyczny jest to tfs 0.4 i o ile siie nie myl? interval="3200" jest w mili sekundach i powinno sie to mnozyc przez wartosc w skrypcie, ale sie nie mnozy ;/

// prosze o pomoc ;/
 

wilus94

Advanced User
Joined
Jun 7, 2009
Messages
189
Reaction score
7
Odp: Problem z save i clena help

Ja mam ten sam problem z tfs 0.4 dev lottery systemem gdzie daje item co 3 sec i powinno byc save jak np wylacza sie silnik ;/
 

zmudzix

Advanced User
Joined
Mar 13, 2009
Messages
372
Reaction score
10
Odp: Problem z save i clena help

elo w tfs 0.4 jest to taki s?awny b??d i aby dzia?a?o poprawnie razy 60 trzeba to pomno?y? co masz napisane w intervinal i powinno zadzia?a? ja tak samo mia?em
 

andy1995

Senior User
Joined
Apr 12, 2009
Messages
602
Reaction score
100
Odp: Problem z save i clena help

Sproboj dopisac po 2 zera do kazdego intervala
 
Top