Some help.
#1

Hello Guys,
i would like to add some text to make players who're no member inside family, can't use cmd:families..

Here's the Commands:


PHP код:
CMD:families(playeridparams[])
{
    new 
string[128], familyid;
    if(
sscanf(params"d"familyid))
    {
        new 
number 0;
        for(new 
0sizeof(FamilyInfo); i++)
        {
            
number ++;
               if(
FamilyInfo[i][FamilyTurfTokens] < 12)
            {
                
format(stringsizeof(string), "Family %d | Name: %s | Leader: %s | Members: %d | Claim Tokens: 0.",number,FamilyInfo[i][FamilyName],FamilyInfo[i][FamilyLeader],FamilyInfo[i][FamilyMembers]);
            }
            else
            {
                
format(stringsizeof(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(playeridCOLOR_WHITEstring);
        }
        return 
1;
    }
    if(
familyid || familyid MAX_FAMILY) { SendClientMessageEx(playeridCOLOR_GREY"Family slot must be between 1 and 14."); return 1; }
    
familyid -= 1;
    if(
FamilyInfo[familyid][FamilyTaken] != 1)
    {
        
SendClientMessageEx(playeridCOLOR_GREY"That family slot is empty.");
        return 
1;
    }
    foreach(
Playeri)
    {
            if(
PlayerInfo[i][pRank] == 1)
            {
                
format(stringsizeof(string), "* %s: %s | Rank: %s (1).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank1]);
            }
            else if(
PlayerInfo[i][pRank] == 2)
            {
                
format(stringsizeof(string), "* %s: %s | Rank: %s (2).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank2]);
            }
            else if(
PlayerInfo[i][pRank] == 3)
            {
                
format(stringsizeof(string), "* %s: %s | Rank: %s (3).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank3]);
            }
            else if(
PlayerInfo[i][pRank] == 4)
            {
                
format(stringsizeof(string), "* %s: %s | Rank: %s (4).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank4]);
            }
            else if(
PlayerInfo[i][pRank] == 5)
            {
                
format(stringsizeof(string), "* %s: %s | Rank: %s (5).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank5]);
            }
            else if(
PlayerInfo[i][pRank] == 6)
            {
                
format(stringsizeof(string), "* %s: %s | Rank: %s (6).",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank6]);
            }
            else
            {
                
format(stringsizeof(string), "* %s: %s | Rank: %s.",FamilyInfo[familyid][FamilyName],GetPlayerNameEx(i),FamilyInfo[familyid][FamilyRank1]);
            }
            
SendClientMessageEx(playeridCOLOR_GREYstring);
    }
    return 
1;

Reply
#2

Bump Anyone?
Reply
#3

bump after 48 hours , to make the post seen by scripters , now u are spamming
Reply
#4

Did I get it ?

Код:
CMD:families(playerid, params[]) 
{ 
    if(PlayerInfo[playerid][pFamily] == 0)
        return SendClientMessage(playerid, COLOR_WHITE, "Can't use");

    new string[128], familyid; 

    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
#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
#6

Quote:
Originally Posted by Drago987
Посмотреть сообщение
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;
}


++Rep You thanks for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)