Jump to content
  • 0

Problema /leaders Pe Dialog.


HuZuM

Question

Am incercat sa pun comanda /leaders pe dialog dar nu stiu de ce imi apare doar ultima factiune pe dialog. Asa imi apare: http://i.imgur.com/WjN66pd.png 

CMD:leaders(playerid, params[])

{
    for(new xf = 0; xf <= MAX_GROUPS; xf++)
    {
        if(strlen(groupVariables[xf][gGroupName]) >= 1 && strcmp(groupVariables[xf][gGroupName], "None", true))
                {
                        new query[256];
                        format(query, 256, "SELECT * FROM `playeraccounts` WHERE `playerGroup` = '%d' AND `playerGroupRank` = '7'", xf);
                        mysql_query(query); 
                        new lead[MAX_PLAYER_NAME];
                        format(lead, MAX_PLAYER_NAME, "None");
                        mysql_store_result();
                        if(mysql_retrieve_row())
                        {
                                mysql_fetch_field_row(query, "playerName");
                                format(lead, MAX_PLAYER_NAME, "%s", query);
                        }
                        new on;
                        if(strcmp(lead, "None", true))
                        {
                                new on2;
                                on2 = GetPlayerID(lead);
                                if(IsPlayerConnected(on2))
                                {
                                        on = 1;
                                }
                                else on = 0;
                        }
                        mysql_free_result();
                        new memb;
                        foreach(Player, xf)
                        {
                                if(playerVariables[playerid][pGroup] == xf)
                                {
                                        memb++;
                                }
                        }
                        format(query, sizeof(query), "SELECT * FROM `playeraccounts` WHERE `playerGroup` = '%d'", xf);
                        mysql_query(query);
                        mysql_store_result();
                        new membs;
                        membs = mysql_num_rows();
                        mysql_free_result();
                        new string[256];
                        string[ 0 ] = EOS ;
                        if(on == 1)
                        {

                                format(string, sizeof(string), "%s - Leader: %s (online) - Members online: %d - Total members: %dn", groupVariables[xf][gGroupName], membs, memb);
                        }
                        else
                        {
                                format(string, sizeof(string), "%s - Leader: %s (offline) - Members online: %d - Total members: %dn", groupVariables[xf][gGroupName], membs, memb);
                                }
                                ShowPlayerDialog(playerid, 64, DIALOG_STYLE_LIST, "Leaders", string, "Close" , "Ok");
                        }

    }
   return 1;
}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.