[HELP] loop - 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: [HELP] loop (
/showthread.php?tid=281396)
[HELP] loop -
omer5198 - 05.09.2011
i want to create a loop that works on someone that is in game and not in game... - i want to change something in dini to
all the players... the login ones and the not connected... is it possible?
Re: [HELP] loop -
omer5198 - 06.09.2011
anyone?
Re: [HELP] loop -
Jack_Leslie - 06.09.2011
Don't think it's possible.. depends on the file system, but I don't think it is possible.
Re: [HELP] loop -
TheLazySloth - 06.09.2011
Deleted xD
Re: [HELP] loop -
Ash. - 06.09.2011
It is possible, just not -practical.
You need to store EVERY player name thats ever connected in a file, with their 'ini key' being a number that's in sequence with the last (so 0, 1, 2, 3 etc). You then need to store the total registered players in the same, or another file.
Then you can simply do:
pawn Код:
new file[8+24+4], key[2];
for(new i; i < YOUR-TOTAL-ACCOUNT-COUNT; i++)
{
format(key, sizeof(key), "%i", i);
format(file, sizeof(file); "accounts/%s.ini", dini_Get("account-list.ini", key));
//Do your actions to the account file, the variable is named file!
}
Enjoy!
Re: [HELP] loop -
TheLazySloth - 06.09.2011
But dini is a slow loading system and a server with 2000+ accounts will crash the server eventually.
Re: [HELP] loop -
Ash. - 06.09.2011
Quote:
Originally Posted by TheLazySloth
But dini is a slow loading system and a server with 2000+ accounts will crash the server eventually.
|
Exactly why it's not practical.
(Although, when I was using dini to do what my first post on this thread said, it counted around 3000 accounts and never crashed, but lagged like hell whenever I tried to act on all account!)
Re: [HELP] loop -
TheLazySloth - 06.09.2011
=] The best way to updates every single player (connected/offline) is by using MySQL as your saving/loading system. But be aware of big sring sizes, the bigger the sizes to more you risk crashing your server still.
Re: [HELP] loop -
[HiC]TheKiller - 06.09.2011
My recommendation would be to ditch dini and use SQLite / MySQL.