help members command
#1

Please fix to me that code
PHP код:
CMD:members(playeridparams[])
{
    new 
string[128], online;
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
PlayerInfo[playerid][pFac] && PlayerInfo[playerid][pFam]) return SendClientMessage(playeridCOLOR_GREY"You are not part of family/faction.");
    if(
PlayerInfo[playerid][pFac])
    {
        foreach(
Playeri)
        {
            if(
PlayerInfo[i][pFac] == PlayerInfo[playerid][pFac])
            {
                
online ++;
            }
        }
        
format(stringsizeof(string), "Online Faction Members: %d"online);
        
SendClientMessage(playeridCOLOR_ORANGEstring);
        foreach(
Playeri)
        {
            if(
PlayerInfo[i][pFac] == PlayerInfo[playerid][pFac])
            {
                if(
PlayerInfo[i][pFacLeader])
                {
                    if(
PlayerInfo[playerid][pFacLeader] && PlayerInfo[i][pFacDiv]) format(stringsizeof(string), "- ** Leader %s, Division:%s, Rank(%d): %s"RPN(i), RPFDN(i), PlayerInfo[i][pFacRank], RPFRN(i)); //[Leader][Division:][Chief(10)][name]
                    
else format(stringsizeof(string), "- [Leader] [%s (%d)] %s"RPFRN(i), PlayerInfo[i][pFacRank], RPN(i));
                    if(
PlayerInfo[playerid][pFac] == 3format(stringsizeof(string), "- [Leader] [%s (%d)] %s (Success: %d | Fail: %d)"RPFRN(i), PlayerInfo[i][pFacRank], RPN(i), PlayerInfo[i][pCSuccess], PlayerInfo[i][pCFail]);
                }
                else
                {
                    if(
PlayerInfo[playerid][pFacLeader] && PlayerInfo[i][pFacDiv]) format(stringsizeof(string), "- Member %s, Division:%s, Ranks(%d): %s"RPN(i), RPFDN(i), PlayerInfo[i][pFacRank], RPFRN(i));
                    else 
format(stringsizeof(string), "- [%s (%d)] %s"RPFRN(i), PlayerInfo[i][pFacRank], RPN(i));
                    if(
PlayerInfo[playerid][pFac] == 3format(stringsizeof(string), "- [%s (%d)] %s (Success: %d | Fail: %d)"RPFRN(i), PlayerInfo[i][pFacRank], RPN(i), PlayerInfo[i][pCSuccess], PlayerInfo[i][pCFail]);
                }
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            }
        }
    }
    if(
PlayerInfo[playerid][pFam])
    {
        
online 0;
        foreach(
Playeri)
        {
            if(
PlayerInfo[i][pFam] == PlayerInfo[playerid][pFam])
            {
                
online ++;
            }
        }
        
format(stringsizeof(string), "Online Family Members: %d"online);
        
SendClientMessage(playeridCOLOR_ORANGEstring);
        foreach(
Playeri)
        {
            if(
PlayerInfo[i][pFam] == PlayerInfo[playerid][pFam])
            {
                
format(stringsizeof(string), "- [%s (%d)] %s"RPFaRN(i), PlayerInfo[i][pFamRank], RPN(i));
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            }
        }
    }
    return 
1;

If someone who is not in faction and is only Family members want to do it can not because it gives only to players that they are in faction,
Reply
#2

What is PlayerInfo[playerid][pFam]?
Reply
#3

PlayerInfo[playerid][pFam] = 0;
Reply
#4

Try changing
pawn Код:
if(!PlayerInfo[playerid][pFac] && PlayerInfo[playerid][pFam]) return SendClientMessage(playerid, COLOR_GREY, "You are not part of family/faction.");
With
pawn Код:
if(!PlayerInfo[playerid][pFac] || !PlayerInfo[playerid][pFam]) return SendClientMessage(playerid, COLOR_GREY, "You are not part of family/faction.");
Reply
#5

But, what is the bug here?
Reply
#6

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
But, what is the bug here?
....
Quote:
Originally Posted by V1Su4L
Посмотреть сообщение
If someone who is not in faction and is only Family members want to do it can not because it gives only to players that they are in faction,
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)