SA-MP Forums Archive
help members command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help members command (/showthread.php?tid=554134)



help members command - V1Su4L - 02.01.2015

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,


Re: help members command - ATGOggy - 02.01.2015

What is PlayerInfo[playerid][pFam]?


Re: help members command - V1Su4L - 02.01.2015

PlayerInfo[playerid][pFam] = 0;


Re: help members command - Facerafter - 02.01.2015

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.");



Re: help members command - ATGOggy - 02.01.2015

But, what is the bug here?


Re: help members command - Facerafter - 02.01.2015

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,