Posts: 82
Threads: 32
Joined: Feb 2019
Reputation:
0
I'm working on a clan system and i want to show the clan owner a list with all the members and i tried like this but it won't show me the members,it will show me this message SELECT * FROM `users` WHERE `users`.`Clanid` = 4
case 0:
{
format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `users`.`Clanid` = '%d'", PlayerInfo[playerid][pClanid]);
new Cache: result = mysql_query(mysql, szQuery);
cache_delete(result);
ShowPlayerDialog(playerid, DIALOG_CLANMEMBERS, DIALOG_STYLE_TABLIST_HEADERS, "Clan members:", szQuery, "Select", "Cancel");
}
Posts: 82
Threads: 32
Joined: Feb 2019
Reputation:
0
i 've seen someone do like this
case DIALOG_FACTIONMENU: {
if(!response) return 1;
new
fID = PlayerInfo[playerid][pFaction],
szDialog2[1024] = "Name\tRank\tFW\tStatus\n",
Members, szLocked[256],
szRank[256], szFW[256];
switch(listitem) {
case 0: {
format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `users`.`Faction` = '%d'", PlayerInfo[playerid][pFaction]); // pFaction
new Cache: result = mysql_query(mysql, szQuery);
for(new i, j = cache_get_row_count (); i != j; ++i)
{
cache_get_field_content(i, "Username", string);
cache_get_field_content(i, "Rank", szRank);
cache_get_field_content(i, "FactionWarns", szFW);
format(DialogSelected[playerid][Members], MAX_PLAYER_NAME, string);
new userID = GetPlayerID(string);
format(szDialog2, sizeof(szDialog2), "%s%s\t%d\t%d\t%s\n", szDialog2, string, strval(szRank), strval(szFW), (userID != INVALID_PLAYER_ID) ? ("online") : ("offline"));
Members++;
}
cache_delete(result);
if(Members == 0) {
if(PlayerInfo[playerid][pLanguage] == 1) return SCM(playerid, COLOR_WHITE, "Factiunea ta nu are membrii.");
else if(PlayerInfo[playerid][pLanguage] == 2) return SCM(playerid, COLOR_WHITE, "Your faction does not have members.");
}
ShowPlayerDialog(playerid, DIALOG_FMEMBERS, DIALOG_STYLE_TABLIST_HEADERS, "Faction Members:", szDialog2, "Select", "Back");