SA-MP Forums Archive
Fastest Method of doing reading files - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Fastest Method of doing reading files (/showthread.php?tid=473953)



Fastest Method of doing reading files - ||123|| - 05.11.2013

I have a script that saves a player's notes in a new file called 'notes.ini'. I load the Files everytime the player types /notes to view them. There are 10 slots, each notes containing 20 arrays for the text.

Question is that loading notes.ini everytime a players types /notes can be slow. What can be the best way to work my code? If I make a new variable such as new PlayerNotes[MAX_PLAYERS][10][20] and only load notes.ini only once when a player spawns and save it in the variable I stated above. Will this be the best way to go for? Or do I have any other options aswell?

2nd Question:
I have 2 more player files like notes.ini for every player that requires the same amount of arrays and variables and requires to get called everytime a user tries to access it. Will this cause too much lag?

Thank you.


Re: Fastest Method of doing reading files - AlonzoTorres - 05.11.2013

Writing to ini files should only be done for saving and loading.


Re: Fastest Method of doing reading files - ||123|| - 05.11.2013

Can you atleast be a little brief?