SA-MP Forums Archive
Need help with getting file name to string - 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: Need help with getting file name to string (/showthread.php?tid=302104)



Need help with getting file name to string - titanak - 07.12.2011

Hello , i got .ini files in the folder . and i wanna get all the file names from the folder to the string.

i writed some random test code , i am a little bit beginner of it and i am stuck on it

can someone help me to fix this stupid code ?

reping too who helps , thanks.

pawn Код:
new kFile[256];
    new string235[2012];
   
    for(new i; i < MAX_RACES; i ++)
    {
    format(kFile, sizeof(kFile), "/initest/%s.ini", RaceListName[i]);
   
    while(strcmp(RaceListName[i]))
    {
    strcat(string235, RaceListName[i], sizeof(string235));
    }
   
    }
   
    ShowPlayerDialog(playerid,10729,DIALOG_STYLE_MSGBOX,"Ini Names",string235,"Close","");



Re: Need help with getting file name to string - titanak - 07.12.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
The only way to list the files in a directory (well, not the only way, but the only way that doesn't hang your PC for several hours) is using a plugin such as y_files:

https://sampforum.blast.hk/showthread.php?tid=177028

If you follow the chain of links (I should really fix that), you end up here for an example:

https://sampforum.blast.hk/showthread.php?tid=60282
you mean y_ini ?


Re: Need help with getting file name to string - titanak - 07.12.2011

i just only need to load like 3-10 files , i dont think it is going to lagg the server