Hello,
I am pretty new to OO languages and I am spending some time when it's available to progress my learning, I am creating a plugin that I thought was working but the variable only seems to update once. I'm guessing it's because it's being declared once at startup but I don't know the OO way of doing it.
How would I update the variable before each save?
Code:class EntityCounter : RustPlugin { private int EntityCount = BaseNetworkable.serverEntities.Count; private int MaxEntity = 250000; void OnServerSave() { int Remaining = MaxEntity - EntityCount; if (EntityCount < MaxEntity){ PrintToChat("Total Entities : {0}, Wipe @ {1}. Remaining Entities to go {2}", } else { PrintToChat("Entity Limit Reached! Admin will be wiping soon."); } } }
Solved Trouble updating a variable (wrong scope)
Discussion in 'Rust Development' started by Nathan 3, Dec 4, 2016.
-
Wulf Community Admin
The hook is just a trigger that gets called, it wouldn't be your issue.
-
-
Wulf Community Admin
-