Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Salut, vrea ca prin o comanda sa pot lua numele si valoarea de tip int din campul Blacklist din baza de date a tuturor playerilor care au valoarea din Blacklist > 0. Asa am facut pana acum si imi da valoarea doar la o persoana.

YCMD:blacklistplayers(playerid, params[], help) {
    if(aspam[playerid] > 0) return SCMEx(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Asteapta %d secunde.", aspam[playerid]);
    if(PlayerInfo[playerid][pScripter] < 1) return SCM(playerid, COLOR_GREY, "Nu ai dreptul de a utiliza aceasta comanda.");
    ShowPlayerDialog(playerid, DIALOG_BLACKLISTT, DIALOG_STYLE_LIST, "Blacklist players (verificare admin)", "Admins", "Ok", "Close");
    return 1;
}

case DIALOG_BLACKLISTT: {
            if(!response) return true;
            new szQuery[256], szResult[256], szDialog2[256], Cache: result, szName[180], szAdmin, szDialog[128], szTitle[128];
            format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Blacklist`>'0' ORDER BY `users`.`Blacklist` ASC LIMIT 50");
            result = mysql_query(SQL, szQuery);            
            strcat(szDialog2, "Name\tBlacklist value\n");
            for(new i, j = cache_num_rows(); i < j; i++)
            {
                cache_get_field_content(i, "name", szResult); format(szName, 256, szResult);
                cache_get_field_content(i, "Blacklist", szResult); szAdmin = strval(szResult);        
            }
            format(szDialog, sizeof(szDialog), "%s %d\n", szName, szAdmin);
            strcat(szDialog2, szDialog);
            format(szTitle, sizeof(szTitle), "Admins");
            ShowPlayerDialog(playerid, DIALOG_BLACKLISTT+2, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog2, "Ok", "Back");
            cache_delete(result);
        }

case DIALOG_BLACKLISTT+2: {
            if(!response) return ShowPlayerDialog(playerid, DIALOG_BLACKLISTT, DIALOG_STYLE_LIST, "Admins", "Admins", "Ok", "Close");
        }

2 answers to this question

Recommended Posts

  • 0
Posted

format(szDialog, sizeof(szDialog), "%s%s %d\n", szDialog, szName, szAdmin);

Il pui in loop unde preiei numele/blacklist, si nu il pui si dupa. Pentru ce ai facut tu iti va arata doar ultima valoare care ti-o returneaza in loop.

  • 0
Posted
Acum 7 minute, Banditul a spus:

format(szDialog, sizeof(szDialog), "%s%s %d\n", szDialog, szName, szAdmin);

Il pui in loop unde preiei numele/blacklist, si nu il pui si dupa. Pentru ce ai facut tu iti va arata doar ultima valoare care ti-o returneaza in loop.

Merge, multumesc frumos.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.