[Off] O foreach realmente funciona?
#10

Quote:
Originally Posted by Mr.Hardy
Посмотреть сообщение
Mais tipo imaginamos que existem 5 jogadores online. Com o ID 0,1,2,3,4,5. e Sai o numero 3 e 4, o Loop irб ser de 3 jogadores atingindo os jogadores 0,1,2 e esquecendo o jogador ID 5.

O sistema de foreach funciona deste mйtodo:

Connect: +player
Disconnect: -player

Й uma soma, em que o loop й feito em base da soma.
Nгo й simplesmente incremento e descremento de uma variбvel, й a adiзгo/remoзгo de um ID a uma variбvel.
Estude mais profundamente cada funзгo e entenderб que o que vocк diz nгo faz sentido.

pawn Код:
public OnPlayerConnect(playerid)
    {
        P:0("Iter_OnPlayerConnect: %d", playerid);
        #if defined _FOREACH_BOT
            if (!IsPlayerNPC(playerid))
            {
                Itter_Add(Player, playerid);
            }
            #if !defined FOREACH_NO_BOTS
                else
                {
                    Itter_Add(Bot, playerid);
                }
                #pragma tabsize 4
                Itter_Add(Character, playerid);
            #endif
        #else
            Itter_Add(Player, playerid);
        #endif
        if (YSI_g_sCallbacks & 2)
        {
            CallLocalFunction(YSI_gsOnPlayerConnect, YSI_gsSpecifier@i, playerid);
        }
        P:0("Iter_OnPlayerConnect end");
        return 1;
    }
Reply


Messages In This Thread
O foreach realmente funciona? - by Mr.Hardy - 17.03.2013, 04:37
Re: O foreach realmente funciona? - by Sky™ - 17.03.2013, 04:58
Re: O foreach realmente funciona? - by Gii - 17.03.2013, 05:01
Re: O foreach realmente funciona? - by Mr.Hardy - 17.03.2013, 05:02
Re: O foreach realmente funciona? - by Sky™ - 17.03.2013, 05:17
Re: O foreach realmente funciona? - by Mr.Hardy - 17.03.2013, 05:21
Re: O foreach realmente funciona? - by Sky™ - 17.03.2013, 05:24
Re: O foreach realmente funciona? - by Mr.Hardy - 17.03.2013, 05:38
Re: O foreach realmente funciona? - by Maklister - 17.03.2013, 05:48
Re: O foreach realmente funciona? - by CyNiC - 17.03.2013, 13:04

Forum Jump:


Users browsing this thread: 12 Guest(s)