17.03.2013, 13:04
Quote:
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. |
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;
}