Forum

> > CS2D > Scripts > How to save tables
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How to save tables

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt How to save tables

The Smoker
User Off Offline

Zitieren
Hello, I'm developing a script, however I am newbie in LUA.
This script has two factions, but I want the player to create his own faction with the "f_create <name>". Okay, I did it.
Factions are on a table and when I create a new faction with the "f_create" the script creates a sub-table with all the information. Look at this.

Spoiler >


My question is how can I save the sub-tables that players create, so that when the server open again they are loaded.

alt Re: How to save tables

Louie
User Off Offline

Zitieren
Try using io.open, io.close, io.write. Save the values of the tables to a file then load those values again the next time the server starts.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht