SA-MP Forums Archive
[DUDA]їComo usar foreach correctamente? - 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]їComo usar foreach correctamente? (/showthread.php?tid=527249)



[DUDA]їComo usar foreach correctamente? - chusothe41 - 21.07.2014

por ejemplo yo tengo esto
pawn Код:
for(new x; x<MAX_PLAYER_ATTACHED_OBJECTS; x++)
їComo lo pasaria a foreach?
pawn Код:
foreach (new x : Player)
No me funciona creo que es por lo de player... ni idea

PD: їHay algun procesador de bucles mas eficiente?


Re: [DUDA]їComo usar foreach correctamente? - Onfroi - 21.07.2014

pawn Код:
foreach(Player, x)



Respuesta: [DUDA]їComo usar foreach correctamente? - OTACON - 21.07.2014

foreach es para player y vehнculos, para lo demбs debes usar el bucle normal.
saludos.


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


Respuesta: [DUDA]їComo usar foreach correctamente? - JustBored - 21.07.2014

Quote:
Originally Posted by OTACON
Посмотреть сообщение
foreach es para player y vehнculos, para lo demбs debes usar el bucle normal.
saludos.


https://sampforum.blast.hk/showthread.php?tid=444059
Lee que funciones tiene y_iterate (foreach) antes de hablar.


Respuesta: [DUDA]їComo usar foreach correctamente? - OTACON - 21.07.2014

Quote:
Originally Posted by JustBored
Посмотреть сообщение
Lee que funciones tiene y_iterate (foreach) antes de hablar.
1- a ti no te hable.
2- lee bien para que se usa y_iterate.
3- para lo que quiere hacer no sirve.





Respuesta: [DUDA]їComo usar foreach correctamente? - DesingMyCry - 22.07.2014

Otacon... porfavor!

Lo que dice Just esta bien. Foreach no se limita a repeticiones de jugadores, vehнculos o bots...

Ya deberнas comenzar a demostrar los 12 aсos que tienes.



Re: [DUDA]їComo usar foreach correctamente? - chusothe41 - 22.07.2014

Estoy mas confuso ahora... se puede o no se puede optimizar loops de lo que quiera o solo de players vehicles etc?


Respuesta: [DUDA]їComo usar foreach correctamente? - Glimma - 22.07.2014

El foreach no es solamente un "foreach (new i : loquesea)", tiene muchas mбs funciones. Mediante iteraciones podйs lograr darle mбs usos.


Respuesta: [DUDA]їComo usar foreach correctamente? - OTACON - 22.07.2014

Quote:
Originally Posted by DesingMyCry
Посмотреть сообщение
Otacon... porfavor!

Lo que dice Just esta bien. Foreach no se limita a repeticiones de jugadores, vehнculos o bots...

Ya deberнas comenzar a demostrar los 12 aсos que tienes.
bueh.. ahora te interesan los niсos... incleible.

---------------------------

si se puede den un ejemplo...


Respuesta: [DUDA]їComo usar foreach correctamente? - JustBored - 22.07.2014

Quote:
Originally Posted by OTACON
Посмотреть сообщение
1- a ti no te hable.
2- lee bien para que se usa y_iterate.
3- para lo que quiere hacer no sirve.


1- Estas en un foro osea que cuando comentas el comentario se vuelve pъblico.
2- Creo que vos deberнas leer bien para que sirve y_iterate osea investiga antes de exponer un argumento invalido. Si te fijaras o conocieras y_iterate hay una funciуn qeu se llama Iter_Add y varias cosas mбs.
3- Sн que sirve para lo que el quiere hacer.