Way to list all registered players in a dialog list
#1

Is there any way to make a dialog list which shows every registered player (from scriptfiles/Users)?
Reply
#2

Quote:
Originally Posted by Darkwood17
Посмотреть сообщение
I want to make a dialog list which shows every registered user (from scriptfiles/Users) to a dialog list and when I click on someone to show for example is he muted.
I don't think there is anyway you can list all files in a folders... so this is impossible.
Reply
#3

You can using a plugin such as:
https://sampforum.blast.hk/showthread.php?tid=92246

Using that plugin you'd want to use something such as dir_list.

However this isn't efficient, and a SQL system is highly recommended for this type-of-situation.
Reply
#4

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
I don't think there is anyway you can list all files in a folders... so this is impossible.
Ehmm..?

FileManager
Код:
native dir:dir_open(directory[]);
native dir_close(dir:handle);
native dir_list(dir:handle, storage[], &type, length = sizeof(storage));
EDIT: Perhaps I had this tab open longer than I thought, Abagail beat me to it. Like Abagail said, a SQL system is better than saving user files for each player.
Reply
#5

It's possible either by using FileManager or y_files plugin, according to y_files method:
pawn Код:
new i = 0, str[32], pathStr[64];
while(ffind("Users/*.ini", str, sizeof(str), i)) //Loop through every files inside "Users" folder having .ini extension.
{
    format(pathStr, sizeof(pathStr), "Users/%s.ini", str); //pathStr now contains the player file path.
}
Though, like others stated, I suggest converting your codes to SQL version. For converting the current data, you can use applications like INI->MySQL converter by gtakillerIV. (Link - https://sampforum.blast.hk/showthread.php?tid=510959)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)