Quote:
Originally Posted by PrO.GameR
PHP код:
CMD:members(playerid, params[])
{
new stringer[213];
new teamnumber;
if (PlayerInfo[playerid][pLeader] != 0)
{
teamnumber = PlayerInfo[playerid][pLeader];
}
else if (PlayerInfo[playerid][pMember] != 0)
{
teamnumber = PlayerInfo[playerid][pMember];
}
else
{
return SendClientMessage(playerid, COLOR_GRAD1, "Вы ни где не состоите!");
}
SendClientMessage(playerid, 0x059BD3AA, "Члены организации Online:");
new countmute = 0;
new findleader=0;
foreach(new i : Player)
{
if ((PlayerInfo[i][pMember] == teamnumber) && IsPlayerConnected(i))
{
format(stringer, sizeof(stringer), "");
countmute++;
if (PlayerInfo[i][pLeader] == teamnumber&&findleader==0)
{
format(stringer, sizeof(stringer), "[%d] %s ранг: Лидер {FFFFFF}", i, NamePlayer[i]);
findleader++;
i=0;
}
else if (PlayerInfo[i][pMember] == teamnumber&&findleader!=0)
{
format(stringer, sizeof(stringer), "[%d] %s ранг: %d {FFFFFF}", i, NamePlayer[i], PlayerInfo[i][pRank]);
}
if (strlen(stringer) > 1)
{
SendClientMessage(playerid, 0xC0E1EEFF, stringer);
}
}
}
if (countmute == 0)
{
SendClientMessage(playerid, COLOR_GRAY, "Нет игроков");
}
else
{
SendMes(playerid, COLOR_YELLOW, "Всего: %d человек", countmute);
}
return true;
}
Haven't really worked with foreach, but this should work, try it.
|
No, now doesn't show anything under Online Members: