Action How to add server save!

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
So, place this at bottom of global.lua:
PHP:
saveDelay = 10 * 60 * 1000 -- 10 minutes for each save. 
storageValue = 2342 

if (getGlobalStorageValue(storageValue) == -1) then 
    function save(saveDelay) 
        saveData() 
        debugPrint(">>>>PLAYERS SAVED<<<<") 
        addEvent(save, saveDelay, saveDelay) 
    end 
    addEvent(save, saveDelay, saveDelay) 
    setGlobalStorageValue(storageValue, 1) 
end
And just change the delay of each save, and you're done ;)

If it doesn't work, place it in data/actions/lib/actions.lua instead!

Gimme rep if you like/use it plx :D
 
Last edited:

AnDy1990

New Member
Joined
Mar 6, 2008
Messages
104
Best answers
0
Reaction score
0
I got alloot of buggs when adding this to 0.2.10

all got debugg if they used mana potions etc.

got theese condition errors. cant say them exatly because I had to restart the server right away.
 

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,667
Best answers
202
Reaction score
1,375
Location
Norway, Oslo
This dosnt seem to work propherly on TFS 0.2.10
 

Kedor

New Member
Joined
Mar 3, 2008
Messages
263
Best answers
0
Reaction score
0
Location
Poland, Gdynia
its working good when you are using console :p
and when i compiled the gui it started to make some weird problems :p
but on gui you got "save online players" button :p sooo you dont need that then :D
 

AnDy1990

New Member
Joined
Mar 6, 2008
Messages
104
Best answers
0
Reaction score
0
its working good when you are using console :p
and when i compiled the gui it started to make some weird problems :p
but on gui you got "save online players" button :p sooo you dont need that then :D
Im using console, but seems like the sever went crazy when I added it.
 

Saj

Remember my name
Joined
Feb 26, 2008
Messages
2,127
Best answers
0
Reaction score
5
It worked on my server, This is great, Thanks!
 
OP
Colandus

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
If it doesn't work, place it in data/actions/lib/actions.lua instead!
 
OP
Colandus

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
Did you wait 10 minutes first?
 
OP
Colandus

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
Hmm... :S

Did you really place it in global.lua etc? ^.- It's wierd it doesn't work...
Try in data/actions/lib/actions.lua instead... Might work if you're lucky!
 

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,833
Best answers
0
Reaction score
184
It didnt print out in GUI but it has been saving the game for me.
Although, Im using the one in C++ :p
 

Keraxel

Ω Obfuscator Ω
Joined
Feb 2, 2008
Messages
941
Best answers
0
Reaction score
5
Location
Republic of Poland
I placed it in global.lua and in data/actions/lib/actions.lua, but it doesn't solve problem.
@up: thanks for info
 
Last edited:
Top