[DUDA] їContar archivos con Y_INI? Otro? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [DUDA] їContar archivos con Y_INI? Otro? (
/showthread.php?tid=622716)
[DUDA] їContar archivos con Y_INI? Otro? -
yesidpte - 25.11.2016
ЎBuenas!
Mi duda es: їSe pueden contar archivos de una carpeta de scriptfiles creados por Y_INI? Es decir, contar cuantos archivos existen creados por el mismo include.
Si esto no es posible: їAlguno forma de contar archivos de una carpeta de scriptfiles? їPlugin? їCual?
Gracias de ante mano.
Re: [DUDA] їContar archivos con Y_INI? Otro? -
yesidpte - 26.11.2016
їAlguien?
Respuesta: [DUDA] їContar archivos con Y_INI? Otro? -
Z0MBERTH - 26.11.2016
Obviamente es posible con un cуdigo interno. No hay necesidad de plugins y esas tonterнas. Suerte
TIPS: їHas cargado algo como casas, negocios?, bueno algo asн.
Respuesta: [DUDA] їContar archivos con Y_INI? Otro? -
Zume - 26.11.2016
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);