Jump to content
  • 0

Problema /members



Salut, uneori nu imi arata toti membrii din factiune aici.

YCMD:members(playerid, params[], help) return ShowFactionMembers(playerid);
ShowFactionMembers(playerid) {
    if(aspam[playerid] > 0) return SCMf(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Wait %d seconds.", aspam[playerid]);
    if(PlayerInfo[playerid][pMember] == 0) return 1;
    gQuery[0] = EOS;
    mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM `users` WHERE `users`.`Member` = '%d' ORDER BY `users`.`Rank` DESC LIMIT 50", PlayerInfo[playerid][pMember]);
    mysql_tquery(SQL, gQuery, "show_faction_members", "i", playerid);
    return 1;
function show_faction_members(playerid) {
    new MemberString[1024], TitleString[1024], name[MAX_PLAYER_NAME], lastl[32], rank, fw, tmembers, onmembers, days, member, commands;
    strcat(MemberString, "#. Name\tRank - FW\tDays - Raport Points\tStatus\n");
    for(new i, j = cache_num_rows(); i != j; ++i) {
        cache_get_field_content(i, "name", name);
        cache_get_field_content(i, "lastOn", lastl);
        rank = cache_get_field_content_int(i, "Rank");
        fw = cache_get_field_content_int(i, "FWarn");
        days = cache_get_field_content_int(i, "Days");
        member = cache_get_field_content_int(i, "Member");
        commands = cache_get_field_content_int(i, "Commands0");
        if(strlen(lastl) != 9) {
            format(Selected[playerid][tmembers], MAX_PLAYER_NAME, name);
            new userID = GetPlayerID(name);
            gString[0] = EOS;
            if(userID == INVALID_PLAYER_ID) onmembers++;
            if(rank == 7)
                format(gString, sizeof(gString), "%d. %s\t%d - %d/3\t%d - %d/10\t%s\n", tmembers+1, name, rank, fw, days, commands, userID != INVALID_PLAYER_ID ? "Online" : lastl);
                format(gString, sizeof(gString), "%d. %s\t%d - %d/3\t%d - %d/%d\t%s\n", tmembers+1, name, rank, fw, days, commands, DynamicFactions[member][fCommands][rank - 1], userID != INVALID_PLAYER_ID ? "Online" : lastl);
            strcat(MemberString, gString, sizeof(MemberString));
    format(TitleString, sizeof(TitleString), "Members");
    ShowPlayerDialog(playerid, DIALOG_MEMBERS, DIALOG_STYLE_TABLIST_HEADERS, TitleString, MemberString, "Ok", "Exit");
    return 1;

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Salutare !

Pai in primul rand verificand primul query pe care-l faci catre baza ai pus limit 50, dar nu cred ca ai avut 50 de jucatori intr-o factiune.

Parerea mea este sa maresti acest string 'MemberString' si sa testezi iar, pentru ca in unele cazuri string-ul este prea mic.

Sper ca ti-am fost de folos !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.