Show files inside script files folder in game
#1

Hello, I want a plugin or something to show or list the .ini files inside scriptfiles when I type a command
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=92246
Reply
#3

That worked thanks but I need to use it without .ini so it doesn't show .ini just the file name
Reply
#4

You can remove the "ini" from the string using strdel, or by using common functions(user-made) such as strreplace.

https://sampforum.blast.hk/showthread.php?tid=85697 may help you.
Reply
#5

Ok but the file manager returns only one file but I want it to return all existing files
Reply
#6

How to loop this so it lists all files inside the folder?

pawn Code:
CMD:listfactions(playerid, params[])
{
    new dir:dHandle = dir_open("./scriptfiles/Groups/");
    new item[40], type, string[128];
       
    while(dir_list(dHandle, item, type))
    {
        strdel(item, strfind(item, ".ini"), strlen(item));
        format(string, sizeof(string), "Files: %s.", item);
        if(type == 2) return SendClientMessage(playerid, -1, string);
    }  
    dir_close(dHandle);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)