- 0
PHPMyAdmin
-
Recently Browsing 0 members
- No registered users viewing this page.
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.
Question
TheGodfather
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
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 accountSign in
Already have an account? Sign in here.
Sign In Now