Some help.
#5

This would do it :
pawn Код:
CMD:families(playerid, params[])
{
    new string[128], familyid;
    new family = PlayerInfo[playerid][pFMember];
        if(family == 255) {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not part of a family!");
        return 1;
    }
   
    if(sscanf(params, "d", familyid))
    {
        new number = 0;
        for(new i = 0; i < sizeof(FamilyInfo); i++)
        {
            number ++;
            if(FamilyInfo[i][FamilyTurfTokens] < 12)
            {
                format(string, sizeof(string), "Family %d | Name: %s | Leader: %s | Members: %d | Claim Tokens: 0.",number,FamilyInfo[i][FamilyName],FamilyInfo[i][FamilyLeader],FamilyInfo[i][FamilyMembers]);
            }
            else
            {
                format(string, sizeof(string), "Family %d | Name: %s | Leader: %s | Members: %d | Claim Tokens: %d.",number,FamilyInfo[i][FamilyName],FamilyInfo[i][FamilyLeader],FamilyInfo[i][FamilyMembers],FamilyInfo[i][FamilyTurfTokens]/12);
            }
            SendClientMessageEx(playerid, COLOR_WHITE, string);
        }
        return 1;
    }

    if(familyid < 1 || familyid > MAX_FAMILY) { SendClientMessageEx(playerid, COLOR_GREY, "Family slot must be between 1 and 14."); return 1; }
    familyid -= 1;
    if(FamilyInfo[familyid][FamilyTaken] != 1)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "That family slot is empty.");
        return 1;
    }
    foreach(Player, i)
    {

            if(PlayerInfo[i][pRank] == 1)
            {
                format(string, sizeof(string), "* %s: %s | Rank: %s (1).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank1]);
            }
            else if(PlayerInfo[i][pRank] == 2)
            {
                format(string, sizeof(string), "* %s: %s | Rank: %s (2).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank2]);
            }
            else if(PlayerInfo[i][pRank] == 3)
            {
                format(string, sizeof(string), "* %s: %s | Rank: %s (3).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank3]);
            }
            else if(PlayerInfo[i][pRank] == 4)
            {
                format(string, sizeof(string), "* %s: %s | Rank: %s (4).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank4]);
            }
            else if(PlayerInfo[i][pRank] == 5)
            {
                format(string, sizeof(string), "* %s: %s | Rank: %s (5).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank5]);
            }
            else if(PlayerInfo[i][pRank] == 6)
            {
                format(string, sizeof(string), "* %s: %s | Rank: %s (6).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank6]);
            }
            else
            {
                format(string, sizeof(string), "* %s: %s | Rank: %s.",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank1]);
            }
            SendClientMessageEx(playerid, COLOR_GREY, string);

    }
    return 1;
}
Reply


Messages In This Thread
Some help. - by aDo7 - 27.01.2014, 18:20
Re: Some help. - by aDo7 - 27.01.2014, 19:55
Re: Some help. - by Joe Vagos - 27.01.2014, 20:00
Re: Some help. - by erminpr0 - 27.01.2014, 20:06
Re: Some help. - by Drago987 - 27.01.2014, 20:08
Re: Some help. - by aDo7 - 29.01.2014, 11:35

Forum Jump:


Users browsing this thread: 2 Guest(s)