Portal SAMP
[Ajuda] Loop ler somente matizes especificas - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Loop ler somente matizes especificas (/showthread.php?tid=400)



Loop ler somente matizes especificas - zBL4CK - 28/11/2020

eae galera beleza 

bom queria sabe como faz para o loop ler somente arrays especificas ex:

new Text:textdraw[21];

quero que o loop leia somente a array

textdraw[3]
textdraw[6]
textdraw[8]
textdraw[14]
textdraw[16]
textdraw[20]

se alguem ajudar agradeço muito


RE: Loop ler somente matizes especificas - SkolPlay - 28/11/2020

Tente assim:

Código PHP:
new Text:textdraw[6];

textdraw[0];
textdraw[1];
textdraw[2];
textdraw[3];
textdraw[4];
textdraw[5]; 



RE: Loop ler somente matizes especificas - Dr Editor - 30/11/2020

Código PHP:
new Text:textdraw[21];
new 
validIndex[] = { 368141620 };

for(new 
idx 0idx sizeof(textdraw); idx ++)
{
    for(new 
idx2 0idx2 sizeof(validIndex); idx2 ++)
    {
        if(
idx == validIndex[idx2])
        {
            
// Index válido
        
}
    }