global variable that would not be deleted after rebooting the server
0

4 posts in this topic

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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
0