07.03.2016, 15:40
Quote:
I'd make this completely without files (at least during runtime).
Make an array for the richest players (size of 10 for example) and store playernames and the according money inside it. Then you can occasionally check if any player has more money as anyone else in that list and put him in accordingly. Then load/save it from/to a file in OnGameModeInit/Exit. Doing this with files during runtime has many drawbacks. You have to either use a file system (like y_ini) which is generally slower for this application or re-write the whole file if the order changes (which can be very often if you have many rich players online). The array lets u just switch two entries (or more if you need to reorder) and it's a LOT faster. |