y_ini search
#7

Quote:
Originally Posted by NaS
Посмотреть сообщение
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.
I kinda do get the idea of your point, but can you give a little explenation in code?
Reply


Messages In This Thread
y_ini search - by nerovani - 07.03.2016, 10:13
Re: y_ini search - by saffierr - 07.03.2016, 11:36
Re: y_ini search - by DRIFT_HUNTER - 07.03.2016, 11:44
Re: y_ini search - by MicroKyrr - 07.03.2016, 11:48
Re: y_ini search - by nerovani - 07.03.2016, 11:54
Re: y_ini search - by NaS - 07.03.2016, 12:03
Re: y_ini search - by saffierr - 07.03.2016, 15:40
Re: y_ini search - by NaS - 07.03.2016, 16:21
Re: y_ini search - by saffierr - 07.03.2016, 18:42

Forum Jump:


Users browsing this thread: 2 Guest(s)