26.11.2016, 21:09
Creo que no hay forma desde PAWN, habria que realizar algun peque;o plugin. Existe forma si los archivos llevan un orden numerico facil de contar
PHP код:
stock countFiles(dir[] = '\0', type[] = "ini", get = 0)
{
new idx, str[MAX_FILE_NAME], c, last = gettime()+2, n;
if(dir[0] != '\0')
{
if(fexist(dir))
{
for( ; ; )
{
if(last < gettime())
break;
format(str, sizeof(str), "%s/%d.%s", dir, idx, type);
if(fexist(str)){
c++;
last = gettime()+2;
n = idx;
}
++idx;
}
}
}
return ((get == 0) ? (c) : (n));
}
PHP код:
total = countFiles("/vehiculos/", "ini", 0);