Jump to content

global variable that would not be deleted after rebooting the server


undvoice

Recommended Posts

Friends, hello everyone, my name is Kirill, I am developing mods in Russia for project zomboid, I had a question, I can not figure out how I could create a global variable that would not be deleted after rebooting the server. You can prompt or throw off the instructions.

Link to comment
Share on other sites

6 hours ago, Dr_Cox1911 said:

You could either use ModData (depending an the things you want to persist) or IMHO easier write a file, for example in Zomboid/Lua or your mod-folder.

 

Thank you for responding. After three days of reading the developer scripts, I realized that ModData would help me, but unfortunately I didn’t quite figure out how to work with them, is there an instruction somewhere or something like that? I figured out how to record a file, but it doesn’t really fit me, because the file is created on the client, and my mod is designed for multiplayer.

Link to comment
Share on other sites

Never really used ModData myself.

 

As for your file problem: You can write files on the server, you just have to execute your write command in a function that is executed by the server.

I only read on my mods on the server side, but you would just have to switch the read to a write.

 

You can either look at my mod CoxisShop or CoxisReloadSync for this. CoxisShop uses my other mod CoxisUtil now to read the file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...