SA-MP Forums Archive
Question: - 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: Question: (/showthread.php?tid=380049)



Question: - Penki4a - 23.09.2012

Hello,i want to ask is there a way to loop through all players?I mean offline players too.


Re: Question: - clarencecuzz - 23.09.2012

I highly doubt it, the only possible way I can think of doing it, is if you're saving each user's file to a number instead of their actual name.


Re: Question: - mamorunl - 23.09.2012

If you are working with a mysql database it will be very easy since you just have to loop through your table.
In files it'd be a little bit harder (if you want to get info on the player instead of just their names) because you'd have to open each file.


Re: Question: - Penki4a - 23.09.2012

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
If you are working with a mysql database it will be very easy since you just have to loop through your table.
In files it'd be a little bit harder (if you want to get info on the player instead of just their names) because you'd have to open each file.
Unfortunately i am not so advanced of a scripter and i am using Dini.


Re: Question: - clarencecuzz - 23.09.2012

In that case, don't even attempt it.


Re: Question: - mamorunl - 24.09.2012

Quote:
Originally Posted by Penki4a
Посмотреть сообщение
Unfortunately i am not so advanced of a scripter and i am using Dini.
DINI is a pretty old system already and was developed for 0.2 I'd recommend changing your file system to either DJSON (also from DracoBlue) or even MySQL which will be better in your case if you want to do tasks like this.

Else, you would have the task of going through every file and finding the information you want.