A few problem
#1

How do I search on a folder? as I did:

pawn Код:
#define local "system/%d.ini"
It's the folder/file directory. And you can search for vehicles or players:
pawn Код:
for(new v; v < MAX_VEHICLES; v++)
for(new v; v < MAX_PLAYERS; v++)

But how do I do that for those files? such as:
pawn Код:
for(new v; v < MAX_FILES; v++)
Reply
#2

you could try to create all possible string combinations and check if they exist with fexist
But this would be an immense effort which could be done with some plugins on an easier way

But I think these plugins arent needed since you know how the file is called
You only need a pattern so the script can recognize them
Reply
#3

Give me a example, please.
Reply
#4

lets say you search for a player file, than you use some pattern for like like PlayerName.txt
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
strcat(name, ".txt", MAX_PLAYER_NAME);
if(fexist(name)) {}
or you got some maps and dont know if the map exist
pawn Код:
new name[16];
format(name, sizeof name, "Map_%d.txt", mapid);
if(fexist(name)) {}
or just tell me why you need to search in a folder for some random files?

If you want to create a command which list all registered players as example
Than you only need to create an extra file which stores all names
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)