Members command problem
#5

Quote:
Originally Posted by PrO.GameR
Посмотреть сообщение
PHP код:
CMD:members(playeridparams[])
{
    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(playeridCOLOR_GRAD1"Вы ни где не состоите!");
    }
    
SendClientMessage(playerid0x059BD3AA"Члены организации Online:");
    new 
countmute 0;
    new 
findleader=0;
    foreach(new 
Player)
    {
        if ((
PlayerInfo[i][pMember] == teamnumber) && IsPlayerConnected(i))
        {
            
format(stringersizeof(stringer), "");
            
countmute++;
            if (
PlayerInfo[i][pLeader] == teamnumber&&findleader==0)
            {
                
format(stringersizeof(stringer), "[%d] %s ранг: Лидер {FFFFFF}"iNamePlayer[i]);
                
findleader++;
                
i=0;
            }
            else if (
PlayerInfo[i][pMember] == teamnumber&&findleader!=0)
            {
                
format(stringersizeof(stringer), "[%d] %s ранг: %d {FFFFFF}"iNamePlayer[i], PlayerInfo[i][pRank]);
            }
            if (
strlen(stringer) > 1)
            {
                
SendClientMessage(playerid0xC0E1EEFFstringer);
            }
        }
    }
    if (
countmute == 0)
    {
        
SendClientMessage(playeridCOLOR_GRAY"Нет игроков");
    }
    else
    {
        
SendMes(playeridCOLOR_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:
Reply


Messages In This Thread
Members command problem - by bigboy81 - 30.09.2015, 16:33
Re: Members command problem - by jihadmeneer - 30.09.2015, 20:55
Re: Members command problem - by bigboy81 - 30.09.2015, 22:20
Re: Members command problem - by PrO.GameR - 30.09.2015, 22:34
Re: Members command problem - by bigboy81 - 30.09.2015, 23:31
Re: Members command problem - by Sew_Sumi - 01.10.2015, 00:44
Re: Members command problem - by MD5 - 01.10.2015, 01:11
Re: Members command problem - by PrO.GameR - 01.10.2015, 09:16
Re: Members command problem - by bigboy81 - 01.10.2015, 11:01
Re: Members command problem - by Sew_Sumi - 01.10.2015, 15:24

Forum Jump:


Users browsing this thread: 3 Guest(s)