/clan -members
#4

You should use more tables, one for `gangs` and one for `gang_members`.
You should use threaded queries.
You should use an include that takes care of languages. Modifying many places in case you want to change something on text is not what you would expect.

The example you gave is below:
pawn Code:
case DIALOG_FACTIONMENU:
{
    if (!response) return 1;

    switch (listitem)
    {
        case 0:
        {
            format(szQuery, sizeof(szQuery), "SELECT Username,Rank,FactionWarns FROM users WHERE Faction = %d", PlayerInfo[playerid][pFaction]);
            mysql_tquery(mysql, szQuery, "OnFactionMembersLoad", "d", playerid);
        }
    }
}
pawn Code:
forward OnFactionMembersLoad(playerid);
public OnFactionMembersLoad(playerid)
{
    new rows = cache_get_row_count();

    if (rows)
    {
        new
            member_name[MAX_PLAYER_NAME],
            szDialog2[1024] = "Name\tRank\tFW\tStatus\n";

        for (new i; i < rows; i++)
        {
            cache_get_row(i, 0, member_name);

            format(szDialog2, sizeof(szDialog2), "%s%s\t%d\t%d\t%s\n", szDialog2, member_name, cache_get_row_int(i, 1), cache_get_row_int(i, 2), GetPlayerID(member_name) != INVALID_PLAYER_ID ? ("online") : ("offline"));
        }

        ShowPlayerDialog(playerid, DIALOG_FMEMBERS, DIALOG_STYLE_TABLIST_HEADERS, "Faction Members:", szDialog2, "Select", "Back");
    }
    else
    {
        if (PlayerInfo[playerid][pLanguage] == 1)
        {
            SCM(playerid, COLOR_WHITE, "Factiunea ta nu are membrii.");
        }
        else if (PlayerInfo[playerid][pLanguage] == 2)
        {
            SCM(playerid, COLOR_WHITE, "Your faction does not have members.");
        }
    }
}
Reply


Messages In This Thread
/clan -members - by bosmania - 02.03.2019, 08:27
Re: /clan -members - by Calisthenics - 02.03.2019, 09:21
Re: /clan -members - by bosmania - 02.03.2019, 09:26
Re: /clan -members - by Calisthenics - 02.03.2019, 09:49

Forum Jump:


Users browsing this thread: 1 Guest(s)