• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua How do I know if the storage is already in use?

  • Thread starter Deleted member 141899
  • Start date
D

Deleted member 141899

Guest
It is the same question of the title, How do I know if the storage is already in use, so as not to conflict? >.<

In my global server i have a lot of storages and i cant check all..
 
It is the same question of the title, How do I know if the storage is already in use, so as not to conflict? >.<

In my global server i have a lot of storages and i cant check all..

You can probbly print out everything if you change smth in the source code, but that would be pretty annoying to do everytime you need to find a free storage.
Thats is why ORTS uses this:
https://github.com/orts/server/blob/master/data/Storages-Aid-Uid Used.txt
https://github.com/orts/server/blob/master/data/lib/miscellaneous/051-storages.lua
 
You should keep track of them, alternately have a function they go through, that logs eventual, new storage ids, but it's probably easier to keep track of them by writing them them once used.

You could use a simple text editor like Sublime to search through your whole project for "500012", or what ever it is, or for more unique search matches something like "getStorageValue(500012)", you could play around with it.

Ignazio
 
Back
Top